OpenDDS  Snapshot(2023/04/28-20:55)
WriterDataSampleList.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Distributed under the OpenDDS License.
5  * See: http://www.opendds.org/license.html
6  */
7 
8 #ifndef OPENDDS_DCPS_WRITERDATASAMPLELIST_H
9 #define OPENDDS_DCPS_WRITERDATASAMPLELIST_H
10 
11 #include "dcps_export.h"
12 
13 #include <cstring>
14 
16 
17 namespace OpenDDS {
18 namespace DCPS {
19 
20 class DataSampleElement;
21 
22 /**
23 * A list of DataSampleElement pointers to be queued by the order the
24 * samples are written to the DataWriter (within PRESENTATION.access_scope==TOPIC).
25 * Cache the number of elements in the list so that list traversal is
26 * not required to find this information.
27 * Manages DataSampleElement's previous_writer_sample/next_writer_sample pointers
28 */
30 public:
31 
32  /// Default constructor clears the list.
35 
36  /// Reset to initial state.
37  void reset();
38 
39  ssize_t size() const;
40  DataSampleElement* head() const;
41  DataSampleElement* tail() const;
42 
43  void enqueue_tail(const DataSampleElement* element);
44 
45  bool dequeue_head(DataSampleElement*& stale);
46 
47  bool dequeue(const DataSampleElement* stale);
48 
49 protected:
50 
51  /// The first element of the list.
53 
54  /// The last element of the list.
56 
57  /// Number of elements in the list.
59  //TBD size is never negative so should be size_t but this ripples through
60  // the transport code so leave it for now. SHH
61 };
62 
63 
64 } // namespace DCPS
65 } // namespace OpenDDS
66 
68 
69 #if defined(__ACE_INLINE__)
70 #include "WriterDataSampleList.inl"
71 #endif /* __ACE_INLINE__ */
72 
73 #endif /* OPENDDS_DCPS_WRITERDATASAMPLELIST_H */
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
ssize_t size_
Number of elements in the list.
int ssize_t
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
DataSampleElement * head_
The first element of the list.
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
DataSampleElement * tail_
The last element of the list.