OpenDDS  Snapshot(2023/04/28-20:55)
InstanceDataSampleList.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_INSTANCEDATASAMPLELIST_H
9 #define OPENDDS_DCPS_INSTANCEDATASAMPLELIST_H
10 
11 #include "Definitions.h"
13 
15 #include "dds/DdsDcpsInfoUtilsC.h"
16 
17 #include <iterator>
18 
20 
21 namespace OpenDDS {
22 namespace DCPS {
23 
24 class DataSampleElement;
25 
26 
27 /**
28 * A list of DataSampleElement pointers to be queued by the order the
29 * samples are written to the instance (within
30 * PRESENTATION.access_scope==INSTANCE). It is mainly used on the
31 * send side to count the depth of instance data and to allow the
32 * removal of elements by instance.
33 * Manages DataSampleElement's next_instance_sample pointer
34 */
36 public:
39 
40  /// Reset to initial state.
41  void reset();
42 
43  ssize_t size() const;
44  DataSampleElement* head() const;
45  DataSampleElement* tail() const;
46 
47  static bool on_some_list(const DataSampleElement* iter);
48  static DataSampleElement* next(const DataSampleElement* iter);
49  static DataSampleElement* prev(const DataSampleElement* iter);
50 
51  void enqueue_tail(const DataSampleElement* element);
52 
53  bool dequeue_head(DataSampleElement*& stale);
54 
55  bool dequeue(const DataSampleElement* stale);
56 
57 protected:
58 
59  /// The first element of the list.
61 
62  /// The last element of the list.
64 
65  /// Number of elements in the list.
67  //TBD size is never negative so should be size_t but this ripples through
68  // the transport code so leave it for now. SHH
69 
70 };
71 
72 
73 } // namespace DCPS
74 } // namespace OpenDDS
75 
76 
78 
79 #if defined(__ACE_INLINE__)
81 #endif /* __ACE_INLINE__ */
82 
83 #endif /* OPENDDS_DCPS_INSTANCEDATASAMPLELIST_H */
DataSampleElement * head_
The first element of the list.
DataSampleElement * tail_
The last element of the list.
#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
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28