TopicImpl.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Distributed under the OpenDDS License.
00005  * See: http://www.opendds.org/license.html
00006  */
00007 
00008 #ifndef OPENDDS_DCPS_TOPIC_IMPL_H
00009 #define OPENDDS_DCPS_TOPIC_IMPL_H
00010 
00011 #include "dds/DdsDcpsTopicC.h"
00012 #include "dds/DdsDcpsInfoUtilsC.h"
00013 #include "EntityImpl.h"
00014 #include "TopicDescriptionImpl.h"
00015 
00016 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00017 #pragma once
00018 #endif /* ACE_LACKS_PRAGMA_ONCE */
00019 
00020 namespace OpenDDS {
00021 namespace DCPS {
00022 
00023 class TopicDescriptionImpl;
00024 class Monitor;
00025 
00026 /**
00027 * @class TopicImpl
00028 *
00029 * @brief Implements the DDS::Topic interface.
00030 *
00031 * See the DDS specification, OMG formal/04-12-02, for a description of
00032 * the interface this class is implementing.
00033 */
00034 class OpenDDS_Dcps_Export TopicImpl
00035   : public virtual LocalObject<DDS::Topic>,
00036     public virtual EntityImpl,
00037     public virtual TopicDescriptionImpl {
00038 public:
00039 
00040   TopicImpl(const RepoId                   topic_id,
00041             const char*                    topic_name,
00042             const char*                    type_name,
00043             OpenDDS::DCPS::TypeSupport_ptr type_support,
00044             const DDS::TopicQos &          qos,
00045             DDS::TopicListener_ptr         a_listener,
00046             const DDS::StatusMask &        mask,
00047             DomainParticipantImpl*         participant);
00048 
00049   virtual ~TopicImpl();
00050 
00051   virtual DDS::InstanceHandle_t get_instance_handle();
00052 
00053   virtual DDS::ReturnCode_t set_qos(const DDS::TopicQos& qos);
00054 
00055   virtual DDS::ReturnCode_t get_qos(DDS::TopicQos& qos);
00056 
00057   virtual DDS::ReturnCode_t set_listener(DDS::TopicListener_ptr a_listener,
00058                                          DDS::StatusMask mask);
00059 
00060   virtual DDS::TopicListener_ptr get_listener();
00061 
00062   virtual DDS::ReturnCode_t get_inconsistent_topic_status(
00063     DDS::InconsistentTopicStatus& a_status);
00064 
00065   virtual DDS::ReturnCode_t enable();
00066 
00067   /** This method is not defined in the IDL and is defined for
00068   *  internal use.
00069   *  Return the id given by discovery.
00070   */
00071   RepoId get_id() const;
00072 
00073   CORBA::Long entity_refs() const {
00074     return entity_refs_;
00075   }
00076 
00077   void add_entity_ref() {
00078     entity_refs_++;
00079   }
00080 
00081   void remove_entity_ref() {
00082     entity_refs_--;
00083   }
00084 
00085   const char* type_name() const;
00086 
00087   virtual void transport_config(const TransportConfig_rch& cfg);
00088 
00089   void inconsistent_topic();
00090 
00091 private:
00092   /// The topic qos
00093   DDS::TopicQos                qos_;
00094 
00095   /// The mask for which kind of events the listener
00096   ///  will be notified about.
00097   DDS::StatusMask              listener_mask_;
00098   /// The topic listener
00099   DDS::TopicListener_var       listener_;
00100 
00101   /// The id given by discovery.
00102   RepoId                       id_;
00103 
00104   /// The number of DataReaders and DataWriters using this Topic.
00105   CORBA::Long                  entity_refs_;
00106 
00107   /// count of discovered (readers/writers using) topics with the same
00108   ///  topic name but different characteristics (typename)
00109   DDS::InconsistentTopicStatus inconsistent_topic_status_;
00110 
00111   /// Pointer to the monitor object for this entity
00112   Monitor* monitor_;
00113 };
00114 
00115 } // namespace DCPS
00116 } // namespace OpenDDS
00117 
00118 #endif /* OPENDDS_DCPS_TOPIC_IMPL_H  */

Generated on Fri Feb 12 20:05:28 2016 for OpenDDS by  doxygen 1.4.7