DomainParticipantFactoryImpl.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_DOMAIN_PARTICIPANT_FACTORY_IMPL_H
00009 #define OPENDDS_DCPS_DOMAIN_PARTICIPANT_FACTORY_IMPL_H
00010 
00011 #include "Definitions.h"
00012 #include "dds/DdsDcpsDomainC.h"
00013 #include "ace/Null_Mutex.h"
00014 #include "ace/Recursive_Thread_Mutex.h"
00015 #include "dds/DCPS/LocalObject.h"
00016 #include "dds/DCPS/PoolAllocator.h"
00017 
00018 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00019 #pragma once
00020 #endif /* ACE_LACKS_PRAGMA_ONCE */
00021 
00022 namespace OpenDDS {
00023 namespace DCPS {
00024 
00025 class DomainParticipantImpl;
00026 
00027 /**
00028 * @class DomainParticipantFactoryImpl
00029 *
00030 * @brief Implements the OpenDDS::DCPS::DomainParticipantFactory
00031 *        interfaces.
00032 *
00033 * This class acts as factory of the DomainParticipant.
00034 *
00035 * See the DDS specification, OMG formal/04-12-02, for a description of
00036 * the interface this class is implementing.
00037 *
00038 */
00039 class OpenDDS_Dcps_Export DomainParticipantFactoryImpl
00040   : public virtual OpenDDS::DCPS::LocalObject<DDS::DomainParticipantFactory> {
00041 public:
00042 
00043   typedef Objref_Servant_Pair <DomainParticipantImpl, DDS::DomainParticipant,
00044     DDS::DomainParticipant_ptr, DDS::DomainParticipant_var> Participant_Pair;
00045   typedef OPENDDS_SET(Participant_Pair) DPSet;
00046   typedef OPENDDS_MAP(DDS::DomainId_t, DPSet) DPMap;
00047 
00048   /** Constructor **/
00049   DomainParticipantFactoryImpl();
00050 
00051   /** Destructor **/
00052   virtual ~DomainParticipantFactoryImpl();
00053 
00054   virtual DDS::DomainParticipant_ptr create_participant(
00055     DDS::DomainId_t domainId,
00056     const DDS::DomainParticipantQos & qos,
00057     DDS::DomainParticipantListener_ptr a_listener,
00058     DDS::StatusMask mask);
00059 
00060   virtual DDS::ReturnCode_t delete_participant(
00061     DDS::DomainParticipant_ptr a_participant);
00062 
00063   virtual DDS::DomainParticipant_ptr lookup_participant(
00064     DDS::DomainId_t domainId);
00065 
00066   virtual DDS::ReturnCode_t set_default_participant_qos(
00067     const DDS::DomainParticipantQos & qos);
00068 
00069   virtual DDS::ReturnCode_t get_default_participant_qos(
00070     DDS::DomainParticipantQos & qos);
00071 
00072   virtual DDS::DomainParticipantFactory_ptr get_instance();
00073 
00074   virtual DDS::ReturnCode_t set_qos(
00075     const DDS::DomainParticipantFactoryQos & qos);
00076 
00077   virtual DDS::ReturnCode_t get_qos(
00078     DDS::DomainParticipantFactoryQos & qos);
00079 
00080   /// Expose the participants for reading.
00081   const DPMap& participants() const;
00082 
00083 private:
00084 
00085   DDS::DomainParticipantFactoryQos qos_;
00086 
00087   /// The default qos value of DomainParticipant.
00088   DDS::DomainParticipantQos   default_participant_qos_;
00089 
00090   /// The collection of domain participants.
00091   DPMap                       participants_;
00092 
00093   /// Protect the participant collection.
00094   /// Use recursive mutex to allow nested acquisition and
00095   /// release of a mutex that occurs in the same thread.
00096   ACE_Recursive_Thread_Mutex  participants_protector_;
00097 };
00098 
00099 } // namespace DCPS
00100 } // namespace OpenDDS
00101 
00102 #endif /* OPENDDS_DCPS_DOMAIN_PARTICIPANT_FACTORY_IMPL_H  */

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