00001
00002
00003
00004
00005
00006
00007
00008 #ifndef OPENDDS_DCPS_TOPIC_DESCRIPTION_IMPL_H
00009 #define OPENDDS_DCPS_TOPIC_DESCRIPTION_IMPL_H
00010
00011 #include "dds/DdsDcpsTopicC.h"
00012 #include "dds/DdsDcpsTypeSupportExtC.h"
00013 #include "Definitions.h"
00014 #include "ace/SString.h"
00015 #include "ace/Atomic_Op.h"
00016 #include "LocalObject.h"
00017
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif
00021
00022 namespace OpenDDS {
00023 namespace DCPS {
00024
00025 class DomainParticipantImpl;
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 class OpenDDS_Dcps_Export TopicDescriptionImpl
00037 : public virtual OpenDDS::DCPS::LocalObject<DDS::TopicDescription> {
00038 public:
00039
00040
00041 TopicDescriptionImpl(const char* topic_name,
00042 const char* type_name,
00043 TypeSupport_ptr type_support,
00044 DomainParticipantImpl* participant);
00045
00046
00047 virtual ~TopicDescriptionImpl();
00048
00049 virtual char * get_type_name();
00050
00051 virtual char * get_name();
00052
00053 virtual DDS::DomainParticipant_ptr get_participant();
00054
00055
00056
00057
00058
00059 OpenDDS::DCPS::TypeSupport_ptr get_type_support();
00060
00061 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC)
00062
00063 bool has_reader() const {
00064 return reader_count_ > 0;
00065 }
00066
00067 void update_reader_count(bool increment) {
00068 if (increment) ++reader_count_;
00069 else --reader_count_;
00070 }
00071
00072 #endif
00073
00074 protected:
00075
00076 ACE_CString topic_name_;
00077
00078 ACE_CString type_name_;
00079
00080
00081 DomainParticipantImpl* participant_;
00082
00083
00084 OpenDDS::DCPS::TypeSupport_ptr type_support_;
00085
00086 #if !defined(OPENDDS_NO_CONTENT_FILTERED_TOPIC) || !defined(OPENDDS_NO_MULTI_TOPIC)
00087 ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long> reader_count_;
00088 #endif
00089 };
00090
00091 }
00092 }
00093
00094 #endif