OpenDDS  Snapshot(2023/04/28-20:55)
AssociationRecord.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 #ifndef OPENDDS_DCPS_RTPS_ASSOCIATION_RECORD_H
6 #define OPENDDS_DCPS_RTPS_ASSOCIATION_RECORD_H
7 
10 
11 #ifndef ACE_LACKS_PRAGMA_ONCE
12 # pragma once
13 #endif
14 
16 
17 namespace OpenDDS {
18 namespace RTPS {
19 
20 const int AC_EMPTY = 0;
21 const int AC_REMOTE_RELIABLE = 1 << 0;
22 const int AC_REMOTE_DURABLE = 1 << 1;
24 const int AC_SEND_LOCAL_TOKEN = 1 << 3;
25 const int AC_LOCAL_TOKENS_SENT = 1 << 4;
26 
28 public:
30  const DCPS::GUID_t& remote_id,
31  int flags)
32  : transport_client_(transport_client)
33  , remote_id_(remote_id)
34  , flags_(flags)
35  {}
36 
37  const DCPS::GUID_t local_id() const
38  {
39  return transport_client_->get_guid();
40  }
41 
42  const DCPS::GUID_t& remote_id() const
43  {
44  // FUTURE: Remove this and just store the entity id.
45  return remote_id_;
46  }
47 
48  bool remote_reliable() const
49  {
50  return flags_ & AC_REMOTE_RELIABLE;
51  }
52 
53  bool remote_durable() const
54  {
55  return flags_ & AC_REMOTE_DURABLE;
56  }
57 
59  {
61  }
62 
63  bool send_local_token() const
64  {
65  return flags_ & AC_SEND_LOCAL_TOKEN;
66  }
67 
68  void local_tokens_sent(bool flag)
69  {
70  if (flag) {
72  } else {
73  flags_ &= ~AC_LOCAL_TOKENS_SENT;
74  }
75  }
76 
77  bool local_tokens_sent() const
78  {
80  }
81 
83 
84 private:
86  int flags_;
87 };
88 
90 public:
92  const DCPS::GUID_t& writer_id,
93  const DCPS::ReaderAssociation& reader_association)
94  : callbacks_(callbacks)
95  , writer_id_(writer_id)
96  , reader_association_(reader_association)
97  {}
98 
99  const DCPS::GUID_t& writer_id() const { return writer_id_; }
100  const DCPS::GUID_t& reader_id() const { return reader_association_.readerId; }
101 
105 };
107 
109 public:
111  const DCPS::GUID_t& reader_id,
112  const DCPS::WriterAssociation& writer_association)
113  : callbacks_(callbacks)
114  , reader_id_(reader_id)
115  , writer_association_(writer_association)
116  {}
117 
118  const DCPS::GUID_t& reader_id() const { return reader_id_; }
119  const DCPS::GUID_t& writer_id() const { return writer_association_.writerId; }
120 
124 };
126 
127 }
128 }
129 
131 
132 #endif // OPENDDS_DCPS_RTPS_ASSOCIATION_RECORD_H
const int AC_EMPTY
const DCPS::ReaderAssociation reader_association_
BuiltinAssociationRecord(DCPS::TransportClient_rch transport_client, const DCPS::GUID_t &remote_id, int flags)
const DCPS::WriterAssociation writer_association_
const int AC_GENERATE_REMOTE_MATCHED_CRYPTO_HANDLE
const int AC_REMOTE_DURABLE
const int AC_REMOTE_RELIABLE
const DCPS::GUID_t & writer_id() const
ReaderAssociationRecord(DCPS::DataReaderCallbacks_wrch callbacks, const DCPS::GUID_t &reader_id, const DCPS::WriterAssociation &writer_association)
const DCPS::GUID_t & remote_id() const
const int AC_SEND_LOCAL_TOKEN
const DCPS::DataReaderCallbacks_wrch callbacks_
const DCPS::TransportClient_rch transport_client_
DCPS::RcHandle< WriterAssociationRecord > WriterAssociationRecord_rch
const DCPS::GUID_t & reader_id() const
DCPS::RcHandle< ReaderAssociationRecord > ReaderAssociationRecord_rch
const DCPS::DataWriterCallbacks_wrch callbacks_
WriterAssociationRecord(DCPS::DataWriterCallbacks_wrch callbacks, const DCPS::GUID_t &writer_id, const DCPS::ReaderAssociation &reader_association)
const int AC_LOCAL_TOKENS_SENT
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
const DCPS::GUID_t & reader_id() const
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
const DCPS::GUID_t & writer_id() const