38 for (
size_t i = 0; i < blocks_.size(); ++i) {
39 len += blocks_[i].len();
63 for (
size_t i = 0; i < blocks_.size(); ++i) {
81 for (
size_t i = 0; i < blocks_.size(); ++i) {
83 const unsigned int len =
static_cast<unsigned int>(element.
len());
95 dst.length(static_cast<unsigned int>(
data_length()));
96 unsigned char* out_iter = dst.get_buffer();
97 for (
size_t i = 0; i < blocks_.size(); ++i) {
99 const unsigned int len =
static_cast<unsigned int>(element.
len());
101 std::memcpy(out_iter, data, len);
109 size_t remain = offset;
110 for (
size_t i = 0; i < blocks_.size(); ++i) {
112 const size_t len = element.
len();
114 return element.
rd_ptr()[remain];
122 #define OPENDDS_MOVE_OR_COPY std::move 124 #define OPENDDS_MOVE_OR_COPY std::copy 130 std::inserter(blocks_, blocks_.begin()));
144 std::memcpy(blocks_.back().base(),
data, size);
145 blocks_.back().write(size);
161 const size_t start_offset =
static_cast<size_t>(start_frag) * fsize;
162 const size_t end_offset = end_frag ==
INVALID_FRAGMENT ? std::numeric_limits<size_t>::max() :
static_cast<size_t>(end_frag + 1) * fsize - 1;
164 size_t current_offset = 0;
166 bool default_push =
false;
169 const size_t len = it->len();
171 result.blocks_.push_back(*it);
172 if (end_offset < current_offset + len) {
173 result.blocks_.back().write(end_offset - current_offset - len);
175 }
else if (start_offset < current_offset + len) {
177 result.blocks_.push_back(*it);
178 if (current_offset < start_offset) {
179 result.blocks_.back().read(start_offset - current_offset);
182 current_offset += len;
DataSampleHeader header_
The demarshalled sample header.
SequenceBackInsertIterator< Sequence > back_inserter(Sequence &seq)
void replace(const char *data, size_t size)
Replace all payload bytes with passed-in data Based on the ACE_Message_Block(const char*...
ReceivedDataSample get_fragment_range(FragmentNumber start_frag, FragmentNumber end_frag=INVALID_FRAGMENT)
#define OPENDDS_MOVE_OR_COPY
DDS::OctetSeq copy_data() const
copy the data payload into an OctetSeq
char * rd_ptr(void) const
ACE_Data_Block * duplicate_data() const
bool write_octet_array(const ACE_CDR::Octet *x, ACE_CDR::ULong length)
#define ACE_NEW_MALLOC_RETURN(POINTER, ALLOCATOR, CONSTRUCTOR, RET_VAL)
bool write_data(Serializer &ser) const
write the data payload to the Serializer
Class to serialize and deserialize data for DDS.
Holds a data sample received by the transport.
OPENDDS_VECTOR(MessageBlock) blocks_
SequenceNumber::Value FragmentNumber
static ACE_Allocator * instance(void)
ACE_Data_Block * data_block(void) const
ACE_Message_Block * cont(void) const
unsigned char peek(size_t offset) const
Retreive one byte of data from the payload.
char * wr_ptr(void) const
sequence< octet > OctetSeq
static const FragmentNumber INVALID_FRAGMENT
size_t data_length() const
total length of usable bytes (between rd_ptr and wr_ptr) of all Data Blocks
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ACE_Message_Block * data(ACE_Allocator *mb_alloc=0) const
ACE_UINT32 fragment_size_
Fragment size used by this sample.
void append(ReceivedDataSample &suffix)
Update this ReceivedDataSample's data payload to include the suffix's data payload after any existing...
void prepend(ReceivedDataSample &prefix)
Update this ReceivedDataSample's data payload to include the prefix's data payload before any existin...
The Internal API and Implementation of OpenDDS.
virtual void * malloc(size_type nbytes)=0