![]() |
VISR
0.11.1
Versatile Interactive Scene Renderer
|
#include <object_vector.hpp>
Classes | |
class | const_iterator |
class | iterator |
Public Member Functions | |
ObjectVector () | |
ObjectVector (ObjectVector const &rhs) | |
ObjectVector (ObjectVector &&rhs) | |
ObjectVector & | operator= (ObjectVector const &rhs) |
ObjectVector & | operator= (ObjectVector &&rhs) |
~ObjectVector () | |
void | assign (ObjectVector const &rhs) |
void | swap (ObjectVector &rhs) |
std::size_t | size () const |
bool | empty () const |
Object & | at (ObjectId id) |
Object const & | at (ObjectId id) const |
iterator | begin () |
iterator | end () |
const_iterator | cbegin () const |
const_iterator | cend () const |
const_iterator | find (ObjectId id) const |
iterator | find (ObjectId id) |
void | insert (Object const &obj) |
void | insert (std::unique_ptr< Object > &&obj) |
void | remove (ObjectId id) |
void | clear () |
const_iterator | begin () const |
const_iterator | end () const |
A class representing a set of audio objects of potentially different types.
|
default |
Default constructor, creates an empty object vector
|
explicit |
Copy constructor. Made explicit to prevent unintentially copying
|
default |
Explicitly defined move constructor.
|
default |
Destructor.
void visr::objectmodel::ObjectVector::assign | ( | ObjectVector const & | rhs | ) |
Assign member function as an explicit alternative to an assignment operator.
Return a reference to an audio object in the vector.
id | The object id of the object to retrieved |
std::invalid_argument | If no object with the given id exists in the vector. |
Return a reference to an audio object in the vector (constant version)
id | The object id of the object to retrieved |
std::invalid_argument | If no object with the given id exists in the vector. |
|
inline |
|
inline |
Iterator begin/end for const objects.
|
inline |
|
inline |
void visr::objectmodel::ObjectVector::clear | ( | ) |
Erase all contained elements.
|
inline |
Return whether the object vector is empty.
|
inline |
|
inline |
|
inline |
Return a non-const iterator to the element with key id
return value
->second, the id must not be changed, as it would destroy the integrity between the id in the key value and the id of the contained object. void visr::objectmodel::ObjectVector::insert | ( | Object const & | obj | ) |
Add a new audio object to the vector, possibly replacing an existing one with the same id. The object is copied, and the ObjectVector takes ownership of the copy.
obj | The object to be inserted (copied). |
void visr::objectmodel::ObjectVector::insert | ( | std::unique_ptr< Object > && | obj | ) |
Add a new audio object to the vector, possibly replacing an existing one with the same id, move constructor flavour. The object is copied, and the ObjectVector takes ownership of the copy.
obj | The object to be inserted (copied). |
|
default |
Explicit definition of default assignment operator.
|
default |
Explicit definition of move assignment operator.
void visr::objectmodel::ObjectVector::remove | ( | ObjectId | id | ) |
Erase an object with a given object id from the vector.
id | The id of the object to be deleted. |
std::invalid_argument | if no object with the given id exists. |
|
inline |
Return the number of contained audio objects.
void visr::objectmodel::ObjectVector::swap | ( | ObjectVector & | rhs | ) |
Exchange the contents of this object with rhs
. Invalidates all iterators into this and rhs