00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 import copy
00020 import threading
00021 import OpenRTM_aist
00022 import RTC
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 class InPortBase(OpenRTM_aist.PortBase, OpenRTM_aist.DataPortStatus):
00059 """
00060 """
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087 def __init__(self, name, data_type):
00088 OpenRTM_aist.PortBase.__init__(self,name)
00089 self._rtcout.RTC_DEBUG("Port name: %s", name)
00090 self._singlebuffer = True
00091 self._thebuffer = None
00092 self._properties = OpenRTM_aist.Properties()
00093 self._providerTypes = ""
00094 self._consumerTypes = ""
00095 self._connectors = []
00096 self._connector_mutex = threading.RLock()
00097
00098
00099 self._rtcout.RTC_DEBUG("setting port.port_type: DataInPort")
00100 self.addProperty("port.port_type", "DataInPort")
00101
00102 self._rtcout.RTC_DEBUG("setting port.data_type: %s", data_type)
00103 self.addProperty("dataport.data_type", data_type)
00104
00105 self.addProperty("dataport.subscription_type", "Any")
00106 self._value = None
00107 self._listeners = OpenRTM_aist.ConnectorListeners()
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 def __del__(self, PortBase=OpenRTM_aist.PortBase):
00124 self._rtcout.RTC_TRACE("InPortBase destructor")
00125
00126 if len(self._connectors) != 0:
00127 self._rtcout.RTC_ERROR("connector.size should be 0 in InPortBase's dtor.")
00128
00129 for connector in self._connectors:
00130 connector.disconnect()
00131
00132 if self._thebuffer is not None:
00133 OpenRTM_aist.CdrBufferFactory.instance().deleteObject(self._thebuffer)
00134 if not self._singlebuffer:
00135 self._rtcout.RTC_ERROR("Although singlebuffer flag is true, the buffer != 0")
00136
00137 PortBase.__del__(self)
00138 return
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157 def init(self,prop):
00158 self._rtcout.RTC_TRACE("init()")
00159 self._properties.mergeProperties(prop)
00160 if self._singlebuffer:
00161 self._rtcout.RTC_DEBUG("single buffer mode.")
00162 self._thebuffer = OpenRTM_aist.CdrBufferFactory.instance().createObject("ring_buffer")
00163
00164 if self._thebuffer is None:
00165 self._rtcout.RTC_ERROR("default buffer creation failed")
00166 else:
00167 self._rtcout.RTC_DEBUG("multi buffer mode.")
00168
00169 self.initProviders()
00170 self.initConsumers()
00171
00172 num = [-1]
00173 if not OpenRTM_aist.stringTo(num, self._properties.getProperty("connection_limit","-1")):
00174 self._rtcout.RTC_ERROR("invalid connection_limit value: %s",
00175 self._properties.getProperty("connection_limit"))
00176
00177 self.setConnectionLimit(num[0])
00178 return
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196 def read(self):
00197 pass
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217 def properties(self):
00218 self._rtcout.RTC_TRACE("properties()")
00219 return self._properties
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241 def connectors(self):
00242 self._rtcout.RTC_TRACE("connectors(): size = %d", len(self._connectors))
00243
00244 return self._connectors
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266 def getConnectorProfiles(self):
00267 self._rtcout.RTC_TRACE("getConnectorProfiles(): size = %d", len(self._connectors))
00268 profs = []
00269
00270 for con in self._connectors:
00271 profs.append(con.profile())
00272
00273 return profs
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294 def getConnectorIds(self):
00295 ids = []
00296
00297
00298 for con in self._connectors:
00299 ids.append(con.id())
00300
00301 self._rtcout.RTC_TRACE("getConnectorIds(): %s", OpenRTM_aist.flatten(ids))
00302 return ids
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323 def getConnectorNames(self):
00324 names = []
00325
00326 for con in self._connectors:
00327 names.append(con.name())
00328
00329 self._rtcout.RTC_TRACE("getConnectorNames(): %s", OpenRTM_aist.flatten(names))
00330 return names
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353 def getConnectorById(self, id):
00354 self._rtcout.RTC_TRACE("getConnectorById(id = %s)", id)
00355
00356 for con in self._connectors:
00357 if id == con.id():
00358 return con
00359
00360 self._rtcout.RTC_WARN("ConnectorProfile with the id(%s) not found.", id)
00361 return None
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384 def getConnectorByName(self, name):
00385 self._rtcout.RTC_TRACE("getConnectorByName(name = %s)", name)
00386
00387 for con in self._connectors:
00388 if name == con.name():
00389 return con
00390
00391 self._rtcout.RTC_WARN("ConnectorProfile with the name(%s) not found.", name)
00392 return None
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418 def getConnectorProfileById(self, id, prof):
00419 self._rtcout.RTC_TRACE("getConnectorProfileById(id = %s)", id)
00420
00421
00422 conn = self.getConnectorById(id)
00423 if not conn:
00424 return False
00425 prof[0] = conn.profile()
00426 return True
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453 def getConnectorProfileByName(self, name, prof):
00454 self._rtcout.RTC_TRACE("getConnectorProfileByName(name = %s)", name)
00455
00456
00457 conn = self.getConnectorByName(name)
00458 if not conn:
00459 return False
00460 prof[0] = conn.profile()
00461 return True
00462
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489 def connect(self, connector_profile):
00490 self._rtcout.RTC_TRACE("InPortBase.connect()")
00491
00492 if OpenRTM_aist.NVUtil.find_index(connector_profile.properties,
00493 "dataport.serializer.cdr.endian") is -1:
00494 self._rtcout.RTC_TRACE("ConnectorProfile dataport.serializer.cdr.endian set.")
00495 connector_profile.properties.append(OpenRTM_aist.NVUtil.newNV("dataport.serializer.cdr.endian","little,big"))
00496
00497 return OpenRTM_aist.PortBase.connect(self, connector_profile)
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516 def activateInterfaces(self):
00517 self._rtcout.RTC_TRACE("activateInterfaces()")
00518
00519
00520 for connector in self._connectors:
00521 connector.activate()
00522 self._rtcout.RTC_DEBUG("activate connector: %s %s",
00523 (connector.name(),connector.id()))
00524
00525 return
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545 def deactivateInterfaces(self):
00546 self._rtcout.RTC_TRACE("deactivateInterfaces()")
00547
00548
00549 for connector in self._connectors:
00550 connector.deactivate()
00551 self._rtcout.RTC_DEBUG("deactivate connector: %s %s",
00552 (connector.name(),connector.id()))
00553 return
00554
00555
00556
00557
00558
00559
00560
00561
00562
00563
00564
00565
00566
00567
00568
00569
00570
00571
00572
00573
00574
00575
00576
00577
00578
00579
00580
00581
00582
00583
00584
00585
00586
00587
00588
00589
00590
00591
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620
00621
00622
00623
00624
00625
00626
00627
00628
00629
00630
00631
00632
00633
00634
00635 def addConnectorDataListener(self, listener_type, listener, autoclean = True):
00636 self._rtcout.RTC_TRACE("addConnectorDataListener()")
00637
00638 if listener_type < OpenRTM_aist.ConnectorDataListenerType.CONNECTOR_DATA_LISTENER_NUM:
00639 self._listeners.connectorData_[listener_type].addListener(listener, autoclean)
00640 return
00641
00642 self._rtcout.RTC_ERROR("addConnectorDataListener(): Invalid listener type.")
00643 return
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667 def removeConnectorDataListener(self, listener_type, listener):
00668 self._rtcout.RTC_TRACE("removeConnectorDataListener()")
00669
00670 if listener_type < OpenRTM_aist.ConnectorDataListenerType.CONNECTOR_DATA_LISTENER_NUM:
00671 self._listeners.connectorData_[listener_type].removeListener(listener)
00672 return
00673
00674 self._rtcout.RTC_ERROR("removeConnectorDataListener(): Invalid listener type.")
00675 return
00676
00677
00678
00679
00680
00681
00682
00683
00684
00685
00686
00687
00688
00689
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714
00715
00716
00717
00718
00719
00720
00721
00722
00723
00724
00725
00726
00727
00728
00729
00730
00731
00732
00733 def addConnectorListener(self, listener_type, listener, autoclean = True):
00734 self._rtcout.RTC_TRACE("addConnectorListener()")
00735
00736 if listener_type < OpenRTM_aist.ConnectorListenerType.CONNECTOR_LISTENER_NUM:
00737 self._listeners.connector_[listener_type].addListener(listener, autoclean)
00738 return
00739
00740 self._rtcout.RTC_ERROR("addConnectorListener(): Invalid listener type.")
00741 return
00742
00743
00744
00745
00746
00747
00748
00749
00750
00751
00752
00753
00754
00755
00756
00757
00758
00759
00760
00761
00762
00763
00764
00765 def removeConnectorListener(self, listener_type, listener):
00766 self._rtcout.RTC_TRACE("removeConnectorListener()")
00767
00768 if listener_type < OpenRTM_aist.ConnectorListenerType.CONNECTOR_LISTENER_NUM:
00769 self._listeners.connector_[listener_type].removeListener(listener)
00770 return
00771
00772 self._rtcout.RTC_ERROR("removeConnectorListener(): Invalid listener type.")
00773 return
00774
00775
00776
00777
00778
00779
00780
00781
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805 def publishInterfaces(self, cprof):
00806 self._rtcout.RTC_TRACE("publishInterfaces()")
00807
00808 retval = self._publishInterfaces()
00809 if retval != RTC.RTC_OK:
00810 return retval
00811
00812
00813 prop = copy.deepcopy(self._properties)
00814
00815 conn_prop = OpenRTM_aist.Properties()
00816 OpenRTM_aist.NVUtil.copyToProperties(conn_prop, cprof.properties)
00817 prop.mergeProperties(conn_prop.getNode("dataport"))
00818
00819
00820 prop.mergeProperties(conn_prop.getNode("dataport.inport"))
00821
00822
00823
00824
00825
00826
00827
00828 dflow_type = prop.getProperty("dataflow_type")
00829 dflow_type = OpenRTM_aist.normalize([dflow_type])
00830
00831 if dflow_type == "push":
00832 self._rtcout.RTC_DEBUG("dataflow_type = push .... create PushConnector")
00833
00834
00835 provider = self.createProvider(cprof, prop)
00836
00837 if not provider:
00838 self._rtcout.RTC_ERROR("InPort provider creation failed.")
00839 return RTC.BAD_PARAMETER
00840
00841
00842 connector = self.createConnector(cprof, prop, provider_=provider)
00843 if not connector:
00844 self._rtcout.RTC_ERROR("PushConnector creation failed.")
00845 return RTC.RTC_ERROR
00846
00847 connector.setDataType(self._value)
00848 provider.setConnector(connector)
00849
00850 self._rtcout.RTC_DEBUG("publishInterfaces() successfully finished.")
00851 return RTC.RTC_OK
00852
00853 elif dflow_type == "pull":
00854 self._rtcout.RTC_DEBUG("dataflow_type = pull .... do nothing")
00855 return RTC.RTC_OK
00856
00857 self._rtcout.RTC_ERROR("unsupported dataflow_type")
00858 return RTC.BAD_PARAMETER
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889 def subscribeInterfaces(self, cprof):
00890 self._rtcout.RTC_TRACE("subscribeInterfaces()")
00891
00892
00893 prop = copy.deepcopy(self._properties)
00894 conn_prop = OpenRTM_aist.Properties()
00895 OpenRTM_aist.NVUtil.copyToProperties(conn_prop, cprof.properties)
00896 prop.mergeProperties(conn_prop.getNode("dataport"))
00897 prop.mergeProperties(conn_prop.getNode("dataport.inport"))
00898
00899
00900
00901
00902
00903
00904
00905 dflow_type = prop.getProperty("dataflow_type")
00906 dtype = [dflow_type]
00907 OpenRTM_aist.normalize(dtype)
00908 dflow_type = dtype[0]
00909
00910 profile = OpenRTM_aist.ConnectorInfo(cprof.name,
00911 cprof.connector_id,
00912 OpenRTM_aist.CORBA_SeqUtil.refToVstring(cprof.ports),
00913 prop)
00914 if dflow_type == "push":
00915 self._rtcout.RTC_DEBUG("dataflow_type = push .... do nothing")
00916
00917 conn = self.getConnectorById(cprof.connector_id)
00918
00919 if not conn:
00920 self._rtcout.RTC_ERROR("specified connector not found: %s",
00921 cprof.connector_id)
00922 return RTC.RTC_ERROR
00923
00924 ret = conn.setConnectorInfo(profile)
00925 if ret == RTC.RTC_OK:
00926 self._rtcout.RTC_DEBUG("subscribeInterfaces() successfully finished.")
00927
00928 return ret
00929
00930 elif dflow_type == "pull":
00931 self._rtcout.RTC_DEBUG("dataflow_type = pull .... create PullConnector")
00932
00933
00934 consumer = self.createConsumer(cprof, prop)
00935 if not consumer:
00936 return RTC.BAD_PARAMETER
00937
00938
00939 connector = self.createConnector(cprof, prop, consumer_=consumer)
00940 if not connector:
00941 return RTC.RTC_ERROR
00942
00943 ret = connector.setConnectorInfo(profile)
00944
00945 if ret == RTC.RTC_OK:
00946 self._rtcout.RTC_DEBUG("publishInterface() successfully finished.")
00947
00948 return ret
00949
00950 self._rtcout.RTC_ERROR("unsupported dataflow_type")
00951 return RTC.BAD_PARAMETER
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976 def unsubscribeInterfaces(self, connector_profile):
00977 self._rtcout.RTC_TRACE("unsubscribeInterfaces()")
00978
00979 id = connector_profile.connector_id
00980 self._rtcout.RTC_PARANOID("connector_id: %s", id)
00981
00982 len_ = len(self._connectors)
00983 for i in range(len_):
00984 idx = (len_ - 1) - i
00985
00986 if id == self._connectors[idx].id():
00987
00988 self._connectors[idx].deactivate()
00989 self._connectors[idx].disconnect()
00990 del self._connectors[idx]
00991 self._rtcout.RTC_TRACE("delete connector: %s", id)
00992 return
00993
00994 self._rtcout.RTC_ERROR("specified connector not found: %s", id)
00995 return
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006 def initProviders(self):
01007 self._rtcout.RTC_TRACE("initProviders()")
01008
01009
01010 factory = OpenRTM_aist.InPortProviderFactory.instance()
01011 provider_types = factory.getIdentifiers()
01012
01013 self._rtcout.RTC_DEBUG("available providers: %s",
01014 OpenRTM_aist.flatten(provider_types))
01015
01016 if self._properties.hasKey("provider_types") and \
01017 OpenRTM_aist.normalize(self._properties.getProperty("provider_types")) != "all":
01018 self._rtcout.RTC_DEBUG("allowed providers: %s",
01019 self._properties.getProperty("provider_types"))
01020
01021 temp_types = provider_types
01022 provider_types = []
01023 active_types = OpenRTM_aist.split(self._properties.getProperty("provider_types"), ",")
01024
01025 temp_types.sort()
01026 active_types.sort()
01027
01028 set_ptypes = set(temp_types).intersection(set(active_types))
01029 provider_types = provider_types + list(set_ptypes)
01030
01031
01032 if len(provider_types) > 0:
01033 self._rtcout.RTC_DEBUG("dataflow_type push is supported")
01034 self.appendProperty("dataport.dataflow_type", "push")
01035 self.appendProperty("dataport.interface_type",
01036 OpenRTM_aist.flatten(provider_types))
01037
01038 self._providerTypes = provider_types
01039 return
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050 def initConsumers(self):
01051 self._rtcout.RTC_TRACE("initConsumers()")
01052
01053
01054 factory = OpenRTM_aist.OutPortConsumerFactory.instance()
01055 consumer_types = factory.getIdentifiers()
01056 self._rtcout.RTC_DEBUG("available consumers: %s",
01057 OpenRTM_aist.flatten(consumer_types))
01058
01059 if self._properties.hasKey("consumer_types") and \
01060 OpenRTM_aist.normalize(self._properties.getProperty("consumer_types")) != "all":
01061 self._rtcout.RTC_DEBUG("allowed consumers: %s",
01062 self._properties.getProperty("consumer_types"))
01063
01064 temp_types = consumer_types
01065 consumer_types = []
01066 active_types = OpenRTM_aist.split(self._properties.getProperty("consumer_types"), ",")
01067
01068 temp_types.sort()
01069 active_types.sort()
01070
01071 set_ctypes = set(temp_types).intersection(set(active_types))
01072 consumer_types = consumer_types + list(set_ctypes)
01073
01074
01075 if len(consumer_types) > 0:
01076 self._rtcout.RTC_PARANOID("dataflow_type pull is supported")
01077 self.appendProperty("dataport.dataflow_type", "pull")
01078 self.appendProperty("dataport.interface_type",
01079 OpenRTM_aist.flatten(consumer_types))
01080
01081 self._consumerTypes = consumer_types
01082 return
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098 def createProvider(self, cprof, prop):
01099 if not prop.getProperty("interface_type") and \
01100 not OpenRTM_aist.includes(self._providerTypes, prop.getProperty("interface_type")):
01101 self._rtcout.RTC_ERROR("no provider found")
01102 self._rtcout.RTC_DEBUG("interface_type: %s", prop.getProperty("interface_type"))
01103 self._rtcout.RTC_DEBUG("interface_types: %s",
01104 OpenRTM_aist.flatten(self._providerTypes))
01105 return 0
01106
01107
01108 self._rtcout.RTC_DEBUG("interface_type: %s", prop.getProperty("interface_type"))
01109 provider = OpenRTM_aist.InPortProviderFactory.instance().createObject(prop.getProperty("interface_type"))
01110
01111 if provider != 0:
01112 self._rtcout.RTC_DEBUG("provider created")
01113 provider.init(prop.getNode("provider"))
01114
01115 if not provider.publishInterface(cprof.properties):
01116 self._rtcout.RTC_ERROR("publishing interface information error")
01117 OpenRTM_aist.InPortProviderFactory.instance().deleteObject(provider)
01118 return 0
01119 return provider
01120
01121 self._rtcout.RTC_ERROR("provider creation failed")
01122 return 0
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138 def createConsumer(self, cprof, prop):
01139 if not prop.getProperty("interface_type") and \
01140 not OpenRTM_aist.includes(self._consumerTypes, prop.getProperty("interface_type")):
01141 self._rtcout.RTC_ERROR("no consumer found")
01142 self._rtcout.RTC_DEBUG("interface_type: %s", prop.getProperty("interface_type"))
01143 self._rtcout.RTC_DEBUG("interface_types: %s",
01144 OpenRTM_aist.flatten(self._consumerTypes))
01145 return 0
01146
01147 self._rtcout.RTC_DEBUG("interface_type: %s", prop.getProperty("interface_type"))
01148 consumer = OpenRTM_aist.OutPortConsumerFactory.instance().createObject(prop.getProperty("interface_type"))
01149
01150 if consumer != 0:
01151 self._rtcout.RTC_DEBUG("consumer created")
01152 consumer.init(prop.getNode("consumer"))
01153
01154 if not consumer.subscribeInterface(cprof.properties):
01155 self._rtcout.RTC_ERROR("interface subscription failed.")
01156 OpenRTM_aist.OutPortConsumerFactory.instance().deleteObject(consumer)
01157 return 0
01158 return consumer
01159
01160 self._rtcout.RTC_ERROR("consumer creation failed")
01161 return 0
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178 def createConnector(self, cprof, prop, provider_=None, consumer_=None):
01179 profile = OpenRTM_aist.ConnectorInfo(cprof.name,
01180 cprof.connector_id,
01181 OpenRTM_aist.CORBA_SeqUtil.refToVstring(cprof.ports),
01182 prop)
01183 connector = None
01184
01185
01186 try:
01187 if provider_ is not None:
01188 if self._singlebuffer:
01189 connector = OpenRTM_aist.InPortPushConnector(profile, provider_,
01190 self._listeners,
01191 self._thebuffer)
01192 else:
01193 connector = OpenRTM_aist.InPortPushConnector(profile, provider_,
01194 self._listeners)
01195
01196 elif consumer_ is not None:
01197 if self._singlebuffer:
01198 connector = OpenRTM_aist.InPortPullConnector(profile, consumer_,
01199 self._listeners,
01200 self._thebuffer)
01201 else:
01202 connector = OpenRTM_aist.InPortPullConnector(profile, consumer_,
01203 self._listeners)
01204
01205 else:
01206 self._rtcout.RTC_ERROR("provider or consumer is not passed. returned 0;")
01207 return 0
01208
01209
01210 if connector is None:
01211 self._rtcout.RTC_ERROR("InPortConnector creation failed")
01212 return 0
01213
01214 if provider_ is not None:
01215 self._rtcout.RTC_TRACE("InPortPushConnector created")
01216 elif consumer_ is not None:
01217 self._rtcout.RTC_TRACE("InPortPullConnector created")
01218
01219
01220 self._connectors.append(connector)
01221 self._rtcout.RTC_PARANOID("connector push backed: %d", len(self._connectors))
01222 return connector
01223 except:
01224 self._rtcout.RTC_ERROR("InPortPushConnector creation failed")
01225 self._rtcout.RTC_ERROR(OpenRTM_aist.Logger.print_exception())
01226 return 0
01227
01228 self._rtcout.RTC_FATAL("never comes here: createConnector()")
01229 return 0