#include "modulecomm_impl.h" #include #include #include #include #include namespace iv { namespace modulecomm { QMutex gmodulecomm_dds_Mutex; int createcount = 0; } } void modulecomm_impl::callbackTopic(const TopicSample::Message& message) { // static int counter = 0; // std::cout << "Message: counter = " << message.counter << std::endl // << " message = " << message.msgname.in() << std::endl; // std::cout<<"xlen is "< topicFunction = std::bind(&modulecomm_impl::callbackTopic,this,std::placeholders::_1); mpSub->setReceivedTopicFunction(topicFunction); return 0; } int modulecomm_impl::listenmsg(SMCallBack pCall) { if(mnType == type_send) { std::cout<<"send not listen."< topicFunction = std::bind(&modulecomm_impl::callbackTopic,this,std::placeholders::_1); mpSub->setReceivedTopicFunction(topicFunction); return 0; } void modulecomm_impl::writemsg(const char *str, int nlen) { if(mnType == type_recv) { std::cout<<"recv not send."<sendMessage(mstrtopic,str,nlen); }