OpenDDS
Snapshot(2023/04/28-20:55)
dds
DCPS
transport
rtps_udp
TransactionalRtpsSendQueue.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_TRANSPORT_RTPS_UDP_TRANSACTIONALRTPSSENDQUEUE_H
7
#define OPENDDS_DCPS_TRANSPORT_RTPS_UDP_TRANSACTIONALRTPSSENDQUEUE_H
8
9
#include "
Rtps_Udp_Export.h
"
10
#include "
dds/Versioned_Namespace.h
"
11
12
#include "
MetaSubmessage.h
"
13
14
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
15
16
namespace
OpenDDS
{
17
namespace
DCPS {
18
19
/**
20
* A Transactional Send Queue Class For MetaSubmessages
21
*
22
* This class is designed to collect submessages from various threads
23
* in a transactional way so they can be more efficiently bundled.
24
*/
25
class
OpenDDS_Rtps_Udp_Export
TransactionalRtpsSendQueue
{
26
public
:
27
TransactionalRtpsSendQueue
();
28
29
/// Add a single submessage to the queue
30
/// Returns true if the queue was empty.
31
bool
enqueue(
const
MetaSubmessage
& ms);
32
33
/// Add a vector of submessages to the queue
34
/// Returns true if the queue was empty and now not empty.
35
bool
enqueue(
const
MetaSubmessageVec& vec);
36
37
/// Signal that a thread is beginning to send a sequence of submessages.
38
void
begin_transaction();
39
40
/// Indicate that the queue is ready to send after all pending transactions are complete.
41
void
ready_to_send();
42
43
/// Signal that a thread is ending a sequence of submessages.
44
/// This method will swap the provided vec with the pending queue if the queue is ready to send.
45
void
end_transaction(MetaSubmessageVec& vec);
46
47
/// Mark all queued submessage with the given source and destination as ignored.
48
void
ignore(
const
GUID_t
& local,
const
GUID_t
& remote);
49
50
/// Mark all queued submessage with the given destination (dst_guid_) as ignored.
51
void
ignore_remote(
const
GUID_t
&
id
);
52
53
/// Mark all queued submessage with the given source (src_guid_) as ignored.
54
void
ignore_local(
const
GUID_t
&
id
);
55
56
private
:
57
58
mutable
ACE_Thread_Mutex
mutex_
;
59
60
MetaSubmessageVec
queue_
;
61
bool
ready_to_send_
;
62
size_t
active_transaction_count_
;
63
};
64
65
}
// namespace DCPS
66
}
// namespace OpenDDS
67
68
OPENDDS_END_VERSIONED_NAMESPACE_DECL
69
70
#endif
/* OPENDDS_DCPS_TRANSPORT_RTPS_UDP_TRANSACTIONALRTPSSENDQUEUE_H */
Versioned_Namespace.h
OpenDDS::DCPS::TransactionalRtpsSendQueue::active_transaction_count_
size_t active_transaction_count_
Definition:
TransactionalRtpsSendQueue.h:62
OpenDDS::DCPS::TransactionalRtpsSendQueue::mutex_
ACE_Thread_Mutex mutex_
Definition:
TransactionalRtpsSendQueue.h:58
ACE_Thread_Mutex
OpenDDS::DCPS::TransactionalRtpsSendQueue
Definition:
TransactionalRtpsSendQueue.h:25
OpenDDS::DCPS::GUID_t
Definition:
DdsDcpsGuid.idl:57
OpenDDS::DCPS::TransactionalRtpsSendQueue::ready_to_send_
bool ready_to_send_
Definition:
TransactionalRtpsSendQueue.h:61
OpenDDS::DCPS::TransactionalRtpsSendQueue::queue_
MetaSubmessageVec queue_
Definition:
TransactionalRtpsSendQueue.h:60
OpenDDS::DCPS::MetaSubmessage
Definition:
MetaSubmessage.h:18
Rtps_Udp_Export.h
OPENDDS_END_VERSIONED_NAMESPACE_DECL
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
Definition:
Versioned_Namespace.h:48
OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
Definition:
Hash.cpp:17
OpenDDS
The Internal API and Implementation of OpenDDS.
Definition:
AddressCache.h:28
MetaSubmessage.h
OpenDDS_Rtps_Udp_Export
#define OpenDDS_Rtps_Udp_Export
Definition:
Rtps_Udp_Export.h:25
Generated by
1.8.13