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