OpenDDS::DCPS::EntityImpl Class Reference

Implements the OpenDDS::DCPS::Entity interfaces. More...

#include <EntityImpl.h>

Inheritance diagram for OpenDDS::DCPS::EntityImpl:

Inheritance graph
[legend]
Collaboration diagram for OpenDDS::DCPS::EntityImpl:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 EntityImpl ()
 Constructor.
virtual ~EntityImpl ()
 Destructor.
virtual DDS::ReturnCode_t set_enabled ()
bool is_enabled () const
virtual DDS::StatusCondition_ptr get_statuscondition ()
virtual DDS::StatusMask get_status_changes ()
virtual DDS::InstanceHandle_t get_instance_handle ()=0
virtual void set_deleted (bool state)
virtual bool get_deleted ()
void set_status_changed_flag (DDS::StatusKind status, bool status_changed_flag)
void notify_status_condition ()
virtual void transport_config (const TransportConfig_rch &cfg)
TransportConfig_rch transport_config () const
virtual EntityImplparent () const

Protected Attributes

ACE_Atomic_Op< TAO_SYNCH_MUTEX,
bool > 
enabled_
 The flag indicates the entity is enabled.
ACE_Atomic_Op< TAO_SYNCH_MUTEX,
bool > 
entity_deleted_
 The flag indicates the entity is being deleted.

Private Attributes

DDS::StatusMask status_changes_
DDS::StatusCondition_var status_condition_
TransportConfig_rch transport_config_
ACE_Thread_Mutex lock_

Detailed Description

Implements the OpenDDS::DCPS::Entity interfaces.

This class is the base class of other servant classes. e.g. DomainParticipantImpl, PublisherImpl ...

Definition at line 33 of file EntityImpl.h.


Constructor & Destructor Documentation

OpenDDS::DCPS::EntityImpl::EntityImpl (  ) 

Constructor.

Definition at line 16 of file EntityImpl.cpp.

00017   : enabled_(false),
00018     entity_deleted_(false),
00019     status_changes_(0),
00020     status_condition_(new StatusConditionImpl(this))
00021 {
00022 }

OpenDDS::DCPS::EntityImpl::~EntityImpl (  )  [virtual]

Destructor.

Definition at line 25 of file EntityImpl.cpp.

00026 {
00027 }


Member Function Documentation

bool OpenDDS::DCPS::EntityImpl::get_deleted (  )  [virtual]

Definition at line 82 of file EntityImpl.cpp.

References entity_deleted_.

Referenced by OpenDDS::DCPS::DataReaderImpl::data_received().

00083 {
00084   bool deleted_state = true;
00085 
00086   if (entity_deleted_ != true) {
00087     deleted_state = false;
00088   }
00089 
00090   return deleted_state;
00091 }

virtual DDS::InstanceHandle_t OpenDDS::DCPS::EntityImpl::get_instance_handle (  )  [pure virtual]

Implements DDS::Entity.

Implemented in OpenDDS::DCPS::DataReaderImpl, OpenDDS::DCPS::DataWriterImpl, OpenDDS::DCPS::DomainParticipantImpl, OpenDDS::DCPS::PublisherImpl, OpenDDS::DCPS::RecorderImpl, OpenDDS::DCPS::ReplayerImpl, OpenDDS::DCPS::SubscriberImpl, and OpenDDS::DCPS::TopicImpl.

DDS::StatusMask OpenDDS::DCPS::EntityImpl::get_status_changes (  )  [virtual]

Implements DDS::Entity.

Definition at line 52 of file EntityImpl.cpp.

References lock_, and status_changes_.

Referenced by OpenDDS::DCPS::StatusConditionImpl::get_trigger_value().

00053 {
00054   ACE_GUARD_RETURN(ACE_Thread_Mutex, g, lock_, 0);
00055   return status_changes_;
00056 }

DDS::StatusCondition_ptr OpenDDS::DCPS::EntityImpl::get_statuscondition (  )  [virtual]

Implements DDS::Entity.

Definition at line 46 of file EntityImpl.cpp.

References status_condition_.

00047 {
00048   return DDS::StatusCondition::_duplicate(status_condition_);
00049 }

bool OpenDDS::DCPS::EntityImpl::is_enabled (  )  const

Definition at line 40 of file EntityImpl.cpp.

References enabled_.

Referenced by OpenDDS::DCPS::TopicImpl::enable().

00041 {
00042   return this->enabled_.value();
00043 }

void OpenDDS::DCPS::EntityImpl::notify_status_condition (  ) 

Call this *after* dispatching to listeners when the "changed status flag" is enabled so that any waiting waitsets can be unblocked.

Definition at line 94 of file EntityImpl.cpp.

References status_condition_.

