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 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00021 
00022 namespace OpenDDS {
00023 namespace DCPS {
00024 
00025 class TopicDescriptionImpl;
00026 class Monitor;
00027 
00028 /**
00029 * @class TopicImpl
00030 *
00031 * @brief Implements the DDS::Topic interface.
00032 *
00033 * See the DDS specification, OMG formal/04-12-02, for a description of
00034 * the interface this class is implementing.
00035 */
00036 class OpenDDS_Dcps_Export TopicImpl
00037   : public virtual LocalObject<DDS::Topic>,
00038     public virtual EntityImpl,
00039     public virtual TopicDescriptionImpl {
00040 public:
00041 
00042   TopicImpl(const RepoId                   topic_id,
00043             const char*                    topic_name,
00044             const char*                    type_name,
00045             OpenDDS::DCPS::TypeSupport_ptr type_support,
00046             const DDS::TopicQos &          qos,
00047             DDS::TopicListener_ptr         a_listener,
00048             const DDS::StatusMask &        mask,
00049             DomainParticipantImpl*         participant);
00050 
00051   virtual ~TopicImpl();
00052 
00053   virtual DDS::InstanceHandle_t get_instance_handle();
00054 
00055   virtual DDS::ReturnCode_t set_qos(const DDS::TopicQos& qos);
00056 
00057   virtual DDS::ReturnCode_t get_qos(DDS::TopicQos& qos);
00058 
00059   virtual DDS::ReturnCode_t set_listener(DDS::TopicListener_ptr a_listener,
00060                                          DDS::StatusMask mask);
00061 
00062   virtual DDS::TopicListener_ptr get_listener();
00063 
00064   virtual DDS::ReturnCode_t get_inconsistent_topic_status(
00065     DDS::InconsistentTopicStatus& a_status);
00066 
00067   virtual DDS::ReturnCode_t enable();
00068 
00069   /** This method is not defined in the IDL and is defined for
00070   *  internal use.
00071   *  Return the id given by discovery.
00072   */
00073   RepoId get_id() const;
00074 
00075   // OpenDDS extension which doesn't duplicate the string to prevent
00076   // the runtime costs of making a copy
00077   const char* type_name() const;
00078 
00079   virtual void transport_config(const TransportConfig_rch& cfg);
00080 
00081   void inconsistent_topic();
00082 
00083 private:
00084   /// The topic qos
00085   DDS::TopicQos                qos_;
00086 
00087   /// The mask for which kind of events the listener
00088   ///  will be notified about.
00089   DDS::StatusMask              listener_mask_;
00090   /// The topic listener
00091   DDS::TopicListener_var       listener_;
00092 
00093   /// The id given by discovery.
00094   RepoId                       id_;
00095 
00096   /// Count of discovered (readers/writers using) topics with the same
00097   /// topic name but different characteristics (typename)
00098   DDS::InconsistentTopicStatus inconsistent_topic_status_;
00099 
00100   /// Pointer to the monitor object for this entity
00101   Monitor* monitor_;
00102 };
00103 
00104 
00105 
00106 } // namespace DCPS
00107 } // namespace OpenDDS
00108 
00109 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00110 
00111 #endif /* OPENDDS_DCPS_TOPIC_IMPL_H  */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1