Public Member Functions |
| vector () |
| Creates an empty vector.
|
|
| vector (size_type initial_size) |
| Creates a vector with a number of default-constructed elements.
|
|
| vector (size_type initial_size, const T &value) |
| Creates a vector with a number of copies of a value.
|
|
| vector (const vector &other) |
| Creates a copy.
|
|
| vector (const std::vector< T > &other) |
| Implicit construction from std::vector.
|
|
| vector (vector &&other) OMG_NOEXCEPT |
| Creates a vector by moving an existing one.
|
|
| operator std::vector< T > () const |
| Provides a conversion to std::vector.
|
|
size_type | size () const |
| Get the current size.
|
|
size_type | capacity () const |
| Get the current capacity.
|
|
void | resize (size_type new_size) |
| Set the size to new_size.
|
|
void | resize (size_type new_size, const T &value) |
| Set the size to new_size, copying value if new elements are added.
|
|
void | clear () |
| Resize to zero.
|
|
void | reserve (size_type new_capacity) |
| Reserve a new capacity without creating any elements or changing the size.
|
|
reference | at (size_type i) |
| Get an element by reference and check bounds.
|
|
const_reference | at (size_type i) const |
| Get an element by const-reference and check bounds.
|
|
reference | operator[] (size_type i) |
| Get an element by reference.
|
|
const_reference | operator[] (size_type i) const |
| Get an element by const-reference.
|
|
vector & | operator= (const vector &other) |
| Assign another vector to this one.
|
|
vector & | operator= (vector &&other) OMG_NOEXCEPT |
| Move-assign another vector to this one.
|
|
bool | operator== (const vector &other) const |
| Returns if the elements of two vectors are equal.
|
|
bool | operator!= (const vector &other) const |
| Returns if two vectors are different.
|
|
iterator | begin () |
| Iterator to the first element.
|
|
const_iterator | begin () const |
| Const iterator to first element.
|
|
iterator | end () |
| Iterator to last element plus one.
|
|
const_iterator | end () const |
| Const iterator to last element plus one.
|
|
template<typename T>
class dds::core::vector< T >
<<value-type>> A vector convertible to std::vector and with similar functionality
In many cases, for performance reasons and other implementation requirements, the RTI Connext API uses dds::core::vector instead of std::vector. The most significant case is the C++ types that rtiddsgen generates from IDL.
A dds::core::vector provides a subset of the functionality of a std::vector
, including iterators, resizing and indexed access. It also provides automatic conversion to and from std::vector, making code like the following possible:
public:
};
dds::vector<int32_t> my_std_vector = sample.my_ints();
sample.my_ints() = my_std_vector;