RTI Connext Modern C++ API
Version 5.3.1
|
<<value-type>> A bounded sequence of elements More...
#include <rti/core/BoundedSequence.hpp>
Public Types | |
typedef std::vector< T > | vector_type |
The type of the underlying vector. | |
typedef vector_type::value_type | value_type |
The type of the elements, T . | |
typedef vector_type::allocator_type | allocator_type |
The allocator type of the underlying vector. | |
typedef vector_type::size_type | size_type |
The size type. | |
typedef vector_type::difference_type | difference_type |
The difference type. | |
typedef vector_type::reference | reference |
The reference type. | |
typedef vector_type::const_reference | const_reference |
The const reference type. | |
typedef vector_type::pointer | pointer |
The pointer type. | |
typedef vector_type::const_pointer | const_pointer |
The const pointer type. | |
typedef vector_type::iterator | iterator |
The iterator type. | |
typedef vector_type::const_iterator | const_iterator |
The const iterator type. | |
typedef vector_type::reverse_iterator | reverse_iterator |
The reverse iterator type. | |
typedef vector_type::const_reverse_iterator | const_reverse_iterator |
The const reverse iterator type. | |
Public Member Functions | |
bounded_sequence () | |
Creates an empty bounded_sequence. | |
bounded_sequence (const bounded_sequence &other) | |
Copy constructor. | |
template<size_t M> | |
bounded_sequence (const bounded_sequence< T, M > &other) | |
Copies a bounded sequence with a different bound M . | |
bounded_sequence (size_type count) | |
Create a bounded_sequence with a number of default-construced elements. | |
bounded_sequence (size_type count, const value_type &value) | |
Create a bounded_sequence with a number of elements. | |
template<typename InputIt > | |
bounded_sequence (InputIt first, InputIt last) | |
Create a bounded_sequence from a range of elements. | |
bounded_sequence (const std::vector< T > &v) | |
Create a bounded_sequence copying the elements of a std::vector. | |
bounded_sequence (bounded_sequence &&other) OMG_NOEXCEPT | |
<<C++11>> Move constructor | |
bounded_sequence (std::vector< T > &&v) | |
<<C++11>> Creates a bounded_sequence by moving a std::vector | |
bounded_sequence & | operator= (const bounded_sequence &other) |
Assignment operator. | |
template<typename U , size_t M> | |
bounded_sequence & | operator= (const bounded_sequence< U, M > &other) |
Copies the elements of a sequence with a different bound. | |
bounded_sequence & | operator= (const std::vector< T > &v) |
Copies the elements of a std::vector. | |
bounded_sequence & | operator= (bounded_sequence &&other) OMG_NOEXCEPT |
<<C++11>> Move-assignment operator | |
bounded_sequence & | operator= (std::vector< T > &&v) |
<<C++11>> Moves a std::vector into this bounded_sequence | |
reference | operator[] (size_type pos) |
Index access. | |
const_reference | operator[] (size_type pos) const |
Index access. | |
reference | at (size_type pos) |
Index access with bounds check. | |
const_reference | at (size_type pos) const |
Index access with bounds check. | |
reference | front () |
Returns a reference to the first element. | |
const_reference | front () const |
Returns a const reference to the first element. | |
reference | back () |
Returns a reference to the last element. | |
const_reference | back () const |
Returns a const reference to the last element. | |
pointer | data () |
Returns a pointer to the underlying data buffer. | |
const_pointer | data () const |
Returns a pointer to the underlying data buffer. | |
iterator | begin () OMG_NOEXCEPT |
Returns an iterator to the first element. | |
const_iterator | begin () const OMG_NOEXCEPT |
Returns an const iterator to the first element. | |
const_iterator | cbegin () const OMG_NOEXCEPT |
Returns an const iterator to the first element. | |
iterator | end () OMG_NOEXCEPT |
Returns an iterator to one past the last element. | |
const_iterator | end () const OMG_NOEXCEPT |
Returns an const iterator to one past the last element. | |
const_iterator | cend () const OMG_NOEXCEPT |
Returns a const iterator to one past the last element. | |
reverse_iterator | rbegin () OMG_NOEXCEPT |
Returns an iterator to the reverse-beginning of the sequence. | |
const_reverse_iterator | rbegin () const OMG_NOEXCEPT |
Returns a const iterator to the reverse-beginning of the sequence. | |
const_reverse_iterator | crbegin () const OMG_NOEXCEPT |
Returns a const iterator to the reverse-beginning of the sequence. | |
reverse_iterator | rend () OMG_NOEXCEPT |
Returns an iterator to the reverse-end of the sequence. | |
const_reverse_iterator | crend () const OMG_NOEXCEPT |
Returns a const iterator to the reverse-end of the sequence. | |
bool | empty () const OMG_NOEXCEPT |
Returns whether there are no elements. | |
size_type | size () const OMG_NOEXCEPT |
Returns the number of elements. | |
size_type | max_size () const OMG_NOEXCEPT |
Returns MaxLength . | |
void | reserve (size_type new_capacity) |
Pre-allocates elements up to new_capacity. | |
size_type | capacity () const OMG_NOEXCEPT |
Returns the current capacity. | |
void | clear () OMG_NOEXCEPT |
Removes the elements. | |
void | shrink_to_fit () |
Destroys any extra elements reserved above the current size. | |
iterator | insert (iterator pos, const T &value) |
Inserts a new element in a position specified by an iterator. | |
iterator | erase (iterator pos) |
Erases an element specified by an iterator. | |
void | push_back (const T &value) |
Adds a new element at the end. | |
void | push_back (T &&value) |
Adds a new element at the end by moving it. | |
void | pop_back () |
Removes the last element. | |
void | resize (size_type count) |
Resizes the container to contain count elements. | |
void | resize (size_type count, const T &value) |
Resizes the container to contain count elements. | |
void | swap (bounded_sequence &other) OMG_NOEXCEPT |
Swap the contents of two sequences. | |
<<value-type>> A bounded sequence of elements
T | The element type |
MaxLength | The maximum number of elements |
IDL bounded sequences map to this type, as described in Working with IDL types.
This type has a interface similar to std::vector, but it differs in two aspects:
MaxLength
, in its operations. Operations that would make the sequence grow beyond the limit throw dds::core::PreconditionNotMetError
.typedef std::vector<T> rti::core::bounded_sequence< T, MaxLength >::vector_type |
The type of the underlying vector.
typedef vector_type::value_type rti::core::bounded_sequence< T, MaxLength >::value_type |
The type of the elements, T
.
typedef vector_type::allocator_type rti::core::bounded_sequence< T, MaxLength >::allocator_type |
The allocator type of the underlying vector.
typedef vector_type::size_type rti::core::bounded_sequence< T, MaxLength >::size_type |
The size type.
typedef vector_type::difference_type rti::core::bounded_sequence< T, MaxLength >::difference_type |
The difference type.
typedef vector_type::reference rti::core::bounded_sequence< T, MaxLength >::reference |
The reference type.
typedef vector_type::const_reference rti::core::bounded_sequence< T, MaxLength >::const_reference |
The const reference type.
typedef vector_type::pointer rti::core::bounded_sequence< T, MaxLength >::pointer |
The pointer type.
typedef vector_type::const_pointer rti::core::bounded_sequence< T, MaxLength >::const_pointer |
The const pointer type.
typedef vector_type::iterator rti::core::bounded_sequence< T, MaxLength >::iterator |
The iterator type.
typedef vector_type::const_iterator rti::core::bounded_sequence< T, MaxLength >::const_iterator |
The const iterator type.
typedef vector_type::reverse_iterator rti::core::bounded_sequence< T, MaxLength >::reverse_iterator |
The reverse iterator type.
typedef vector_type::const_reverse_iterator rti::core::bounded_sequence< T, MaxLength >::const_reverse_iterator |
The const reverse iterator type.
|
inline |
Creates an empty bounded_sequence.
|
inline |
Copy constructor.
|
inlineexplicit |
Copies a bounded sequence with a different bound M
.
dds::core::PreconditionNotMetError | if other.size() > MaxLength |
|
inline |
Create a bounded_sequence with a number of default-construced elements.
|
inline |
Create a bounded_sequence with a number of elements.
|
inline |
Create a bounded_sequence from a range of elements.
|
inline |
Create a bounded_sequence copying the elements of a std::vector.
dds::core::PreconditionNotMetError | if v.size() > MaxLength |
|
inline |
<<C++11>> Move constructor
|
inline |
<<C++11>> Creates a bounded_sequence by moving a std::vector
|
inline |
Assignment operator.
|
inline |
Copies the elements of a sequence with a different bound.
dds::core::PreconditionNotMetError | if other.size() > MaxLength |
|
inline |
Copies the elements of a std::vector.
|
inline |
<<C++11>> Move-assignment operator
|
inline |
<<C++11>> Moves a std::vector into this bounded_sequence
|
inline |
Index access.
|
inline |
Index access.
|
inline |
Index access with bounds check.
std::out_of_range | if pos is >= size() |
|
inline |
Index access with bounds check.
std::out_of_range | if pos is >= size() |
|
inline |
Returns a reference to the first element.
|
inline |
Returns a const reference to the first element.
|
inline |
Returns a reference to the last element.
|
inline |
Returns a const reference to the last element.
|
inline |
Returns a pointer to the underlying data buffer.
|
inline |
Returns a pointer to the underlying data buffer.
|
inline |
Returns an iterator to the first element.
|
inline |
Returns an const iterator to the first element.
|
inline |
Returns an const iterator to the first element.
|
inline |
Returns an iterator to one past the last element.
|
inline |
Returns an const iterator to one past the last element.
|
inline |
Returns a const iterator to one past the last element.
|
inline |
Returns an iterator to the reverse-beginning of the sequence.
|
inline |
Returns a const iterator to the reverse-beginning of the sequence.
|
inline |
Returns a const iterator to the reverse-beginning of the sequence.
|
inline |
Returns an iterator to the reverse-end of the sequence.
|
inline |
Returns a const iterator to the reverse-end of the sequence.
|
inline |
Returns whether there are no elements.
|
inline |
Returns the number of elements.
|
inline |
Returns MaxLength
.
|
inline |
Pre-allocates elements up to new_capacity.
This operation reserves space for new_capacity
elements and, unlike std::vector, it also default-constructs the extra elements. The size() remains the same.
|
inline |
Returns the current capacity.
|
inline |
Removes the elements.
This operation resizes the sequence to 0, but it doesn't destroy the elements, like std::vector would.
To destroy the elements, follow with a call to shrink_to_fit.
|
inline |
Destroys any extra elements reserved above the current size.
Note that resize() or clear() alone won't destroy the extra elements when they reduce the size of a sequence.
For example
|
inline |
Inserts a new element in a position specified by an iterator.
dds::core::PreconditionNotMetError | if size() == MaxLength |
|
inline |
Erases an element specified by an iterator.
|
inline |
Adds a new element at the end.
dds::core::PreconditionNotMetError | if size() == MaxLength |
|
inline |
Adds a new element at the end by moving it.
dds::core::PreconditionNotMetError | if size() == MaxLength |
|
inline |
Removes the last element.
The element removed is not destroyed. To destroy it, follow pop_back with a call to shrink_to_fit.
|
inline |
Resizes the container to contain count elements.
If count < size(), the sequence is reduced to the first count elements, but elements are not destroyed.
If count > size(), the sequence is expanded as follows: if capacity() >= count, new elements are not constructed, since they already had been. If capacity() < count, the extra elements are default-constructed.
dds::core::PreconditionNotMetError | if count > MaxLength |
|
inline |
Resizes the container to contain count elements.
This overload specifies the value.
|
inline |
Swap the contents of two sequences.