Discovery.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_DDS_DCPS_DISCOVERY_H
00009 #define OPENDDS_DDS_DCPS_DISCOVERY_H
00010 
00011 #include "dds/DdsDcpsInfoUtilsC.h"
00012 #include "RcObject.h"
00013 #include "RcHandle_T.h"
00014 #include "unique_ptr.h"
00015 
00016 #include "dds/DCPS/DataReaderCallbacks.h"
00017 #include "dds/DCPS/DataWriterCallbacks.h"
00018 #include "dds/DdsDcpsSubscriptionC.h"
00019 
00020 #include "dds/DCPS/PoolAllocator.h"
00021 #include "dds/DCPS/PoolAllocationBase.h"
00022 #include "dds/DdsSecurityCoreC.h"
00023 
00024 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00025 #pragma once
00026 #endif /* ACE_LACKS_PRAGMA_ONCE */
00027 
00028 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00029 class ACE_Configuration_Heap;
00030 ACE_END_VERSIONED_NAMESPACE_DECL
00031 
00032 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00033 
00034 namespace OpenDDS {
00035 namespace DCPS {
00036 
00037 class DomainParticipantImpl;
00038 class DataWriterImpl;
00039 class DataReaderImpl;
00040 
00041 /**
00042  * @class Discovery
00043  *
00044  * @brief Discovery Strategy interface class
00045  *
00046  * This class is an abstract class that acts as an interface for both
00047  * InfoRepo-based discovery and RTPS Discovery.
00048  *
00049  */
00050 class OpenDDS_Dcps_Export Discovery : public RcObject {
00051 public:
00052   /// Key type for storing discovery objects.
00053   /// Probably should just be Discovery::Key
00054   typedef OPENDDS_STRING RepoKey;
00055 
00056   explicit Discovery(const RepoKey& key) : key_(key) { }
00057 
00058   /// Key value for the default repository IOR.
00059   static const char* DEFAULT_REPO;
00060   static const char* DEFAULT_RTPS;
00061   static const char* DEFAULT_STATIC;
00062 
00063   // TODO: NEED TO REMOVE THIS once Service_Participant::repository_lost has been refactored
00064   virtual bool active() { return true; }
00065 
00066   virtual DDS::Subscriber_ptr init_bit(DomainParticipantImpl* participant) = 0;
00067 
00068   virtual void fini_bit(DCPS::DomainParticipantImpl* participant) = 0;
00069 
00070   virtual RepoId bit_key_to_repo_id(DomainParticipantImpl* participant,
00071                                     const char* bit_topic_name,
00072                                     const DDS::BuiltinTopicKey_t& key) const = 0;
00073 
00074   RepoKey key() const { return this->key_; }
00075 
00076   class OpenDDS_Dcps_Export Config
00077     : public PoolAllocationBase
00078     , public EnableContainerSupportedUniquePtr<Config> {
00079   public:
00080     virtual ~Config();
00081     virtual int discovery_config(ACE_Configuration_Heap& cf) = 0;
00082   };
00083 
00084   virtual bool attach_participant(
00085     DDS::DomainId_t domainId,
00086     const RepoId& participantId) = 0;
00087 
00088   virtual OpenDDS::DCPS::RepoId generate_participant_guid() = 0;
00089 
00090   virtual AddDomainStatus add_domain_participant(
00091     DDS::DomainId_t domain,
00092     const DDS::DomainParticipantQos& qos) = 0;
00093 
00094 #if defined(OPENDDS_SECURITY)
00095   virtual OpenDDS::DCPS::AddDomainStatus add_domain_participant_secure(
00096     DDS::DomainId_t domain,
00097     const DDS::DomainParticipantQos& qos,
00098     const OpenDDS::DCPS::RepoId& guid,
00099     DDS::Security::IdentityHandle id,
00100     DDS::Security::PermissionsHandle perm,
00101     DDS::Security::ParticipantCryptoHandle part_crypto) = 0;
00102 #endif
00103 
00104   virtual bool remove_domain_participant(
00105     DDS::DomainId_t domainId,
00106     const RepoId& participantId) = 0;
00107 
00108   virtual bool ignore_domain_participant(
00109     DDS::DomainId_t domainId,
00110     const RepoId& myParticipantId,
00111     const RepoId& ignoreId) = 0;
00112 
00113   virtual bool update_domain_participant_qos(
00114     DDS::DomainId_t domain,
00115     const RepoId& participantId,
00116     const DDS::DomainParticipantQos& qos) = 0;
00117 
00118 
00119   // Topic operations:
00120 
00121   virtual TopicStatus assert_topic(
00122     RepoId_out topicId,
00123     DDS::DomainId_t domainId,
00124     const RepoId& participantId,
00125     const char* topicName,
00126     const char* dataTypeName,
00127     const DDS::TopicQos& qos,
00128     bool hasDcpsKey) = 0;
00129 
00130   virtual TopicStatus find_topic(
00131     DDS::DomainId_t domainId,
00132     const char* topicName,
00133     CORBA::String_out dataTypeName,
00134     DDS::TopicQos_out qos,
00135     RepoId_out topicId) = 0;
00136 
00137   virtual TopicStatus remove_topic(
00138     DDS::DomainId_t domainId,
00139     const RepoId& participantId,
00140     const RepoId& topicId) = 0;
00141 
00142   virtual bool ignore_topic(
00143     DDS::DomainId_t domainId,
00144     const RepoId& myParticipantId,
00145     const RepoId& ignoreId) = 0;
00146 
00147   virtual bool update_topic_qos(
00148     const RepoId& topicId,
00149     DDS::DomainId_t domainId,
00150     const RepoId& participantId,
00151     const DDS::TopicQos& qos) = 0;
00152 
00153 
00154   // Publication operations:
00155 
00156   virtual void pre_writer(DataWriterImpl*) {}
00157 
00158   /// add the passed in publication into discovery.
00159   /// Discovery does not participate in memory management
00160   /// for the publication pointer, so it requires that
00161   /// the publication pointer remain valid until
00162   /// remove_publication is called.
00163   virtual RepoId add_publication(
00164     DDS::DomainId_t domainId,
00165     const RepoId& participantId,
00166     const RepoId& topicId,
00167     DataWriterCallbacks* publication,
00168     const DDS::DataWriterQos& qos,
00169     const TransportLocatorSeq& transInfo,
00170     const DDS::PublisherQos& publisherQos) = 0;
00171 
00172   virtual bool remove_publication(
00173     DDS::DomainId_t domainId,
00174     const RepoId& participantId,
00175     const RepoId& publicationId) = 0;
00176 
00177   virtual bool ignore_publication(
00178     DDS::DomainId_t domainId,
00179     const RepoId& myParticipantId,
00180     const RepoId& ignoreId) = 0;
00181 
00182   virtual bool update_publication_qos(
00183     DDS::DomainId_t domainId,
00184     const RepoId& partId,
00185     const RepoId& dwId,
00186     const DDS::DataWriterQos& qos,
00187     const DDS::PublisherQos& publisherQos) = 0;
00188 
00189 
00190   // Subscription operations:
00191 
00192   virtual void pre_reader(DataReaderImpl*) {}
00193 
00194   /// add the passed in subscription into discovery.
00195   /// Discovery does not participate in memory management
00196   /// for the subscription pointer, so it requires that
00197   /// the subscription pointer remain valid until
00198   /// remove_subscription is called.
00199   virtual RepoId add_subscription(
00200     DDS::DomainId_t domainId,
00201     const RepoId& participantId,
00202     const RepoId& topicId,
00203     DataReaderCallbacks* subscription,
00204     const DDS::DataReaderQos& qos,
00205     const TransportLocatorSeq& transInfo,
00206     const DDS::SubscriberQos& subscriberQos,
00207     const char* filterClassName,
00208     const char* filterExpression,
00209     const DDS::StringSeq& exprParams) = 0;
00210 
00211   virtual bool remove_subscription(
00212     DDS::DomainId_t domainId,
00213     const RepoId& participantId,
00214     const RepoId& subscriptionId) = 0;
00215 
00216   virtual bool ignore_subscription(
00217     DDS::DomainId_t domainId,
00218     const RepoId& myParticipantId,
00219     const RepoId& ignoreId) = 0;
00220 
00221   virtual bool update_subscription_qos(
00222     DDS::DomainId_t domainId,
00223     const RepoId& partId,
00224     const RepoId& drId,
00225     const DDS::DataReaderQos& qos,
00226     const DDS::SubscriberQos& subscriberQos) = 0;
00227 
00228   virtual bool update_subscription_params(
00229     DDS::DomainId_t domainId,
00230     const RepoId& participantId,
00231     const RepoId& subscriptionId,
00232     const DDS::StringSeq& params) = 0;
00233 
00234 
00235   // Managing reader/writer associations:
00236 
00237   virtual void association_complete(
00238     DDS::DomainId_t domainId,
00239     const RepoId& participantId,
00240     const RepoId& localId,
00241     const RepoId& remoteId) = 0;
00242 
00243   virtual bool supports_liveliness() const { return false; }
00244 
00245   virtual void signal_liveliness(const DDS::DomainId_t /*domain_id*/,
00246                                  const RepoId& /*part_id*/,
00247                                  DDS::LivelinessQosPolicyKind /*kind*/) { }
00248 
00249 protected:
00250   DDS::ReturnCode_t create_bit_topics(DomainParticipantImpl* participant);
00251 
00252 private:
00253   RepoKey        key_;
00254 
00255 };
00256 
00257 typedef RcHandle<Discovery> Discovery_rch;
00258 
00259 } // namespace DCPS
00260 } // namespace OpenDDS
00261 
00262 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00263 
00264 #endif /* OPENDDS_DCPS_DISCOVERY_H  */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 10 Aug 2018 for OpenDDS by  doxygen 1.6.1