OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <ShmemDataLink.h>
Public Member Functions | |
ShmemDataLink (const ShmemTransport_rch &transport) | |
bool | open (const std::string &peer_address) |
int | make_reservation (const GUID_t &remote_pub, const GUID_t &local_sub, const TransportReceiveListener_wrch &receive_listener, bool reliable) |
void | request_ack_received (ReceivedDataSample &sample) |
void | stop_resend_association_msgs (const GUID_t &local, const GUID_t &remote) |
void | control_received (ReceivedDataSample &sample) |
std::string | local_address () |
std::string | peer_address () |
pid_t | peer_pid () |
ShmemAllocator * | local_allocator () |
ShmemAllocator * | peer_allocator () |
void | read () |
void | signal_semaphore () |
ShmemTransport_rch | transport () const |
ShmemInst_rch | config () const |
![]() | |
DataLink (const TransportImpl_rch &impl, Priority priority, bool is_loopback, bool is_active) | |
Only called by our TransportImpl object. More... | |
virtual | ~DataLink () |
int | handle_exception (ACE_HANDLE) |
Reactor invokes this after being notified in schedule_stop or cancel_release. More... | |
void | schedule_stop (const MonotonicTimePoint &schedule_to_stop_at) |
void | stop () |
The stop method is used to stop the DataLink prior to shutdown. More... | |
void | resume_send () |
virtual int | make_reservation (const GUID_t &remote_subscription_id, const GUID_t &local_publication_id, const TransportSendListener_wrch &send_listener, bool reliable) |
void | release_reservations (GUID_t remote_id, GUID_t local_id, DataLinkSetMap &released_locals) |
void | schedule_delayed_release () |
const TimeDuration & | datalink_release_delay () const |
void | remove_listener (const GUID_t &local_id) |
void | send_start () |
void | send (TransportQueueElement *element) |
void | send_stop (GUID_t repoId) |
virtual RemoveResult | remove_sample (const DataSampleElement *sample) |
virtual void | remove_all_msgs (const GUID_t &pub_id) |
int | data_received (ReceivedDataSample &sample, const GUID_t &readerId=GUID_UNKNOWN) |
void | data_received_include (ReceivedDataSample &sample, const RepoIdSet &incl) |
DataLinkIdType | id () const |
Obtain a unique identifier for this DataLink object. More... | |
void | transport_shutdown () |
void | notify (ConnectionNotice notice) |
virtual void | pre_stop_i () |
void | release_resources () |
void | terminate_send () |
void | terminate_send_if_suspended () |
bool | is_target (const GUID_t &remote_id) |
void | clear_associations () |
int | handle_timeout (const ACE_Time_Value &tv, const void *arg) |
int | handle_close (ACE_HANDLE h, ACE_Reactor_Mask m) |
void | set_dscp_codepoint (int cp, ACE_SOCK &socket) |
Priority & | transport_priority () |
Priority | transport_priority () const |
bool & | is_loopback () |
bool | is_loopback () const |
bool & | is_active () |
bool | is_active () const |
bool | cancel_release () |
ACE_Message_Block * | create_control (char submessage_id, DataSampleHeader &header, Message_Block_Ptr data) |
SendControlStatus | send_control (const DataSampleHeader &header, Message_Block_Ptr data) |
GUIDSeq * | target_intersection (const GUID_t &pub_id, const GUIDSeq &in, size_t &n_subs) |
TransportImpl_rch | impl () const |
void | default_listener (const TransportReceiveListener_wrch &trl) |
TransportReceiveListener_wrch | default_listener () const |
bool | add_on_start_callback (const TransportClient_wrch &client, const GUID_t &remote) |
void | remove_on_start_callback (const TransportClient_wrch &client, const GUID_t &remote) |
void | invoke_on_start_callbacks (bool success) |
bool | invoke_on_start_callbacks (const GUID_t &local, const GUID_t &remote, bool success) |
void | remove_startup_callbacks (const GUID_t &local, const GUID_t &remote) |
void | set_scheduling_release (bool scheduling_release) |
virtual void | send_final_acks (const GUID_t &readerid) |
virtual WeakRcHandle< ICE::Endpoint > | get_ice_endpoint () const |
virtual bool | is_leading (const GUID_t &, const GUID_t &) const |
![]() | |
RcEventHandler () | |
ACE_Event_Handler::Reference_Count | add_reference () |
ACE_Event_Handler::Reference_Count | remove_reference () |
![]() | |
virtual | ~ACE_Event_Handler (void) |
virtual ACE_HANDLE | get_handle (void) const |
virtual void | set_handle (ACE_HANDLE) |
virtual int | priority (void) const |
virtual void | priority (int priority) |
virtual int | handle_input (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
virtual int | handle_output (ACE_HANDLE fd=ACE_INVALID_HANDLE) |
virtual int | handle_exit (ACE_Process *) |
virtual int | handle_signal (int signum, siginfo_t *=0, ucontext_t *=0) |
virtual int | resume_handler (void) |
virtual int | handle_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
virtual int | handle_group_qos (ACE_HANDLE=ACE_INVALID_HANDLE) |
virtual void | reactor (ACE_Reactor *reactor) |
virtual ACE_Reactor * | reactor (void) const |
virtual ACE_Reactor_Timer_Interface * | reactor_timer_interface (void) const |
Reference_Counting_Policy & | reference_counting_policy (void) |
![]() | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
WeakObject * | _get_weak_object () const |
Protected Member Functions | |
virtual void | stop_i () |
![]() | |
int | start (const TransportSendStrategy_rch &send_strategy, const TransportStrategy_rch &receive_strategy, bool invoke_all=true) |
void | send_start_i () |
virtual void | send_i (TransportQueueElement *element, bool relink=true) |
void | send_stop_i (GUID_t repoId) |
GUIDSeq * | peer_ids (const GUID_t &local_id) const |
void | network_change () const |
void | replay_durable_data (const GUID_t &local_pub_id, const GUID_t &remote_sub_id) const |
TransportSendStrategy_rch | get_send_strategy () |
typedef | OPENDDS_MAP_CMP (GUID_t, TransportClient_wrch, GUID_tKeyLessThan) RepoToClientMap |
typedef | OPENDDS_MAP_CMP (GUID_t, RepoToClientMap, GUID_tKeyLessThan) OnStartCallbackMap |
typedef | OPENDDS_MAP_CMP (GUID_t, RepoIdSet, GUID_tKeyLessThan) PendingOnStartsMap |
![]() | |
ACE_Event_Handler (ACE_Reactor *=0, int priority=ACE_Event_Handler::LO_PRIORITY) | |
![]() | |
RcObject () | |
Protected Attributes | |
ShmemSendStrategy_rch | send_strategy_ |
ShmemReceiveStrategy_rch | recv_strategy_ |
![]() | |
TransportStrategy_rch | receive_strategy_ |
The transport receive strategy object for this DataLink. More... | |
TransportSendStrategy_rch | send_strategy_ |
The transport send strategy object for this DataLink. More... | |
LockType | strategy_lock_ |
OnStartCallbackMap | on_start_callbacks_ |
PendingOnStartsMap | pending_on_starts_ |
TimeDuration | datalink_release_delay_ |
unique_ptr< MessageBlockAllocator > | mb_allocator_ |
unique_ptr< DataBlockAllocator > | db_allocator_ |
bool | is_loopback_ |
Is remote attached to same transport ? More... | |
bool | is_active_ |
Is pub or sub ? More... | |
bool | started_ |
SendResponseListener | send_response_listener_ |
Listener for TransportSendControlElements created in send_control. More... | |
Interceptor | interceptor_ |
![]() | |
Atomic_Reference_Count | reference_count_ |
Private Types | |
typedef std::set< GuidPair > | AssocResends |
typedef PmfPeriodicTask< ShmemDataLink > | SmPeriodicTask |
Private Member Functions | |
void | send_association_msg (const GUID_t &local, const GUID_t &remote) |
void | resend_association_msgs (const MonotonicTimePoint &now) |
Definition at line 50 of file ShmemDataLink.h.
|
private |
Definition at line 96 of file ShmemDataLink.h.
|
private |
Definition at line 98 of file ShmemDataLink.h.
OpenDDS::DCPS::ShmemDataLink::ShmemDataLink | ( | const ShmemTransport_rch & | transport | ) |
Definition at line 34 of file ShmemDataLink.cpp.
ShmemInst_rch OpenDDS::DCPS::ShmemDataLink::config | ( | ) | const |
Definition at line 283 of file ShmemDataLink.cpp.
References OpenDDS::DCPS::dynamic_rchandle_cast(), OPENDDS_END_VERSIONED_NAMESPACE_DECL, and transport().
Referenced by open().
void OpenDDS::DCPS::ShmemDataLink::control_received | ( | ReceivedDataSample & | sample | ) |
Definition at line 218 of file ShmemDataLink.cpp.
Referenced by OpenDDS::DCPS::ShmemReceiveStrategy::deliver_sample().
std::string OpenDDS::DCPS::ShmemDataLink::local_address | ( | ) |
Definition at line 263 of file ShmemDataLink.cpp.
References OPENDDS_TEST_AND_CALL_ASSIGN, and transport().
Referenced by OpenDDS::DCPS::ShmemReceiveStrategy::read().
ShmemAllocator * OpenDDS::DCPS::ShmemDataLink::local_allocator | ( | ) |
Definition at line 255 of file ShmemDataLink.cpp.
References OPENDDS_TEST_AND_CALL_ASSIGN, and transport().
Referenced by OpenDDS::DCPS::ShmemSendStrategy::send_bytes_i(), and OpenDDS::DCPS::ShmemSendStrategy::start_i().
|
virtual |
Only called by our TransportImpl object.
Return Codes: 0 means successful reservation made. -1 means failure.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 114 of file ShmemDataLink.cpp.
References ACE_GUARD_RETURN, assoc_resends_, assoc_resends_mutex_, OpenDDS::DCPS::DataLink::make_reservation(), and send_association_msg().
bool OpenDDS::DCPS::ShmemDataLink::open | ( | const std::string & | peer_address | ) |
Definition at line 47 of file ShmemDataLink.cpp.
References ACE_DEFAULT_PAGEFILE_POOL_CHUNK, ACE_ERROR_RETURN, ACE_TEXT(), ACE_TEXT_CHAR_TO_TCHAR, ACE_TEXT_CreateFileMapping, assoc_resends_task_, ACE_String_Base< char >::c_str(), config(), ACE_Malloc_T< class, ACE_LOCK, ACE_CB >::find(), OpenDDS::DCPS::ReactorTask::interceptor(), LM_DEBUG, LM_ERROR, name, peer_address(), peer_address_, peer_alloc_, reactor_task_, recv_strategy_, OpenDDS::DCPS::ref(), resend_association_msgs(), send_strategy_, OpenDDS::DCPS::DataLink::start(), stop_i(), and VDBG_LVL.
ACE_INLINE std::string OpenDDS::DCPS::ShmemDataLink::peer_address | ( | ) |
Definition at line 15 of file ShmemDataLink.inl.
References OPENDDS_END_VERSIONED_NAMESPACE_DECL, and peer_address_.
Referenced by open(), and OpenDDS::DCPS::ShmemSendStrategy::start_i().
ShmemAllocator * OpenDDS::DCPS::ShmemDataLink::peer_allocator | ( | ) |
Definition at line 248 of file ShmemDataLink.cpp.
References ACE_GUARD_RETURN, peer_alloc_, and peer_alloc_mutex_.
Referenced by OpenDDS::DCPS::ShmemReceiveStrategy::read(), OpenDDS::DCPS::ShmemReceiveStrategy::receive_bytes(), and OpenDDS::DCPS::ShmemSendStrategy::start_i().
pid_t OpenDDS::DCPS::ShmemDataLink::peer_pid | ( | ) |
Definition at line 277 of file ShmemDataLink.cpp.
References peer_address_.
Referenced by OpenDDS::DCPS::ShmemSendStrategy::start_i().
|
inline |
Definition at line 75 of file ShmemDataLink.h.
void OpenDDS::DCPS::ShmemDataLink::request_ack_received | ( | ReceivedDataSample & | sample | ) |
Definition at line 185 of file ShmemDataLink.cpp.
References OpenDDS::DCPS::DataLink::data_received(), OpenDDS::DCPS::guid_cdr_size, OpenDDS::DCPS::ReceivedDataSample::header_, OpenDDS::DCPS::DataLink::invoke_on_start_callbacks(), OpenDDS::DCPS::GuidConverter::isWriter(), LM_DEBUG, OpenDDS::DCPS::DataSampleHeader::message_length_, OpenDDS::DCPS::DataSampleHeader::publication_id_, recv_strategy_, send_association_msg(), OpenDDS::DCPS::DataSampleHeader::sequence_, stop_resend_association_msgs(), OpenDDS::DCPS::TransportReceiveStrategy< TH, DSH >::to_msgblock(), and VDBG.
Referenced by OpenDDS::DCPS::ShmemReceiveStrategy::deliver_sample().
|
private |
Definition at line 166 of file ShmemDataLink.cpp.
References ACE_GUARD, assoc_resends_, assoc_resends_mutex_, LM_DEBUG, send_association_msg(), and VDBG.
Referenced by open().
|
private |
Definition at line 132 of file ShmemDataLink.cpp.
References ACE_CDR_BYTE_ORDER, ACE_DEFAULT_MESSAGE_BLOCK_PRIORITY, OpenDDS::DCPS::DataSampleHeader::byte_order_, OpenDDS::DCPS::unique_ptr< T, Deleter >::get(), OpenDDS::DCPS::DataSampleHeader::get_max_serialized_size(), OpenDDS::DCPS::guid_cdr_size, OpenDDS::DCPS::TransportSendStrategy::link_released(), LM_DEBUG, ACE_Time_Value::max_time, ACE_Message_Block::MB_DATA, OpenDDS::DCPS::DataSampleHeader::message_id_, OpenDDS::DCPS::DataSampleHeader::message_length_, OpenDDS::DCPS::move(), OpenDDS::DCPS::DataSampleHeader::publication_id_, OpenDDS::DCPS::DataSampleHeader::publisher_id_, OpenDDS::DCPS::REQUEST_ACK, OpenDDS::DCPS::DataLink::send_i(), send_strategy_, OpenDDS::DCPS::DataSampleHeader::sequence_, VDBG, and ACE_Time_Value::zero.
Referenced by make_reservation(), request_ack_received(), and resend_association_msgs().
void OpenDDS::DCPS::ShmemDataLink::signal_semaphore | ( | ) |
Definition at line 271 of file ShmemDataLink.cpp.
References OPENDDS_TEST_AND_CALL, and transport().
Referenced by OpenDDS::DCPS::ShmemReceiveStrategy::receive_bytes().
|
protectedvirtual |
This announces the "stop" event to our subclass. The "stop" event will occur when this DataLink is handling a release_reservations() call and determines that it has just released all of the remaining reservations on this DataLink. The "stop" event will also occur when the TransportImpl is being shutdown() - we call stop_i() from our transport_shutdown() method to handle this case.
Reimplemented from OpenDDS::DCPS::DataLink.
Definition at line 223 of file ShmemDataLink.cpp.
References ACE_GUARD, assoc_resends_, assoc_resends_mutex_, assoc_resends_task_, peer_alloc_, peer_alloc_mutex_, and ACE_Malloc_T< class, ACE_LOCK, ACE_CB >::release().
Referenced by open().
void OpenDDS::DCPS::ShmemDataLink::stop_resend_association_msgs | ( | const GUID_t & | local, |
const GUID_t & | remote | ||
) |
Definition at line 176 of file ShmemDataLink.cpp.
References ACE_GUARD, assoc_resends_, assoc_resends_mutex_, LM_DEBUG, and VDBG.
Referenced by request_ack_received().
RcHandle< ShmemTransport > OpenDDS::DCPS::ShmemDataLink::transport | ( | void | ) | const |
Definition at line 242 of file ShmemDataLink.cpp.
References OpenDDS::DCPS::dynamic_rchandle_cast(), and OpenDDS::DCPS::DataLink::impl().
Referenced by config(), local_address(), local_allocator(), and signal_semaphore().
|
private |
Definition at line 97 of file ShmemDataLink.h.
Referenced by make_reservation(), resend_association_msgs(), stop_i(), and stop_resend_association_msgs().
|
private |
Definition at line 95 of file ShmemDataLink.h.
Referenced by make_reservation(), resend_association_msgs(), stop_i(), and stop_resend_association_msgs().
|
private |
Definition at line 99 of file ShmemDataLink.h.
|
private |
Definition at line 90 of file ShmemDataLink.h.
Referenced by open(), peer_address(), and peer_pid().
|
private |
Definition at line 91 of file ShmemDataLink.h.
Referenced by open(), peer_allocator(), and stop_i().
|
private |
Definition at line 92 of file ShmemDataLink.h.
Referenced by peer_allocator(), and stop_i().
|
private |
Definition at line 93 of file ShmemDataLink.h.
Referenced by open().
|
protected |
Definition at line 82 of file ShmemDataLink.h.
Referenced by open(), and request_ack_received().
|
protected |
Definition at line 81 of file ShmemDataLink.h.
Referenced by open(), and send_association_msg().