VISR  0.11.1
Versatile Interactive Scene Renderer
visr::objectmodel::ObjectVector Class Reference

#include <object_vector.hpp>

Inheritance diagram for visr::objectmodel::ObjectVector:
visr::pml::ObjectVector

Classes

class  const_iterator
 
class  iterator
 

Public Member Functions

 ObjectVector ()
 
 ObjectVector (ObjectVector const &rhs)
 
 ObjectVector (ObjectVector &&rhs)
 
ObjectVectoroperator= (ObjectVector const &rhs)
 
ObjectVectoroperator= (ObjectVector &&rhs)
 
 ~ObjectVector ()
 
void assign (ObjectVector const &rhs)
 
void swap (ObjectVector &rhs)
 
std::size_t size () const
 
bool empty () const
 
Objectat (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
 

Detailed Description

A class representing a set of audio objects of potentially different types.

Constructor & Destructor Documentation

visr::objectmodel::ObjectVector::ObjectVector ( )
default

Default constructor, creates an empty object vector

visr::objectmodel::ObjectVector::ObjectVector ( ObjectVector const &  rhs)
explicit

Copy constructor. Made explicit to prevent unintentially copying

visr::objectmodel::ObjectVector::ObjectVector ( ObjectVector &&  rhs)
default

Explicitly defined move constructor.

visr::objectmodel::ObjectVector::~ObjectVector ( )
default

Destructor.

Member Function Documentation

void visr::objectmodel::ObjectVector::assign ( ObjectVector const &  rhs)

Assign member function as an explicit alternative to an assignment operator.

Object & visr::objectmodel::ObjectVector::at ( ObjectId  id)

Return a reference to an audio object in the vector.

Parameters
idThe object id of the object to retrieved
Exceptions
std::invalid_argumentIf no object with the given id exists in the vector.
Object const & visr::objectmodel::ObjectVector::at ( ObjectId  id) const

Return a reference to an audio object in the vector (constant version)

Parameters
idThe object id of the object to retrieved
Exceptions
std::invalid_argumentIf no object with the given id exists in the vector.
iterator visr::objectmodel::ObjectVector::begin ( )
inline
const_iterator visr::objectmodel::ObjectVector::begin ( ) const
inline

Iterator begin/end for const objects.

Note
For range-based for loops over constant object vectors, cbegin/cend are not sufficient.
const_iterator visr::objectmodel::ObjectVector::cbegin ( ) const
inline
const_iterator visr::objectmodel::ObjectVector::cend ( ) const
inline
void visr::objectmodel::ObjectVector::clear ( )

Erase all contained elements.

bool visr::objectmodel::ObjectVector::empty ( ) const
inline

Return whether the object vector is empty.

iterator visr::objectmodel::ObjectVector::end ( )
inline
const_iterator visr::objectmodel::ObjectVector::end ( ) const
inline
const_iterator visr::objectmodel::ObjectVector::find ( ObjectId  id) const
inline
iterator visr::objectmodel::ObjectVector::find ( ObjectId  id)
inline

Return a non-const iterator to the element with key id

Note
In the object dereferenced by 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.

Parameters
objThe 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.

Parameters
objThe object to be inserted (copied).
ObjectVector & visr::objectmodel::ObjectVector::operator= ( ObjectVector const &  rhs)
default

Explicit definition of default assignment operator.

ObjectVector & visr::objectmodel::ObjectVector::operator= ( ObjectVector &&  rhs)
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.

Parameters
idThe id of the object to be deleted.
Exceptions
std::invalid_argumentif no object with the given id exists.
std::size_t visr::objectmodel::ObjectVector::size ( ) const
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


The documentation for this class was generated from the following files: