RTI Connext .Net APIs
Version 5.0.0
|
A sequence implementation used internally by the middleware to efficiently manage memory during DDS::TypedDataReader::read and DDS::TypedDataReader::take operations. More...
#include <managed_sequence.h>
Public Member Functions | |
virtual E | get_at (System::Int32 i) overridesealed |
Get the i-th element for a const sequence. | |
virtual System::Boolean | copy_from_no_alloc (Sequence< E >^src) overridesealed |
Copy elements from another sequence, only if the destination sequence has enough capacity. | |
virtual void | unloan () overridesealed |
Return the loaned buffer in the sequence and set the maximum to 0. | |
Public Member Functions inherited from DDS::Sequence< E > | |
System::Boolean | ensure_length (System::Int32 length, System::Int32 max) |
Set the sequence to the desired length, and resize the sequence if necessary. | |
virtual void | set_at (System::Int32 i, Eval) |
Set the i-th element of the sequence. | |
void | loan (array< E >^buffer, System::Int32 new_length) |
Loan a contiguous buffer to this sequence. | |
void | from_array (array< E >^arr) |
Copy elements from an array of elements, resizing the sequence if necessary. The original contents of the sequence (if any) are replaced. | |
void | to_array (array< E >^arr) |
Copy elements to an array of elements. The original contents of the array (if any) are replaced. | |
System::Boolean | copy_from (Sequence< E >^src_seq) |
Copy elements from another sequence, resizing the sequence if necessary. | |
Additional Inherited Members | |
Properties inherited from DDS::Sequence< E > | |
System::Int32 | length [get, set] |
The logical length of this sequence. | |
virtual System::Int32 | maximum [get, set] |
The current maximum number of elements that can be stored in this sequence. | |
array< E >^ | buffer [get] |
Return the contiguous buffer of the sequence. | |
System::Boolean | has_ownership [get] |
Return the value of the owned flag. | |
A sequence implementation used internally by the middleware to efficiently manage memory during DDS::TypedDataReader::read and DDS::TypedDataReader::take operations.
Applications are not expected to use this type directly.
|
overridesealedvirtual |
Get the i-th
element for a const
sequence.
i | index of element to access, must be >= 0 and less than DDS::Sequence::length |
i-th
element Reimplemented from DDS::Sequence< E >.
|
overridesealedvirtual |
Copy elements from another sequence, only if the destination sequence has enough capacity.
Fill the elements in this sequence by copying the corresponding elements in src_seq
. The original contents in this sequence are replaced via the element assignment operation (Foo_copy() function). By default, elements are discarded; 'delete' is not invoked on the discarded elements.
src_seq | <<in>> the sequence from which to copy |
Reimplemented from DDS::Sequence< E >.
|
overridesealedvirtual |
Return the loaned buffer in the sequence and set the maximum to 0.
This method affects only the state of this sequence; it does not change the contents of the buffer in any way.
Only the user who originally loaned a buffer should return that loan, as the user may have dependencies on that memory known only to them. Unloaning someone else's buffer may cause unspecified problems. For example, suppose a sequence is loaning memory from a custom memory pool. A user of the sequence likely has no way to release the memory back into the pool, so unloaning the sequence buffer would result in a resource leak. If the user were to then re-loan a different buffer, the original creator of the sequence would have no way to discover, when freeing the sequence, that the loan no longer referred to its own memory and would thus not free the user's memory properly, exacerbating the situation and leading to undefined behavior.
Reimplemented from DDS::Sequence< E >.