OutPortPushConnectorTests.cpp
Go to the documentation of this file.
1 // -*- C++ -*-
22 #ifndef OutPortPushConnector_cpp
23 #define OutPortPushConnector_cpp
24 
25 #include <cppunit/ui/text/TestRunner.h>
26 #include <cppunit/TextOutputter.h>
27 #include <cppunit/extensions/TestFactoryRegistry.h>
28 #include <cppunit/extensions/HelperMacros.h>
29 #include <cppunit/TestAssert.h>
30 
31 #include <coil/Properties.h>
32 
33 #include <rtm/idl/BasicDataTypeSkel.h>
34 #include <rtm/idl/DataPortSkel.h>
35 #include <rtm/Typename.h>
37 #include <rtm/CdrBufferBase.h>
38 #include <rtm/CORBA_SeqUtil.h>
39 #include <rtm/NVUtil.h>
40 #include <rtm/ConnectorBase.h>
41 #include <rtm/DataPortStatus.h>
42 #include <rtm/InPortBase.h>
43 #include <rtm/InPortConsumer.h>
44 #include <rtm/OutPortBase.h>
45 #include <rtm/PortAdmin.h>
46 #include <rtm/CorbaConsumer.h>
47 #include <rtm/PublisherBase.h>
48 
54 {
55 
57  : public RTC::ConnectorDataListenerT<RTC::TimedLong>
58  {
59  public:
60  DataListener(const char* name) : m_name(name) {}
61  virtual ~DataListener()
62  {
63  //std::cout << "dtor of " << m_name << std::endl;
64  }
65 
66  virtual void operator()(const RTC::ConnectorInfo& info,
67  const RTC::TimedLong& data)
68  {
69  //std::cout << "------------------------------" << std::endl;
70  //std::cout << "Data Listener: " << m_name << std::endl;
71  //std::cout << "Profile::name: " << info.name << std::endl;
72  //std::cout << "------------------------------" << std::endl;
73  };
74  std::string m_name;
75  };
76 
77 
79  : public RTC::ConnectorListener
80  {
81  public:
82  ConnListener(const char* name) : m_name(name) {}
83  virtual ~ConnListener()
84  {
85  //std::cout << "dtor of " << m_name << std::endl;
86  }
87 
88  virtual void operator()(const RTC::ConnectorInfo& info)
89  {
90  std::cout << "------------------------------" << std::endl;
91  std::cout << "Connector Listener: " << m_name << std::endl;
92  std::cout << "Profile::name: " << info.name << std::endl;
93  std::cout << "------------------------------" << std::endl;
94  };
95  std::string m_name;
96  };
97 
103  class Logger
104  {
105  public:
106  void log(const std::string& msg)
107  {
108  m_log.push_back(msg);
109  }
110 
111  int countLog(const std::string& msg)
112  {
113  int count = 0;
114  for (int i = 0; i < (int) m_log.size(); ++i)
115  {
116  if (m_log[i] == msg) ++count;
117  }
118  return count;
119  }
120 
121  private:
122  std::vector<std::string> m_log;
123  };
124 
131  : public RTC::InPortConsumer,
132  public RTC::CorbaConsumer< ::OpenRTM::InPortCdr >
133  {
134 
135  public:
137  {
138  m_logger = NULL;
139  }
141  {
142  }
148  {
149  if (m_logger != NULL)
150  {
151  m_logger->log("InPortCorbaCdrConsumerMock::init");
152  }
153  }
158  RTC::InPortConsumer::ReturnCode put(const cdrMemoryStream& data)
159  {
160  return PORT_OK;
161  }
167  {
168  return;
169  }
170 
175  bool subscribeInterface(const SDOPackage::NVList& properties)
176  {
177 
178  return true;;
179  }
180 
185  void unsubscribeInterface(const SDOPackage::NVList& properties)
186  {
187  }
188 
189 
195  {
196  m_logger = logger;
197  }
198  private:
200 
201  };
208  : public RTC::PublisherBase
209  {
210  public:
212  {
213  m_logger = NULL;
214  }
216  {
217  }
222  RTC::PublisherBase::ReturnCode write(const cdrMemoryStream& data,
223  unsigned long sec,
224  unsigned long usec)
225  {
226  cdrMemoryStream cdr(data);
227  CORBA::ULong inlen = cdr.bufSize();
228 
229  RTC::TimedLong td;
230  td <<= cdr;
231  std::stringstream ss;
232  ss << td.data;
233  if (m_logger != NULL)
234  {
235  m_logger->log("PublisherFlushMock::write");
236  m_logger->log(ss.str());
237  }
238  logger.log("PublisherFlushMock::write");
239  logger.log(ss.str());
240  return PORT_OK;
241  }
246  bool isActive()
247  {
248  return true;
249  }
250 
256  {
257  if (m_logger != NULL)
258  {
259  m_logger->log("PublisherFlushMock::activate");
260  }
261  logger.log("PublisherFlushMock::activate");
262  return PORT_OK;
263  }
264 
270  {
271  if (m_logger != NULL)
272  {
273  m_logger->log("PublisherFlushMock::deactivate");
274  }
275  logger.log("PublisherFlushMock::deactivate");
276  return PORT_OK;
277  }
283  {
284  return PORT_OK;
285  }
291  {
292  if (m_logger != NULL)
293  {
294  m_logger->log("PublisherFlushMock::setConsumer");
295  }
296  logger.log("PublisherFlushMock::setConsumer");
297  return PORT_OK;
298  }
299 
305  {
306  if (m_logger != NULL)
307  {
308  m_logger->log("PublisherFlushMock::setBuffer");
309  if(buffer == NULL)
310  {
311  m_logger->log("buffer NG");
312  }
313  else
314  {
315  m_logger->log("buffer OK");
316  }
317  }
318  logger.log("PublisherFlushMock::setBuffer");
319  if(buffer == NULL)
320  {
321  logger.log("buffer NG");
322  }
323  else
324  {
325  logger.log("buffer OK");
326  }
327  return PORT_OK;
328  }
329 
335  RTC::ConnectorListeners* listeners)
336  {
337  if (m_logger != NULL)
338  {
339  m_logger->log("PublisherFlushMock::setListener");
340  if (listeners == 0)
341  {
342  m_logger->log("listeners NG");
343  }
344  else
345  {
346  m_logger->log("listeners OK");
347  }
348  }
349  logger.log("PublisherFlushMock::setListener");
350  if (listeners == 0)
351  {
352  logger.log("listeners NG");
353  }
354  else
355  {
356  logger.log("listeners OK");
357  }
358  return PORT_OK;
359  }
360 
366  {
367  m_logger = logger;
368  }
369  static Logger logger;
370  private:
372  };
373 
375 
382  : public RTC::PublisherBase
383  {
384  public:
386  {
387  m_logger = NULL;
388  }
390  {
391  }
396  RTC::PublisherBase::ReturnCode write(const cdrMemoryStream& data,
397  unsigned long sec,
398  unsigned long usec)
399  {
400  cdrMemoryStream cdr(data);
401  CORBA::ULong inlen = cdr.bufSize();
402 
403  RTC::TimedLong td;
404  td <<= cdr;
405  std::stringstream ss;
406  ss << td.data;
407 
408  if (m_logger != NULL)
409  {
410  m_logger->log("PublisherNewMock::write");
411  m_logger->log(ss.str());
412  }
413  logger.log("PublisherNewMock::write");
414  logger.log(ss.str());
415  return PORT_OK;
416  }
421  bool isActive()
422  {
423  return true;
424  }
425 
431  {
432  if (m_logger != NULL)
433  {
434  m_logger->log("PublisherNewMock::activate");
435  }
436  logger.log("PublisherNewMock::activate");
437  return PORT_OK;
438  }
439 
445  {
446  if (m_logger != NULL)
447  {
448  m_logger->log("PublisherNewMock::deactivate");
449  }
450  logger.log("PublisherNewMock::deactivate");
451  return PORT_OK;
452  }
453 
459  {
460  return PORT_OK;
461  }
462 
468  {
469  if (m_logger != NULL)
470  {
471  m_logger->log("PublisherNewMock::setConsumer");
472  }
473  logger.log("PublisherNewMock::setConsumer");
474  return PORT_OK;
475  }
476 
482  {
483  if (m_logger != NULL)
484  {
485  m_logger->log("PublisherNewMock::setBuffer");
486  if(buffer == NULL)
487  {
488  m_logger->log("buffer NG");
489  }
490  else
491  {
492  m_logger->log("buffer OK");
493  }
494  }
495  logger.log("PublisherNewMock::setBuffer");
496  if(buffer == NULL)
497  {
498  logger.log("buffer NG");
499  }
500  else
501  {
502  logger.log("buffer OK");
503  }
504  return PORT_OK;
505  }
506 
512  RTC::ConnectorListeners* listeners)
513  {
514  if (m_logger != NULL)
515  {
516  m_logger->log("PublisherNewMock::setListener");
517  if (listeners == 0)
518  {
519  m_logger->log("listeners NG");
520  }
521  else
522  {
523  m_logger->log("listeners OK");
524  }
525  }
526  logger.log("PublisherNewMock::setListener");
527  if (listeners == 0)
528  {
529  logger.log("listeners NG");
530  }
531  else
532  {
533  logger.log("listeners OK");
534  }
535  return PORT_OK;
536  }
537 
543  {
544  m_logger = logger;
545  }
546  static Logger logger;
547  private:
549  };
550 
552 
554  : public CppUnit::TestFixture
555  {
556  CPPUNIT_TEST_SUITE(OutPortPushConnectorTests);
557 
558  CPPUNIT_TEST(test_OutPortPushConnector);
559  CPPUNIT_TEST(test_write);
560  CPPUNIT_TEST(test_disconnect_getBuffer);
561  CPPUNIT_TEST(test_activate_deactivate);
562 
563  CPPUNIT_TEST_SUITE_END();
564 
565  private:
566  CORBA::ORB_ptr m_pORB;
567  PortableServer::POA_ptr m_pPOA;
568 
569 
570  public:
572 
577  {
578 
579  int argc(0);
580  char** argv(NULL);
581  m_pORB = CORBA::ORB_init(argc, argv);
582  m_pPOA = PortableServer::POA::_narrow(
583  m_pORB->resolve_initial_references("RootPOA"));
584  m_pPOA->the_POAManager()->activate();
585 
586  }
587 
592  {
593  }
594 
598  virtual void setUp()
599  {
600  //ConnectorDataListeners
602  new DataListener("ON_BUFFER_WRITE"), true);
604  new DataListener("ON_BUFFER_FULL"), true);
606  new DataListener("ON_BUFFER_WRITE_TIMEOUT"), true);
608  new DataListener("ON_BUFFER_OVERWRITE"), true);
610  new DataListener("ON_BUFFER_READ"), true);
612  new DataListener("ON_SEND"), true);
614  new DataListener("ON_RECEIVED"), true);
616  new DataListener("ON_RECEIVER_FULL"), true);
618  new DataListener("ON_RECEIVER_TIMEOUT"), true);
620  new DataListener("ON_RECEIVER_ERROR"), true);
621 
622  //ConnectorListeners
624  new ConnListener("ON_BUFFER_EMPTY"), true);
626  new ConnListener("ON_BUFFER_READ_TIMEOUT"), true);
628  new ConnListener("ON_SENDER_EMPTY"), true);
630  new ConnListener("ON_SENDER_TIMEOUT"), true);
632  new ConnListener("ON_SENDER_ERROR"), true);
634  new ConnListener("ON_CONNECT"), true);
636  new ConnListener("ON_DISCONNECT"), true);
637  }
638 
642  virtual void tearDown()
643  {
644  }
645 
651  {
653  instance().addFactory("flush",
659  instance().addFactory("new",
664  RTC::ConnectorProfile prof;
665  CORBA_SeqUtil::push_back(prof.properties,
666  NVUtil::newNV("dataport.interface_type",
667  "corba_cdr"));
668  CORBA_SeqUtil::push_back(prof.properties,
669  NVUtil::newNV("dataport.dataflow_type",
670  "push"));
671  CORBA_SeqUtil::push_back(prof.properties,
672  NVUtil::newNV("dataport.subscription_type",
673  "new"));
675  {
676  coil::Properties conn_prop;
677  NVUtil::copyToProperties(conn_prop, prof.properties);
678  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
679  }
681  Logger logger;
682  consumer->setLogger(&logger);
683  RTC::ConnectorInfo profile_new(prof.name,
684  prof.connector_id,
685  CORBA_SeqUtil::refToVstring(prof.ports),
686  prop);
687  RTC::OutPortConnector* connector(0);
688  CPPUNIT_ASSERT_EQUAL(0,
689  logger.countLog("InPortCorbaCdrConsumerMock::init"));
690  CPPUNIT_ASSERT_EQUAL(0,
691  PublisherNewMock::logger.countLog("PublisherNewMock::setBuffer"));
692  CPPUNIT_ASSERT_EQUAL(0,
693  PublisherNewMock::logger.countLog("buffer OK"));
694  CPPUNIT_ASSERT_EQUAL(0,
695  PublisherNewMock::logger.countLog("PublisherNewMock::setConsumer"));
696  connector = new RTC::OutPortPushConnector(profile_new, consumer, m_listeners);
697  CPPUNIT_ASSERT_EQUAL(1,
698  logger.countLog("InPortCorbaCdrConsumerMock::init"));
699  CPPUNIT_ASSERT_EQUAL(1,
700  PublisherNewMock::logger.countLog("PublisherNewMock::setBuffer"));
701  CPPUNIT_ASSERT_EQUAL(1,
702  PublisherNewMock::logger.countLog("buffer OK"));
703  CPPUNIT_ASSERT_EQUAL(0,
704  PublisherNewMock::logger.countLog("buffer NG"));
705  CPPUNIT_ASSERT_EQUAL(1,
706  PublisherNewMock::logger.countLog("PublisherNewMock::setConsumer"));
707 
708  delete connector;
709 
710  //subscription_type
711  //Flush
712  CORBA_SeqUtil::push_back(prof.properties,
713  NVUtil::newNV("dataport.subscription_type",
714  ""));
715  {
716  coil::Properties conn_prop;
717  NVUtil::copyToProperties(conn_prop, prof.properties);
718  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
719  }
720  RTC::ConnectorInfo profile_flush(prof.name,
721  prof.connector_id,
722  CORBA_SeqUtil::refToVstring(prof.ports),
723  prop);
724  CPPUNIT_ASSERT_EQUAL(1,
725  logger.countLog("InPortCorbaCdrConsumerMock::init"));
726  CPPUNIT_ASSERT_EQUAL(0,
727  PublisherFlushMock::logger.countLog("PublisherFlushMock::setBuffer"));
728  CPPUNIT_ASSERT_EQUAL(0,
729  PublisherFlushMock::logger.countLog("buffer OK"));
730  CPPUNIT_ASSERT_EQUAL(0,
731  PublisherFlushMock::logger.countLog("PublisherFlushMock::setConsumer"));
732  connector = new RTC::OutPortPushConnector(profile_flush, consumer, m_listeners);
733  CPPUNIT_ASSERT_EQUAL(2,
734  logger.countLog("InPortCorbaCdrConsumerMock::init"));
735  CPPUNIT_ASSERT_EQUAL(1,
736  PublisherFlushMock::logger.countLog("PublisherFlushMock::setBuffer"));
737  CPPUNIT_ASSERT_EQUAL(1,
738  PublisherFlushMock::logger.countLog("buffer OK"));
739  CPPUNIT_ASSERT_EQUAL(1,
740  PublisherFlushMock::logger.countLog("PublisherFlushMock::setConsumer"));
741 
742  //consumer
743  delete connector;
744 
745 
746  //consumer
747  RTC::OutPortConnector* connector_err(0);
748  try {
749  RTC::ConnectorProfile prof_err;
750  {
751  coil::Properties conn_prop;
752  NVUtil::copyToProperties(conn_prop, prof_err.properties);
753  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
754  }
755  RTC::ConnectorInfo profile_err(prof_err.name,
756  prof_err.connector_id,
757  CORBA_SeqUtil::refToVstring(prof_err.ports),
758  prop);
759  connector_err = new RTC::OutPortPushConnector(profile_err, NULL, m_listeners);
760  CPPUNIT_FAIL("The exception was not thrown. ");
761  }
762  catch(std::bad_alloc& e)
763  {
764  }
765  catch(...)
766  {
767  CPPUNIT_FAIL("The exception not intended was thrown .");
768  }
769  delete connector_err;
770  delete consumer;
771  }
776  void test_write()
777  {
779  instance().addFactory("new",
784  RTC::ConnectorProfile prof;
785  CORBA_SeqUtil::push_back(prof.properties,
786  NVUtil::newNV("dataport.interface_type",
787  "corba_cdr"));
788  CORBA_SeqUtil::push_back(prof.properties,
789  NVUtil::newNV("dataport.dataflow_type",
790  "push"));
791  CORBA_SeqUtil::push_back(prof.properties,
792  NVUtil::newNV("dataport.subscription_type",
793  "new"));
795  {
796  coil::Properties conn_prop;
797  NVUtil::copyToProperties(conn_prop, prof.properties);
798  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
799  }
801  Logger logger;
802  consumer->setLogger(&logger);
803  RTC::ConnectorInfo profile_new(prof.name,
804  prof.connector_id,
805  CORBA_SeqUtil::refToVstring(prof.ports),
806  prop);
807  RTC::OutPortConnector* connector(0);
808  connector = new RTC::OutPortPushConnector(profile_new, consumer, m_listeners);
809  CPPUNIT_ASSERT_EQUAL(0,
810  PublisherNewMock::logger.countLog("PublisherNewMock::write"));
811  CPPUNIT_ASSERT_EQUAL(0,
812  PublisherNewMock::logger.countLog("12345"));
813  cdrMemoryStream cdr;
814  RTC::TimedLong td;
815  td.data = 12345;
816  td >>= cdr;
817 
819  ret = connector->write(cdr);
820  CPPUNIT_ASSERT_EQUAL(RTC::DataPortStatus::PORT_OK, ret);
821 
822  CPPUNIT_ASSERT_EQUAL(1,
823  PublisherNewMock::logger.countLog("PublisherNewMock::write"));
824  CPPUNIT_ASSERT_EQUAL(1,
825  PublisherNewMock::logger.countLog("12345"));
826 
827  delete connector;
828  delete consumer;
829  }
835  {
837  instance().addFactory("new",
842  RTC::ConnectorProfile prof;
843  CORBA_SeqUtil::push_back(prof.properties,
844  NVUtil::newNV("dataport.interface_type",
845  "corba_cdr"));
846  CORBA_SeqUtil::push_back(prof.properties,
847  NVUtil::newNV("dataport.dataflow_type",
848  "push"));
849  CORBA_SeqUtil::push_back(prof.properties,
850  NVUtil::newNV("dataport.subscription_type",
851  "new"));
853  {
854  coil::Properties conn_prop;
855  NVUtil::copyToProperties(conn_prop, prof.properties);
856  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
857  }
859  Logger logger;
860  consumer->setLogger(&logger);
861  RTC::ConnectorInfo profile_new(prof.name,
862  prof.connector_id,
863  CORBA_SeqUtil::refToVstring(prof.ports),
864  prop);
865  RTC::OutPortConnector* connector(0);
866  connector = new RTC::OutPortPushConnector(profile_new, consumer, m_listeners);
867  CPPUNIT_ASSERT(connector->getBuffer());
868 
870  ret = connector->disconnect();
871  CPPUNIT_ASSERT_EQUAL(RTC::DataPortStatus::PORT_OK, ret);
872 
873  CPPUNIT_ASSERT(!connector->getBuffer());
874 
875  delete connector;
876  delete consumer;
877  }
883  {
885  instance().addFactory("new",
890  RTC::ConnectorProfile prof;
891  CORBA_SeqUtil::push_back(prof.properties,
892  NVUtil::newNV("dataport.interface_type",
893  "corba_cdr"));
894  CORBA_SeqUtil::push_back(prof.properties,
895  NVUtil::newNV("dataport.dataflow_type",
896  "push"));
897  CORBA_SeqUtil::push_back(prof.properties,
898  NVUtil::newNV("dataport.subscription_type",
899  "new"));
901  {
902  coil::Properties conn_prop;
903  NVUtil::copyToProperties(conn_prop, prof.properties);
904  prop << conn_prop.getNode("dataport"); // marge ConnectorProfile
905  }
907  Logger logger;
908  consumer->setLogger(&logger);
909  RTC::ConnectorInfo profile_new(prof.name,
910  prof.connector_id,
911  CORBA_SeqUtil::refToVstring(prof.ports),
912  prop);
913  RTC::OutPortConnector* connector(0);
914  connector = new RTC::OutPortPushConnector(profile_new, consumer, m_listeners);
915  CPPUNIT_ASSERT_EQUAL(0,
916  PublisherNewMock::logger.countLog("PublisherNewMock::activate"));
917  connector->activate();
918  CPPUNIT_ASSERT_EQUAL(1,
919  PublisherNewMock::logger.countLog("PublisherNewMock::activate"));
920 
921  delete connector;
922  connector = new RTC::OutPortPushConnector(profile_new, consumer, m_listeners);
923  CPPUNIT_ASSERT_EQUAL(0,
924  PublisherNewMock::logger.countLog("PublisherNewMock::deactivate"));
925 
926  connector->deactivate();
927  CPPUNIT_ASSERT_EQUAL(1,
928  PublisherNewMock::logger.countLog("PublisherNewMock::deactivate"));
929 
930  delete connector;
931  delete consumer;
932  }
933  };
934 }; // namespace OutPortPushConnector
935 
936 /*
937  * Register test suite
938  */
940 
941 #ifdef LOCAL_MAIN
942 int main(int argc, char* argv[])
943 {
944 
945  FORMAT format = TEXT_OUT;
946  int target = 0;
947  std::string xsl;
948  std::string ns;
949  std::string fname;
950  std::ofstream ofs;
951 
952  int i(1);
953  while (i < argc)
954  {
955  std::string arg(argv[i]);
956  std::string next_arg;
957  if (i + 1 < argc) next_arg = argv[i + 1];
958  else next_arg = "";
959 
960  if (arg == "--text") { format = TEXT_OUT; break; }
961  if (arg == "--xml")
962  {
963  if (next_arg == "")
964  {
965  fname = argv[0];
966  fname += ".xml";
967  }
968  else
969  {
970  fname = next_arg;
971  }
972  format = XML_OUT;
973  ofs.open(fname.c_str());
974  }
975  if ( arg == "--compiler" ) { format = COMPILER_OUT; break; }
976  if ( arg == "--cerr" ) { target = 1; break; }
977  if ( arg == "--xsl" )
978  {
979  if (next_arg == "") xsl = "default.xsl";
980  else xsl = next_arg;
981  }
982  if ( arg == "--namespace" )
983  {
984  if (next_arg == "")
985  {
986  std::cerr << "no namespace specified" << std::endl;
987  exit(1);
988  }
989  else
990  {
991  xsl = next_arg;
992  }
993  }
994  ++i;
995  }
996  CppUnit::TextUi::TestRunner runner;
997  if ( ns.empty() )
998  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
999  else
1000  runner.addTest(CppUnit::TestFactoryRegistry::getRegistry(ns).makeTest());
1001  CppUnit::Outputter* outputter = 0;
1002  std::ostream* stream = target ? &std::cerr : &std::cout;
1003  switch ( format )
1004  {
1005  case TEXT_OUT :
1006  outputter = new CppUnit::TextOutputter(&runner.result(),*stream);
1007  break;
1008  case XML_OUT :
1009  std::cout << "XML_OUT" << std::endl;
1010  outputter = new CppUnit::XmlOutputter(&runner.result(),
1011  ofs, "shift_jis");
1012  static_cast<CppUnit::XmlOutputter*>(outputter)->setStyleSheet(xsl);
1013  break;
1014  case COMPILER_OUT :
1015  outputter = new CppUnit::CompilerOutputter(&runner.result(),*stream);
1016  break;
1017  }
1018  runner.setOutputter(outputter);
1019  runner.run();
1020  return 0; // runner.run() ? 0 : 1;
1021 }
1022 #endif // MAIN
1023 #endif // InPort_cpp
SDOPackage::NameValue newNV(const char *name, Value value)
Create NameValue.
Definition: NVUtil.h:79
ConnectorListeners class.
InPortConsumer abstract class.
int main(int argc, char **argv)
RTC::PublisherBase::ReturnCode write(const cdrMemoryStream &data, unsigned long sec, unsigned long usec)
Write data.
virtual void activate()=0
Connector activation.
CORBA Consumer class.
OutPortConnector base class.
DataPortStatus class.
RTC::PublisherBase::ReturnCode setConsumer(RTC::InPortConsumer *consumer)
Store InPort consumer.
ConnectorListener class.
RTC::PublisherBase::ReturnCode setConsumer(RTC::InPortConsumer *consumer)
Store InPort consumer.
RTC::InPortConsumer::ReturnCode put(const cdrMemoryStream &data)
Send data to the destination port.
AbstractClass * Creator()
Creator template.
void addListener(ConnectorDataListener *listener, bool autoclean)
Add the listener.
std::vector< std::pair< std::string, std::string > > NVList
Definition: IRTC.h:67
void log(const std::string &msg)
ConnectorListenerHolder connector_[CONNECTOR_LISTENER_NUM]
ConnectorListenerType listener array The ConnectorListenerType listener is stored.
virtual CdrBufferBase * getBuffer()=0
Getting Buffer.
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
void test_activate_deactivate()
activate メソッドテスト
Typename function.
void addListener(ConnectorListener *listener, bool autoclean)
Add the listener.
static GlobalFactory< AbstractClass, Identifier, Compare, Creator, Destructor > & instance()
Create instance.
Definition: Singleton.h:131
bool isActive()
If publisher is active state.
RTC::PublisherBase::ReturnCode activate()
activation
RTC::PublisherBase::ReturnCode deactivate()
deactivation
bool subscribeInterface(const SDOPackage::NVList &properties)
Subscribe the data send notification.
Connector base class.
ConnectorDataListenerHolder connectorData_[CONNECTOR_DATA_LISTENER_NUM]
ConnectorDataListenerType listener array The ConnectorDataListenerType listener is stored...
virtual ReturnCode write(const cdrMemoryStream &data)=0
Destructor.
void init(coil::Properties &prop)
Initializing configuration.
void copyToProperties(coil::Properties &prop, const SDOPackage::NVList &nv)
Copy NVList to the Proeprties.
Definition: NVUtil.cpp:137
ConnectorDataListenerT class.
RTC::PublisherBase::ReturnCode init(coil::Properties &prop)
Initializing configuration.
Push type connector class.
virtual void operator()(const RTC::ConnectorInfo &info)
Virtual Callback method.
NameValue and NVList utility functions.
CORBA sequence utility template functions.
virtual ReturnCode disconnect()=0
Disconnect connection.
std::string name
Connection name.
void log(const std::string &msg)
RTC::PublisherBase::ReturnCode activate()
activation
void test_disconnect_getBuffer()
disconnect メソッドテスト
CPPUNIT_TEST_SUITE_REGISTRATION(OutPortPushConnector::OutPortPushConnectorTests)
::RTC::BufferStatus::Enum ReturnCode
RTC::PublisherBase::ReturnCode write(const cdrMemoryStream &data, unsigned long sec, unsigned long usec)
Write data.
prop
Organization::get_organization_property ();.
Publisher base class.
RTC::Port implementation for InPort.
InPortBase base class.
void Destructor(AbstractClass *&obj)
Destructor template.
RTC::PublisherBase::ReturnCode setListener(RTC::ConnectorInfo &info, RTC::ConnectorListeners *listeners)
Set the listener.
Class represents a set of properties.
Definition: Properties.h:101
OutPortPushConnector class.
virtual void operator()(const RTC::ConnectorInfo &info, const RTC::TimedLong &data)
Virtual Callback method.
void test_OutPortPushConnector()
Constructor メソッドテスト
RTC::PublisherBase::ReturnCode init(coil::Properties &prop)
Initializing configuration.
void publishInterfaceProfile(SDOPackage::NVList &properties)
Publish InterfaceProfile information.
Base class of Publisher.
Definition: PublisherBase.h:63
bool isActive()
If publisher is active state.
RTC::PublisherBase::ReturnCode setListener(RTC::ConnectorInfo &info, RTC::ConnectorListeners *listeners)
Set the listener.
::OutPortBase::Logger logger
void push_back(CorbaSequence &seq, SequenceElement elem)
Push the new element back to the CORBA sequence.
RTC::PublisherBase::ReturnCode deactivate()
deactivation
Properties & getNode(const std::string &key)
Get node of properties.
Definition: Properties.cpp:460
def test_activate_deactivate(message, arg0, arg1, arg2)
Only activation and deactivation are repeated.
int countLog(const std::string &msg)
coil::vstring refToVstring(const CorbaRefSequence &objlist)
BufferBase abstract class.
Definition: BufferBase.h:104
InPortConsumer class.
RTC&#39;s Port administration class.
void unsubscribeInterface(const SDOPackage::NVList &properties)
Unsubscribe the data send notification.
virtual void deactivate()=0
Connector deactivation.
PublisherBase::ReturnCode setBuffer(RTC::CdrBufferBase *buffer)
Setting buffer pointer.
RTC::PublisherBase::ReturnCode setBuffer(RTC::CdrBufferBase *buffer)
Setting buffer pointer.


openrtm_aist
Author(s): Noriaki Ando
autogenerated on Mon Feb 28 2022 23:00:44