OpenDDS
Snapshot(2023/04/07-19:43)
|
Implements the OpenDDS::DCPS::Publisher interfaces. More...
#include <PublisherImpl.h>
Private Types | |
typedef ACE_Recursive_Thread_Mutex | lock_type |
typedef ACE_Reverse_Lock< lock_type > | reverse_lock_type |
Private Member Functions | |
typedef | OPENDDS_MULTIMAP (OPENDDS_STRING, DataWriterImpl_rch) DataWriterMap |
typedef | OPENDDS_MAP_CMP (GUID_t, DataWriterImpl_rch, GUID_tKeyLessThan) PublicationMap |
typedef | OPENDDS_MAP_CMP (GUID_t, DDS::DataWriterQos, GUID_tKeyLessThan) DwIdToQosMap |
typedef | OPENDDS_SET (DataWriterImpl_rch) DataWriterSet |
Private Attributes | |
DDS::InstanceHandle_t | handle_ |
DDS::PublisherQos | qos_ |
Publisher QoS policy list. More... | |
DDS::DataWriterQos | default_datawriter_qos_ |
Default datawriter Qos policy list. More... | |
ACE_Thread_Mutex | listener_mutex_ |
Mutex to protect listener info. More... | |
DDS::StatusMask | listener_mask_ |
DDS::PublisherListener_var | listener_ |
Used to notify the entity for relevant events. More... | |
DataWriterSet | writers_not_enabled_ |
DataWriterMap | datawriter_map_ |
This map is used to support datawriter lookup by topic name. More... | |
PublicationMap | publication_map_ |
std::size_t | change_depth_ |
The number of times begin_coherent_changes as been called. More... | |
DDS::DomainId_t | domain_id_ |
Domain in which we are contained. More... | |
WeakRcHandle< DomainParticipantImpl > | participant_ |
The DomainParticipant servant that owns this Publisher. More... | |
CORBA::Short | suspend_depth_count_ |
The suspend depth count. More... | |
SequenceNumber | sequence_number_ |
MonotonicTimePoint | aggregation_period_start_ |
Start of current aggregation period. - NOT USED IN FIRST IMPL. More... | |
lock_type | pi_lock_ |
The recursive lock to protect datawriter map and suspend count. More... | |
reverse_lock_type | reverse_pi_lock_ |
lock_type | pi_suspended_lock_ |
unique_ptr< Monitor > | monitor_ |
Monitor object for this entity. More... | |
GUID_t | publisher_id_ |
Friends | |
class | DataWriterImpl |
Implements the OpenDDS::DCPS::Publisher interfaces.
This class acts as a factory and container of the datawriter.
See the DDS specification, OMG formal/2015-04-10, for a description of the interface this class is implementing.
Definition at line 38 of file PublisherImpl.h.
|
private |
Definition at line 205 of file PublisherImpl.h.
|
private |
Definition at line 206 of file PublisherImpl.h.
OpenDDS::DCPS::PublisherImpl::PublisherImpl | ( | DDS::InstanceHandle_t | handle, |
GUID_t | id, | ||
const DDS::PublisherQos & | qos, | ||
DDS::PublisherListener_ptr | a_listener, | ||
const DDS::StatusMask & | mask, | ||
DomainParticipantImpl * | participant | ||
) |
Definition at line 29 of file PublisherImpl.cpp.
References _duplicate(), monitor_, and TheServiceParticipant.
|
virtual |
Definition at line 53 of file PublisherImpl.cpp.
References ACE_ERROR, handle_, is_clean(), LM_WARNING, OpenDDS::DCPS::log_level, participant_, and OpenDDS::DCPS::LogLevel::Warning.
DDS::ReturnCode_t OpenDDS::DCPS::PublisherImpl::assert_liveliness_by_participant | ( | ) |
Definition at line 960 of file PublisherImpl.cpp.
References datawriter_map_, and DDS::RETCODE_OK.
|
virtual |
Implements DDS::Publisher.
Definition at line 609 of file PublisherImpl.cpp.
References DDS::PresentationQosPolicy::access_scope, ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), change_depth_, DDS::PresentationQosPolicy::coherent_access, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, DDS::INSTANCE_PRESENTATION_QOS, LM_ERROR, pi_lock_, DDS::PublisherQos::presentation, publication_map_, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, and DDS::RETCODE_OK.
bool OpenDDS::DCPS::PublisherImpl::contains_writer | ( | DDS::InstanceHandle_t | a_handle | ) |
Definition at line 78 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, datawriter_map_, pi_lock_, and DDS::RETCODE_ERROR.
|
virtual |
Definition at line 831 of file PublisherImpl.cpp.
References OpenDDS::DCPS::Qos_Helper::copy_from_topic_qos(), DDS::RETCODE_INCONSISTENT_POLICY, and DDS::RETCODE_OK.
|
virtual |
Definition at line 96 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), DDS::EntityFactoryQosPolicy::autoenable_created_entities, OpenDDS::DCPS::DCPS_debug_level, default_datawriter_qos_, OpenDDS::DCPS::DataWriterImpl::enable(), OpenDDS::DCPS::EntityImpl::enabled_, DDS::PublisherQos::entity_factory, OpenDDS::DCPS::TopicDescriptionImpl::get_name(), OpenDDS::DCPS::TopicDescriptionImpl::get_type_support(), TAO::String_var< charT >::in(), OpenDDS::DCPS::DataWriterImpl::init(), LM_ERROR, LM_WARNING, name, participant_, pi_lock_, qos_, OpenDDS::DCPS::rchandle_from(), DDS::RETCODE_OK, validate_datawriter_qos(), and writers_not_enabled_.
|
virtual |
Implements DDS::Publisher.
Definition at line 369 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), datawriter_map_, OpenDDS::DCPS::DCPS_debug_level, delete_datawriter(), OpenDDS::DCPS::EntityImpl::get_deleted(), OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::DCPS::RcHandle< T >::in(), LM_ERROR, pi_lock_, prepare_to_delete_datawriters(), DDS::RETCODE_ERROR, DDS::RETCODE_OK, OpenDDS::DCPS::EntityImpl::set_deleted(), set_wait_pending_deadline(), and TheServiceParticipant.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::delete_publisher().
|
virtual |
Definition at line 181 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DataWriterImpl::cleanup(), datawriter_map_, OpenDDS::DCPS::DCPS_debug_level, domain_id_, OpenDDS::DCPS::EntityImpl::get_deleted(), OpenDDS::DCPS::DataWriterImpl::get_guid(), OpenDDS::DCPS::DataWriterImpl::get_publisher(), OpenDDS::DCPS::GUID_UNKNOWN, LM_ERROR, monitor_, participant_, pi_lock_, OpenDDS::DCPS::DataWriterImpl::prepare_to_delete(), publication_map_, OpenDDS::DCPS::DataWriterImpl::remove_all_associations(), DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, reverse_pi_lock_, OpenDDS::DCPS::DataWriterImpl::set_wait_pending_deadline(), TheServiceParticipant, OpenDDS::DCPS::DataWriterImpl::unregister_all(), and OpenDDS::DCPS::DataWriterImpl::wait_pending().
Referenced by delete_contained_entities().
|
virtual |
Implements DDS::Entity.
Definition at line 842 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, DDS::EntityFactoryQosPolicy::autoenable_created_entities, DDS::PublisherQos::entity_factory, OpenDDS::DCPS::EntityImpl::is_enabled(), monitor_, participant_, pi_lock_, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, OpenDDS::DCPS::EntityImpl::set_enabled(), and writers_not_enabled_.
Referenced by OpenDDS::DCPS::DomainParticipantImpl::create_publisher().
|
virtual |
Implements DDS::Publisher.
Definition at line 655 of file PublisherImpl.cpp.
References DDS::PresentationQosPolicy::access_scope, ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), change_depth_, DDS::PresentationQosPolicy::coherent_access, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, DDS::INSTANCE_PRESENTATION_QOS, LM_ERROR, pi_lock_, DDS::PublisherQos::presentation, publication_map_, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, and DDS::RETCODE_PRECONDITION_NOT_MET.
|
virtual |
Definition at line 824 of file PublisherImpl.cpp.
References default_datawriter_qos_, and DDS::RETCODE_OK.
|
virtual |
Implements OpenDDS::DCPS::EntityImpl.
Definition at line 72 of file PublisherImpl.cpp.
References handle_.
Referenced by OpenDDS::DCPS::PublisherMonitorImpl::report().
|
virtual |
Implements DDS::Publisher.
Definition at line 525 of file PublisherImpl.cpp.
References listener_, and listener_mutex_.
|
virtual |
Implements DDS::Publisher.
Definition at line 806 of file PublisherImpl.cpp.
References participant_.
Referenced by OpenDDS::DCPS::PublisherMonitorImpl::report().
|
inline |
Definition at line 113 of file PublisherImpl.h.
References OpenDDS::DCPS::OPENDDS_MAP_CMP(), OPENDDS_MULTIMAP, OPENDDS_STRING, and OpenDDS::DCPS::OPENDDS_VECTOR().
void OpenDDS::DCPS::PublisherImpl::get_publication_ids | ( | PublicationIdVec & | pubs | ) |
Populates a std::vector with the GUID_ts of this Publisher's Data Writers
Definition at line 1000 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, pi_lock_, and publication_map_.
Referenced by OpenDDS::DCPS::PublisherMonitorImpl::report().
|
virtual |
Definition at line 507 of file PublisherImpl.cpp.
References qos_, and DDS::RETCODE_OK.
bool OpenDDS::DCPS::PublisherImpl::is_clean | ( | String * | leftover_entities = 0 | ) | const |
This method is not defined in the IDL and is defined for internal use. Check if there is any datawriter associated with this publisher.
Definition at line 877 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, datawriter_map_, pi_lock_, publication_map_, and OpenDDS::DCPS::to_dds_string().
Referenced by OpenDDS::DCPS::DomainParticipantImpl::delete_publisher(), and ~PublisherImpl().
bool OpenDDS::DCPS::PublisherImpl::is_suspended | ( | void | ) | const |
Definition at line 553 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, pi_suspended_lock_, and suspend_depth_count_.
DDS::PublisherListener_ptr OpenDDS::DCPS::PublisherImpl::listener_for | ( | ::DDS::StatusKind | kind | ) |
This is used to retrieve the listener for a certain status change. If this publisher has a registered listener and the status kind is in the listener mask then the listener is returned. Otherwise, the query for listener is propagated up to the factory/DomainParticipant.
Definition at line 939 of file PublisherImpl.cpp.
References CORBA::is_nil(), listener_, listener_mask_, listener_mutex_, participant_, and ACE_Guard< ACE_LOCK >::release().
TimeDuration OpenDDS::DCPS::PublisherImpl::liveliness_check_interval | ( | DDS::LivelinessQosPolicyKind | kind | ) |
Definition at line 977 of file PublisherImpl.cpp.
References datawriter_map_, and OpenDDS::DCPS::TimeDuration::max_value.
|
virtual |
Definition at line 307 of file PublisherImpl.cpp.
References ACE_DEBUG, ACE_GUARD_RETURN, ACE_TEXT(), datawriter_map_, OpenDDS::DCPS::DCPS_debug_level, LM_DEBUG, and pi_lock_.
|
private |
|
private |
|
private |
|
private |
typedef OpenDDS::DCPS::PublisherImpl::OPENDDS_VECTOR | ( | GUID_t | ) |
|
virtual |
Reimplemented from OpenDDS::DCPS::EntityImpl.
Definition at line 1016 of file PublisherImpl.cpp.
References participant_.
bool OpenDDS::DCPS::PublisherImpl::participant_liveliness_activity_after | ( | const MonotonicTimePoint & | tv | ) |
Definition at line 988 of file PublisherImpl.cpp.
References datawriter_map_.
bool OpenDDS::DCPS::PublisherImpl::prepare_to_delete_datawriters | ( | ) |
Definition at line 334 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, datawriter_map_, OpenDDS::DCPS::EntityImpl::get_deleted(), pi_lock_, and OpenDDS::DCPS::DataWriterImpl::prepare_to_delete().
Referenced by delete_contained_entities().
|
virtual |
Implements DDS::Publisher.
Definition at line 563 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, LM_ERROR, pi_lock_, pi_suspended_lock_, publication_map_, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, DDS::RETCODE_PRECONDITION_NOT_MET, and suspend_depth_count_.
|
virtual |
Definition at line 812 of file PublisherImpl.cpp.
References OpenDDS::DCPS::Qos_Helper::consistent(), default_datawriter_qos_, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, and OpenDDS::DCPS::Qos_Helper::valid().
|
virtual |
Definition at line 514 of file PublisherImpl.cpp.
References listener_, listener_mask_, listener_mutex_, and DDS::RETCODE_OK.
|
virtual |
Definition at line 426 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::changeable(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::DCPS_debug_level, domain_id_, OpenDDS::DCPS::EntityImpl::enabled_, LM_ERROR, OPENDDS_NO_OBJECT_MODEL_PROFILE_COMPATIBILITY_CHECK, participant_, pi_lock_, publication_map_, qos_, DDS::RETCODE_ERROR, DDS::RETCODE_IMMUTABLE_POLICY, DDS::RETCODE_INCONSISTENT_POLICY, DDS::RETCODE_OK, DDS::RETCODE_UNSUPPORTED, TheServiceParticipant, and OpenDDS::DCPS::Qos_Helper::valid().
bool OpenDDS::DCPS::PublisherImpl::set_wait_pending_deadline | ( | const MonotonicTimePoint & | deadline | ) |
Definition at line 353 of file PublisherImpl.cpp.
References ACE_GUARD_RETURN, datawriter_map_, pi_lock_, and OpenDDS::DCPS::DataWriterImpl::set_wait_pending_deadline().
Referenced by delete_contained_entities().
|
virtual |
Implements DDS::Publisher.
Definition at line 532 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, LM_ERROR, pi_suspended_lock_, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, DDS::RETCODE_OK, and suspend_depth_count_.
|
static |
Definition at line 1022 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::Qos_Helper::consistent(), OpenDDS::DCPS::Qos_Helper::copy_from_topic_qos(), DATAWRITER_QOS_DEFAULT, DATAWRITER_QOS_USE_TOPIC_QOS, OpenDDS::DCPS::DCPS_debug_level, CORBA::is_nil(), LM_ERROR, OPENDDS_END_VERSIONED_NAMESPACE_DECL, OPENDDS_NO_DURABILITY_KIND_TRANSIENT_PERSISTENT_COMPATIBILITY_CHECK, OPENDDS_NO_DURABILITY_SERVICE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_KIND_EXCLUSIVE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_PROFILE_COMPATIBILITY_CHECK, OPENDDS_NO_OWNERSHIP_STRENGTH_COMPATIBILITY_CHECK, and OpenDDS::DCPS::Qos_Helper::valid().
Referenced by create_datawriter(), and OpenDDS::DCPS::DomainParticipantImpl::create_replayer().
|
virtual |
Definition at line 740 of file PublisherImpl.cpp.
References ACE_DEBUG, ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), datawriter_map_, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::DCPS::EntityImpl::enabled_, OpenDDS::DCPS::RcHandle< T >::in(), LM_DEBUG, LM_ERROR, OpenDDS::DCPS::OPENDDS_MAP(), pi_lock_, DDS::RELIABLE_RELIABILITY_QOS, DDS::RETCODE_ERROR, DDS::RETCODE_NOT_ENABLED, and DDS::RETCODE_OK.
DDS::ReturnCode_t OpenDDS::DCPS::PublisherImpl::writer_enabled | ( | const char * | topic_name, |
DataWriterImpl * | impl | ||
) |
This method is called when the datawriter created by this publisher was enabled.
Definition at line 902 of file PublisherImpl.cpp.
References ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), datawriter_map_, OpenDDS::DCPS::DCPS_debug_level, LM_ERROR, monitor_, pi_lock_, publication_map_, OpenDDS::DCPS::rchandle_from(), DDS::RETCODE_ERROR, DDS::RETCODE_OK, and writers_not_enabled_.
|
friend |
Definition at line 43 of file PublisherImpl.h.
|
private |
Start of current aggregation period. - NOT USED IN FIRST IMPL.
Definition at line 203 of file PublisherImpl.h.
|
private |
The number of times begin_coherent_changes as been called.
Definition at line 191 of file PublisherImpl.h.
Referenced by begin_coherent_changes(), and end_coherent_changes().
|
private |
This map is used to support datawriter lookup by topic name.
Definition at line 185 of file PublisherImpl.h.
Referenced by assert_liveliness_by_participant(), contains_writer(), delete_contained_entities(), delete_datawriter(), is_clean(), liveliness_check_interval(), lookup_datawriter(), participant_liveliness_activity_after(), prepare_to_delete_datawriters(), set_wait_pending_deadline(), wait_for_acknowledgments(), and writer_enabled().
|
private |
Default datawriter Qos policy list.
Definition at line 171 of file PublisherImpl.h.
Referenced by create_datawriter(), get_default_datawriter_qos(), and set_default_datawriter_qos().
|
private |
Domain in which we are contained.
Definition at line 194 of file PublisherImpl.h.
Referenced by delete_datawriter(), and set_qos().
|
private |
Definition at line 166 of file PublisherImpl.h.
Referenced by get_instance_handle(), and ~PublisherImpl().
|
private |
Used to notify the entity for relevant events.
Definition at line 179 of file PublisherImpl.h.
Referenced by get_listener(), listener_for(), and set_listener().
|
private |
The StatusKind bit mask indicates which status condition change can be notified by the listener of this entity.
Definition at line 177 of file PublisherImpl.h.
Referenced by listener_for(), and set_listener().
|
private |
Mutex to protect listener info.
Definition at line 174 of file PublisherImpl.h.
Referenced by get_listener(), listener_for(), and set_listener().
|
private |
Monitor object for this entity.
Definition at line 213 of file PublisherImpl.h.
Referenced by delete_datawriter(), enable(), PublisherImpl(), and writer_enabled().
|
private |
The DomainParticipant servant that owns this Publisher.
Definition at line 196 of file PublisherImpl.h.
Referenced by create_datawriter(), delete_datawriter(), enable(), get_participant(), listener_for(), parent(), set_qos(), and ~PublisherImpl().
|
mutableprivate |
The recursive lock to protect datawriter map and suspend count.
Definition at line 208 of file PublisherImpl.h.
Referenced by begin_coherent_changes(), contains_writer(), create_datawriter(), delete_contained_entities(), delete_datawriter(), enable(), end_coherent_changes(), get_publication_ids(), is_clean(), lookup_datawriter(), prepare_to_delete_datawriters(), resume_publications(), set_qos(), set_wait_pending_deadline(), wait_for_acknowledgments(), and writer_enabled().
|
mutableprivate |
Definition at line 210 of file PublisherImpl.h.
Referenced by is_suspended(), resume_publications(), and suspend_publications().
|
private |
This map is used to support datawriter lookup by datawriter repository id.
Definition at line 188 of file PublisherImpl.h.
Referenced by begin_coherent_changes(), delete_datawriter(), end_coherent_changes(), get_publication_ids(), is_clean(), resume_publications(), set_qos(), and writer_enabled().
|
private |
Definition at line 217 of file PublisherImpl.h.
|
private |
Publisher QoS policy list.
Definition at line 169 of file PublisherImpl.h.
Referenced by begin_coherent_changes(), create_datawriter(), enable(), end_coherent_changes(), get_qos(), and set_qos().
|
private |
Definition at line 209 of file PublisherImpl.h.
Referenced by delete_datawriter().
|
private |
Unique sequence number used when the scope_access = GROUP.
Definition at line 201 of file PublisherImpl.h.
|
private |
The suspend depth count.
Definition at line 198 of file PublisherImpl.h.
Referenced by is_suspended(), resume_publications(), and suspend_publications().
|
private |
Definition at line 182 of file PublisherImpl.h.
Referenced by create_datawriter(), enable(), and writer_enabled().