OpenDDS  Snapshot(2023/04/28-20:55)
ReceivedDataElementList.inl
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 
9 #include "InstanceState.h"
10 
12 void
14 {
15  // The default action is to simply add to the
16  // tail - in the future we may want to add
17  // to the middle of the list based on sequence
18  // number and/or source timestamp
19 
20  data_sample->previous_data_sample_ = 0;
21  data_sample->next_data_sample_ = 0;
22 
23  ++size_;
24 
25 #ifndef OPENDDS_NO_OBJECT_MODEL_PROFILE
26  if (!data_sample->coherent_change_)
27 #endif
28  {
29  if (data_sample->sample_state_ == DDS::NOT_READ_SAMPLE_STATE) {
31  } else {
33  }
34  }
35 
36  if (!head_) {
37  // First sample in the list.
38  head_ = tail_ = data_sample;
39 
40  } else {
41  // Add to existing list.
42  tail_->next_data_sample_ = data_sample;
43  data_sample->previous_data_sample_ = tail_;
44  tail_ = data_sample;
45  }
46 
47  if (instance_state_) {
48  instance_state_->empty(false);
49  }
50 }
51 
55 {
56  if (!size_) {
57  return 0;
58  }
59 
61  remove(head_);
62  return ptr;
63 }
64 
68 {
69  if (!size_) {
70  return 0;
71  }
72 
74  remove(tail_);
75  return ptr;
76 }
ReceivedDataElement * previous_data_sample_
the previous data sample in the ReceivedDataElementList
bool empty(bool value)
DataReader has become empty. Returns true if the instance was released.
void add(ReceivedDataElement *data_sample)
size_t size_
Number of elements in the list.
ReceivedDataElement * head_
The first element of the list.
ReceivedDataElement * tail_
The last element of the list.
const SampleStateKind NOT_READ_SAMPLE_STATE
#define ACE_INLINE
ReceivedDataElement * next_data_sample_
the next data sample in the ReceivedDataElementList
bool coherent_change_
Sample belongs to an active coherent change set.