00001 #ifndef _DDS_HELPER_H_ 00002 #define _DDS_HELPER_H_ 00003 00004 #include <iostream> 00005 #include <string.h> 00006 #include <loggingACEMACROS.h> 00007 #include <dds/DCPS/Service_Participant.h> 00008 #include <dds/DCPS/Marked_Default_Qos.h> 00009 00010 const unsigned int DOMAIN_ID=411; 00011 00012 namespace ddsnc{ 00013 00024 class DDSHelper{ 00025 private: 00026 void setTopicName(const char* topicName); 00027 void init(const char* channelName, const char* DCPSInfoRepoLoc); 00028 /*int argc; 00029 const ACE_TCHAR* argv[];*/ 00030 00031 protected: 00032 DDS::DomainParticipantFactory_ptr dpf; 00033 DDS::DomainParticipant_var participant; 00034 DDS::Topic_var topic; 00035 char* partitionName; 00036 char* topicName; 00037 bool initialized; 00048 DDSHelper(CORBA::String_var channelName); 00049 00059 DDSHelper(const char* channelName, const char* DCPSInfoRepoLoc); 00060 00068 virtual ~DDSHelper(); 00069 int createParticipant(); 00070 00081 void initializeTopic(const char* topicName, CORBA::String_var typeName); 00082 00083 void initializeTopic(CORBA::String_var typeName); 00084 00085 void setPartitionName(const char* partitionName); 00086 00087 public: 00098 void disconnect(); 00099 DDS::TopicQos topicQos; 00100 00101 static void cleanUp(); 00102 CORBA::String_var getChannelName(); 00103 00104 }; 00105 } 00106 00107 #endif