Referenced by OpenDDS::DCPS::DataWriterImpl::association_complete_i(), OpenDDS::DCPS::DataReaderImpl::coherent_changes_completed(), OpenDDS::DCPS::RequestedDeadlineWatchdog::execute(), OpenDDS::DCPS::OfferedDeadlineWatchdog::execute(), OpenDDS::DCPS::TopicImpl::inconsistent_topic(), OpenDDS::DCPS::DataReaderImpl::notify_liveliness_change(), OpenDDS::DCPS::DataReaderImpl::remove_associations_i(), OpenDDS::DCPS::DataReaderImpl_T< MessageType >::store_instance_data(), OpenDDS::DCPS::DataReaderImpl::transport_assoc_done(), OpenDDS::DCPS::DataWriterImpl::update_incompatible_qos(), and OpenDDS::DCPS::DataReaderImpl::update_incompatible_qos().

00095 {
00096   dynamic_cast<StatusConditionImpl*>(status_condition_.in())->signal_all();
00097 }

virtual EntityImpl* OpenDDS::DCPS::EntityImpl::parent (  )  const [inline, virtual]

Reimplemented in OpenDDS::DCPS::DataReaderImpl, OpenDDS::DCPS::DataWriterImpl, OpenDDS::DCPS::PublisherImpl, and OpenDDS::DCPS::SubscriberImpl.

Definition at line 65 of file EntityImpl.h.

00065 { return 0; }

void OpenDDS::DCPS::EntityImpl::set_deleted ( bool  state  )  [virtual]

Definition at line 74 of file EntityImpl.cpp.

References entity_deleted_.

Referenced by OpenDDS::DCPS::SubscriberImpl::delete_contained_entities(), OpenDDS::DCPS::PublisherImpl::delete_contained_entities(), OpenDDS::DCPS::DomainParticipantImpl::delete_contained_entities(), OpenDDS::DCPS::DataWriterImpl::prepare_to_delete(), and OpenDDS::DCPS::DataReaderImpl::prepare_to_delete().

00075 {
00076   if (entity_deleted_ != state) {
00077     entity_deleted_ = state;
00078   }
00079 }

DDS::ReturnCode_t OpenDDS::DCPS::EntityImpl::set_enabled (  )  [virtual]

Definition at line 30 of file EntityImpl.cpp.

References enabled_, and DDS::RETCODE_OK.

Referenced by OpenDDS::DCPS::TopicImpl::enable(), OpenDDS::DCPS::SubscriberImpl::enable(), OpenDDS::DCPS::ReplayerImpl::enable(), OpenDDS::DCPS::RecorderImpl::enable(), OpenDDS::DCPS::PublisherImpl::enable(), OpenDDS::DCPS::DomainParticipantImpl::enable(), OpenDDS::DCPS::DataWriterImpl::enable(), and OpenDDS::DCPS::DataReaderImpl::enable().

00031 {
00032   if (enabled_ == false) {
00033     enabled_ = true;
00034   }
00035 
00036   return DDS::RETCODE_OK;
00037 }

void OpenDDS::DCPS::EntityImpl::set_status_changed_flag ( DDS::StatusKind  status,
bool  status_changed_flag 
)

Definition at line 59 of file EntityImpl.cpp.

References lock_, and status_changes_.

Referenced by OpenDDS::DCPS::DataWriterImpl::association_complete_i(), OpenDDS::DCPS::DataReaderImpl::coherent_changes_completed(), OpenDDS::DCPS::RequestedDeadlineWatchdog::execute(), OpenDDS::DCPS::OfferedDeadlineWatchdog::execute(), OpenDDS::DCPS::TopicImpl::get_inconsistent_topic_status(), OpenDDS::DCPS::DataReaderImpl::get_liveliness_changed_status(), OpenDDS::DCPS::DataWriterImpl::get_liveliness_lost_status(), OpenDDS::DCPS::DataWriterImpl::get_offered_deadline_missed_status(), OpenDDS::DCPS::DataWriterImpl::get_offered_incompatible_qos_status(), OpenDDS::DCPS::DataWriterImpl::get_publication_matched_status(), OpenDDS::DCPS::DataReaderImpl::get_requested_deadline_missed_status(), OpenDDS::DCPS::DataReaderImpl::get_requested_incompatible_qos_status(), OpenDDS::DCPS::DataReaderImpl::get_sample_lost_status(), OpenDDS::DCPS::DataReaderImpl::get_sample_rejected_status(), OpenDDS::DCPS::DataReaderImpl::get_subscription_matched_status(), OpenDDS::DCPS::TopicImpl::inconsistent_topic(), OpenDDS::DCPS::DataReaderImpl::post_read_or_take(), OpenDDS::DCPS::DataReaderImpl::remove_associations_i(), OpenDDS::DCPS::DataReaderImpl_T< MessageType >::store_instance_data(), OpenDDS::DCPS::DataReaderImpl::transport_assoc_done(), OpenDDS::DCPS::DataWriterImpl::update_incompatible_qos(), OpenDDS::DCPS::DataReaderImpl::update_incompatible_qos(), OpenDDS::DCPS::DataReaderImpl::writer_became_alive(), OpenDDS::DCPS::DataReaderImpl::writer_became_dead(), and OpenDDS::DCPS::DataReaderImpl::writer_removed().

00062 {
00063   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00064 
00065   if (status_changed_flag) {
00066     status_changes_ |= status;
00067 
00068   } else {
00069     status_changes_ &= ~status;
00070   }
00071 }

