OpenDDS  Snapshot(2023/04/28-20:55)
EntityImpl.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 
6 #ifndef OPENDDS_DCPS_ENTITY_IMPL_H
7 #define OPENDDS_DCPS_ENTITY_IMPL_H
8 
9 #include "Observer.h"
10 #include "LocalObject.h"
11 #include "Definitions.h"
12 #include "AtomicBool.h"
14 
15 #include <dds/DdsDcpsInfrastructureC.h>
16 
17 #ifndef ACE_LACKS_PRAGMA_ONCE
18 # pragma once
19 #endif
20 
22 
23 namespace OpenDDS {
24 namespace DCPS {
25 
26 class DomainParticipantImpl;
27 
28 /**
29 * @class EntityImpl
30 *
31 * @brief Implements the OpenDDS::DCPS::Entity
32 * interfaces.
33 *
34 * This class is the base class of other servant classes.
35 * e.g. DomainParticipantImpl, PublisherImpl ...
36 */
38  : public virtual LocalObject<DDS::Entity> {
39 public:
40  EntityImpl();
41 
42  virtual ~EntityImpl();
43 
44  bool is_enabled() const;
45 
46  virtual DDS::StatusCondition_ptr get_statuscondition();
47 
48  virtual DDS::StatusMask get_status_changes();
49 
50  virtual DDS::InstanceHandle_t get_instance_handle() = 0;
51 
53 
54  virtual GUID_t get_id() const { return GUID_UNKNOWN; }
55 
56  void set_status_changed_flag(DDS::StatusKind status,
57  bool status_changed_flag);
58 
59  /// Call this *after* dispatching to listeners when the "changed status
60  /// flag" is enabled so that any waiting waitsets can be unblocked.
61  void notify_status_condition();
62 
63  virtual void transport_config(const TransportConfig_rch& cfg);
64  TransportConfig_rch transport_config() const;
65 
66  virtual RcHandle<EntityImpl> parent() const { return RcHandle<EntityImpl>(); }
67 
68  void set_observer(Observer_rch observer, Observer::Event e);
69 
70  Observer_rch get_observer(Observer::Event e);
71 
72 protected:
73  DDS::ReturnCode_t set_enabled();
74 
75  void set_deleted(bool state);
76 
77  bool get_deleted() const;
78 
79  DDS::InstanceHandle_t get_entity_instance_handle(const GUID_t& id, const RcHandle<DomainParticipantImpl>& participant);
80 
81  /// The flag indicates the entity is enabled.
83 
84  /// The flag indicates the entity is being deleted.
86 
87 private:
88  /// The status_changes_ variable lists all status changed flag.
89  /// The StatusChangedFlag becomes TRUE whenever the plain communication
90  /// status changes and it is reset to FALSE each time the application
91  /// accesses the plain communication status via the proper
92  /// get_<plain communication status> operation on the Entity.
94  DDS::StatusCondition_var status_condition_;
95 
97 
100 
102 
105 };
106 
107 } // namespace DCPS
108 } // namespace OpenDDS
109 
111 
112 #endif /* OPENDDS_DCPS_ENTITY_IMPL_H */
Implements the OpenDDS::DCPS::Entity interfaces.
Definition: EntityImpl.h:37
TransportConfig_rch transport_config_
Definition: EntityImpl.h:96
AtomicBool entity_deleted_
The flag indicates the entity is being deleted.
Definition: EntityImpl.h:85
WeakRcHandle< DomainParticipantImpl > participant_for_instance_handle_
Definition: EntityImpl.h:104
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
YARD is all original work While it may rely on standard YARD does not include code from other sources We have chosen to release our work as public domain code This means that YARD has been released outside the copyright system Feel free to use the code in any way you wish especially in an academic plagiarism has very little to do with copyright In an academic or in any situation where you are expected to give credit to other people s you will need to cite YARD as a source The author is Christopher and the appropriate date is December the release date for we can t make any promises regarding whether YARD will do what you or whether we will make any changes you ask for You are free to hire your own expert for that If you choose to distribute YARD you ll probably want to read up on the laws covering warranties in your state
Definition: COPYING.txt:14
Observer_rch observer_
Definition: EntityImpl.h:98
DDS::StatusMask status_changes_
Definition: EntityImpl.h:93
DOMAINID_TYPE_NATIVE DomainId_t
ACE_Thread_Mutex lock_
Definition: EntityImpl.h:101
virtual GUID_t get_id() const
Definition: EntityImpl.h:54
unsigned long Event
Definition: Observer.h:39
Observer::Event events_
Definition: EntityImpl.h:99
DDS::InstanceHandle_t instance_handle_
Definition: EntityImpl.h:103
DDS::StatusCondition_var status_condition_
Definition: EntityImpl.h:94
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
virtual RcHandle< EntityImpl > parent() const
Definition: EntityImpl.h:66
unsigned long StatusMask
AtomicBool enabled_
The flag indicates the entity is enabled.
Definition: EntityImpl.h:82
virtual DDS::DomainId_t get_domain_id()
Definition: EntityImpl.h:52
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const ::DDS::DomainId_t DOMAIN_UNKNOWN
unsigned long StatusKind
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28