OpenDDS::DCPS::TopicDescriptionImpl Class Reference

Implements the DDS::TopicDescription interface. More...

#include <TopicDescriptionImpl.h>

Inheritance diagram for OpenDDS::DCPS::TopicDescriptionImpl:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::TopicDescriptionImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TopicDescriptionImpl (const char *topic_name, const char *type_name, TypeSupport_ptr type_support, DomainParticipantImpl *participant)
virtual ~TopicDescriptionImpl ()
virtual char * get_type_name ()
virtual char * get_name ()
virtual DDS::DomainParticipant_ptr get_participant ()
OpenDDS::DCPS::TypeSupport_ptr get_type_support ()
bool has_reader () const
void update_reader_count (bool increment)

Protected Attributes

ACE_CString topic_name_
 The name of the topic.
ACE_CString type_name_
 The datatype of the topic.
DomainParticipantImplparticipant_
 The participant that creates this topic.
OpenDDS::DCPS::TypeSupport_ptr type_support_
 The type_support for this topic.
ACE_Atomic_Op< ACE_Thread_Mutex,
unsigned long > 
reader_count_

Detailed Description

Implements the DDS::TopicDescription interface.

See the DDS specification, OMG formal/04-12-02, for a description of the interface this class is implementing.

Definition at line 36 of file TopicDescriptionImpl.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::TopicDescriptionImpl::TopicDescriptionImpl ( const char *  topic_name,
const char *  type_name,
TypeSupport_ptr  type_support,
DomainParticipantImpl participant 
)

Definition at line 18 of file TopicDescriptionImpl.cpp.

References type_support_.

00022   : topic_name_(topic_name),
00023     type_name_(type_name),
00024     participant_(participant),
00025     type_support_(type_support)
00026 {
00027   // make sure the type_support doesn't get deleted while
00028   // were still using it.
00029   if (type_support_)
00030     type_support_->_add_ref();
00031 }

OpenDDS::DCPS::TopicDescriptionImpl::~TopicDescriptionImpl (  )  [virtual]

Definition at line 34 of file TopicDescriptionImpl.cpp.

References type_support_.

00035 {
00036   // were finished with the type_support
00037   if (type_support_)
00038     type_support_->_remove_ref();
00039 }


Member Function Documentation

char * OpenDDS::DCPS::TopicDescriptionImpl::get_name (  )  [virtual]

Implements DDS::TopicDescription.

Definition at line 48 of file TopicDescriptionImpl.cpp.

References CORBA::string_dup(), and topic_name_.

Referenced by OpenDDS::DCPS::PublisherImpl::create_datawriter(), OpenDDS::DCPS::DomainParticipantImpl::delete_topic_i(), OpenDDS::DCPS::RecorderImpl::enable(), OpenDDS::DCPS::DataReaderImpl::enable(), OpenDDS::DCPS::DataReaderImpl::get_topic_name(), OpenDDS::DCPS::ReplayerImpl::init(), OpenDDS::DCPS::DataWriterImpl::init(), and OpenDDS::DCPS::TopicMonitorImpl::report().

00049 {
00050   return CORBA::string_dup(topic_name_.c_str());
00051 }

DDS::DomainParticipant_ptr OpenDDS::DCPS::TopicDescriptionImpl::get_participant (  )  [virtual]

Implements DDS::TopicDescription.

Definition at line 54 of file TopicDescriptionImpl.cpp.

References participant_.

Referenced by OpenDDS::DCPS::DomainParticipantImpl::delete_topic_i(), and OpenDDS::DCPS::TopicMonitorImpl::report().

00055 {
00056   return DDS::DomainParticipant::_duplicate(participant_);
00057 }

char * OpenDDS::DCPS::TopicDescriptionImpl::get_type_name (  )  [virtual]

Implements DDS::TopicDescription.

Definition at line 42 of file TopicDescriptionImpl.cpp.

References CORBA::string_dup(), and type_name_.

Referenced by OpenDDS::DCPS::ReplayerImpl::init(), OpenDDS::DCPS::DataWriterImpl::init(), and OpenDDS::DCPS::TopicMonitorImpl::report().

00043 {
00044   return CORBA::string_dup(type_name_.c_str());
00045 }

OpenDDS::DCPS::TypeSupport_ptr OpenDDS::DCPS::TopicDescriptionImpl::get_type_support (  ) 

This method is not defined in the IDL and is defined for internal use. Return the type support of the topic.

Definition at line 60 of file TopicDescriptionImpl.cpp.

References type_support_.

Referenced by OpenDDS::DCPS::SubscriberImpl::create_datareader(), OpenDDS::DCPS::PublisherImpl::create_datawriter(), OpenDDS::DCPS::DataWriterImpl::filter_out(), OpenDDS::DCPS::MultiTopicDataReaderBase::init(), and OpenDDS::DCPS::MultiTopicDataReaderBase::metaStructFor().

00061 {
00062   return type_support_;
00063 }

bool OpenDDS::DCPS::TopicDescriptionImpl::has_reader (  )  const [inline]

Definition at line 63 of file TopicDescriptionImpl.h.

00063                           {
00064     return reader_count_ > 0;
00065   }

void OpenDDS::DCPS::TopicDescriptionImpl::update_reader_count ( bool  increment  )  [inline]

Definition at line 67 of file TopicDescriptionImpl.h.

Referenced by OpenDDS::DCPS::DataReaderImpl::cleanup(), and OpenDDS::DCPS::DataReaderImpl::enable_filtering().

00067                                            {
00068     if (increment) ++reader_count_;
00069     else --reader_count_;
00070   }


Member Data Documentation

DomainParticipantImpl* OpenDDS::DCPS::TopicDescriptionImpl::participant_ [protected]

The participant that creates this topic.

Definition at line 81 of file TopicDescriptionImpl.h.

Referenced by OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::TopicImpl::get_instance_handle(), get_participant(), OpenDDS::DCPS::TopicImpl::inconsistent_topic(), and OpenDDS::DCPS::TopicImpl::set_qos().

ACE_Atomic_Op<ACE_Thread_Mutex, unsigned long> OpenDDS::DCPS::TopicDescriptionImpl::reader_count_ [protected]

Definition at line 87 of file TopicDescriptionImpl.h.

ACE_CString OpenDDS::DCPS::TopicDescriptionImpl::topic_name_ [protected]

The name of the topic.

Definition at line 76 of file TopicDescriptionImpl.h.

Referenced by get_name().

ACE_CString OpenDDS::DCPS::TopicDescriptionImpl::type_name_ [protected]

The datatype of the topic.

Definition at line 78 of file TopicDescriptionImpl.h.

Referenced by get_type_name(), and OpenDDS::DCPS::TopicImpl::type_name().

OpenDDS::DCPS::TypeSupport_ptr OpenDDS::DCPS::TopicDescriptionImpl::type_support_ [protected]

The type_support for this topic.

Definition at line 84 of file TopicDescriptionImpl.h.

Referenced by get_type_support(), TopicDescriptionImpl(), and ~TopicDescriptionImpl().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:25 2016 for OpenDDS by  doxygen 1.4.7