TransportConfig_rch OpenDDS::DCPS::EntityImpl::transport_config (  )  const

Definition at line 107 of file EntityImpl.cpp.

References lock_, and transport_config_.

00108 {
00109   ACE_GUARD_RETURN(ACE_Thread_Mutex, g, lock_, TransportConfig_rch());
00110   return transport_config_;
00111 }

void OpenDDS::DCPS::EntityImpl::transport_config ( const TransportConfig_rch cfg  )  [virtual]

Reimplemented in OpenDDS::DCPS::TopicImpl.

Definition at line 100 of file EntityImpl.cpp.

References lock_, and transport_config_.

Referenced by OpenDDS::DCPS::TransportRegistry::bind_config().

00101 {
00102   ACE_GUARD(ACE_Thread_Mutex, g, lock_);
00103   transport_config_ = cfg;
00104 }


Member Data Documentation

ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> OpenDDS::DCPS::EntityImpl::enabled_ [protected]

The flag indicates the entity is enabled.

Definition at line 69 of file EntityImpl.h.

Referenced by OpenDDS::DCPS::SubscriberImpl::begin_access(), OpenDDS::DCPS::PublisherImpl::begin_coherent_changes(), OpenDDS::DCPS::SubscriberImpl::create_datareader(), OpenDDS::DCPS::DomainParticipantImpl::create_new_topic(), OpenDDS::DCPS::DomainParticipantImpl::create_publisher(), OpenDDS::DCPS::DomainParticipantImpl::create_recorder(), OpenDDS::DCPS::DomainParticipantImpl::create_subscriber(), OpenDDS::DCPS::DataWriterImpl::dispose(), OpenDDS::DCPS::SubscriberImpl::end_access(), OpenDDS::DCPS::PublisherImpl::end_coherent_changes(), OpenDDS::DCPS::DataReaderImpl::get_matched_publication_data(), OpenDDS::DCPS::DataReaderImpl::get_matched_publications(), OpenDDS::DCPS::DataWriterImpl::get_matched_subscription_data(), OpenDDS::DCPS::DataWriterImpl::get_matched_subscriptions(), OpenDDS::DCPS::DomainParticipantImpl::ignore_participant(), OpenDDS::DCPS::DomainParticipantImpl::ignore_publication(), OpenDDS::DCPS::DomainParticipantImpl::ignore_subscription(), OpenDDS::DCPS::DomainParticipantImpl::ignore_topic(), is_enabled(), OpenDDS::DCPS::DataWriterImpl::register_instance_i(), OpenDDS::DCPS::PublisherImpl::resume_publications(), set_enabled(), OpenDDS::DCPS::TopicImpl::set_qos(), OpenDDS::DCPS::SubscriberImpl::set_qos(), OpenDDS::DCPS::ReplayerImpl::set_qos(), OpenDDS::DCPS::PublisherImpl::set_qos(), OpenDDS::DCPS::DomainParticipantImpl::set_qos(), OpenDDS::DCPS::DataWriterImpl::set_qos(), OpenDDS::DCPS::DataReaderImpl::set_qos(), OpenDDS::DCPS::PublisherImpl::suspend_publications(), OpenDDS::DCPS::DataWriterImpl::unregister_instance_i(), OpenDDS::DCPS::PublisherImpl::wait_for_acknowledgments(), and OpenDDS::DCPS::DataWriterImpl::write().

ACE_Atomic_Op<TAO_SYNCH_MUTEX, bool> OpenDDS::DCPS::EntityImpl::entity_deleted_ [protected]

The flag indicates the entity is being deleted.

Definition at line 72 of file EntityImpl.h.

Referenced by OpenDDS::DCPS::DataWriterImpl::add_association(), OpenDDS::DCPS::DataReaderImpl::add_association(), get_deleted(), and set_deleted().

ACE_Thread_Mutex OpenDDS::DCPS::EntityImpl::lock_ [mutable, private]

Reimplemented in OpenDDS::DCPS::DataWriterImpl, and OpenDDS::DCPS::ReplayerImpl.

Definition at line 85 of file EntityImpl.h.

Referenced by get_status_changes(), set_status_changed_flag(), and transport_config().

DDS::StatusMask OpenDDS::DCPS::EntityImpl::status_changes_ [private]

The status_changes_ variable lists all status changed flag. The StatusChangedFlag becomes TRUE whenever the plain communication status changes and it is reset to FALSE each time the application accesses the plain communication status via the proper get_<plain communication status> operation on the Entity.

Definition at line 80 of file EntityImpl.h.

Referenced by get_status_changes(), and set_status_changed_flag().

DDS::StatusCondition_var OpenDDS::DCPS::EntityImpl::status_condition_ [private]

Definition at line 81 of file EntityImpl.h.

Referenced by get_statuscondition(), and notify_status_condition().

TransportConfig_rch OpenDDS::DCPS::EntityImpl::transport_config_ [private]

Definition at line 83 of file EntityImpl.h.

Referenced by transport_config().


The documentation for this class was generated from the following files:
Generated on Fri Feb 12 20:06:17 2016 for OpenDDS by  doxygen 1.4.7