Vector of SBAny values, used for representing lists or arrays of values.
More...
#include <SBAny.hpp>
|
|
using | iterator = std::vector<SBAny>::iterator |
|
using | const_iterator = std::vector<SBAny>::const_iterator |
|
|
| SBAnyVector () |
| | Default constructor for SBAnyVector, initializes an empty vector.
|
| | SBAnyVector (const SBAnyVector &init) |
| | Copy constructor for SBAnyVector.
|
| SBAnyVector & | operator= (const SBAnyVector &other) |
| | Assignment operator for SBAnyVector.
|
| template<typename Iterator> |
| | SBAnyVector (Iterator first, Iterator last) |
| | Constructor for SBAnyVector from a range of iterators.
|
| template<typename T> |
| | SBAnyVector (const std::vector< T > &vec) |
| | Constructor for SBAnyVector from a std::vector of arbitrary type T.
|
| | SBAnyVector (std::initializer_list< SBAny > init) |
| | Constructor for SBAnyVector from an initializer list of SBAny values.
|
|
| ~SBAnyVector () |
| | Destructor for SBAnyVector, cleans up any resources used by the vector.
|
| void | reserve (size_t newCapacity) |
| | Reserves space in the vector for a specified number of elements.
|
| size_t | size () const |
| | Gets the number of elements in the vector.
|
| void | emplace_back (const SBAny &value) |
| | Adds a new SBAny value to the end of the vector.
|
| void | push_back (const SBAny &value) |
| | Adds a new SBAny value to the end of the vector.
|
| SBAny & | operator[] (size_t index) |
| | Accesses an element in the vector by index.
|
| const SBAny & | operator[] (size_t index) const |
| | Accesses an element in the vector by index (const version).
|
|
iterator | begin () |
|
iterator | end () |
|
const_iterator | begin () const |
|
const_iterator | end () const |
Vector of SBAny values, used for representing lists or arrays of values.
◆ SBAnyVector() [1/4]
| switchboard::SBAnyVector::SBAnyVector |
( |
const SBAnyVector & | init | ) |
|
◆ SBAnyVector() [2/4]
template<typename Iterator>
| switchboard::SBAnyVector::SBAnyVector |
( |
Iterator | first, |
|
|
Iterator | last ) |
Constructor for SBAnyVector from a range of iterators.
- Parameters
-
| first | The beginning iterator of the range. |
| last | The ending iterator of the range. |
◆ SBAnyVector() [3/4]
template<typename T>
| switchboard::SBAnyVector::SBAnyVector |
( |
const std::vector< T > & | vec | ) |
|
|
inlineexplicit |
Constructor for SBAnyVector from a std::vector of arbitrary type T.
This constructor converts each element of the input vector to an SBAny and stores it in the SBAnyVector.
- Template Parameters
-
| T | The type of elements in the input vector. |
- Parameters
-
| vec | The input std::vector to convert. |
◆ SBAnyVector() [4/4]
| switchboard::SBAnyVector::SBAnyVector |
( |
std::initializer_list< SBAny > | init | ) |
|
|
explicit |
Constructor for SBAnyVector from an initializer list of SBAny values.
- Parameters
-
| init | The initializer list of SBAny values. |
◆ emplace_back()
| void switchboard::SBAnyVector::emplace_back |
( |
const SBAny & | value | ) |
|
Adds a new SBAny value to the end of the vector.
This method constructs the SBAny value in place, avoiding unnecessary copies.
- Parameters
-
| value | The SBAny value to add. |
◆ operator=()
◆ operator[]() [1/2]
| SBAny & switchboard::SBAnyVector::operator[] |
( |
size_t | index | ) |
|
Accesses an element in the vector by index.
- Parameters
-
| index | The index of the element to access. |
- Returns
- Reference to the SBAny element at the specified index.
◆ operator[]() [2/2]
| const SBAny & switchboard::SBAnyVector::operator[] |
( |
size_t | index | ) |
const |
Accesses an element in the vector by index (const version).
- Parameters
-
| index | The index of the element to access. |
- Returns
- Const reference to the SBAny element at the specified index.
◆ push_back()
| void switchboard::SBAnyVector::push_back |
( |
const SBAny & | value | ) |
|
Adds a new SBAny value to the end of the vector.
This method is similar to emplace_back, but may involve an additional copy operation.
- Parameters
-
| value | The SBAny value to add. |
◆ reserve()
| void switchboard::SBAnyVector::reserve |
( |
size_t | newCapacity | ) |
|
Reserves space in the vector for a specified number of elements.
- Parameters
-
| newCapacity | The number of elements to reserve space for. |
◆ size()
| size_t switchboard::SBAnyVector::size |
( |
| ) |
const |
|
nodiscard |
Gets the number of elements in the vector.
- Returns
- The size of the vector.
The documentation for this class was generated from the following file: