Isomet Modular Synthesiser (iMS) API  v1.4.2
iMS API
Public Member Functions | List of all members
iMS::DequeBase< T > Class Template Reference

Template Class encapsulating a deque object and acting as a base deque class for other classes in the library to inherit from. More...

#include <include/Containers.h>

Public Member Functions

void clear ()
 clears the contents More...
 
iterator insert (iterator pos, const T &value)
 Inserts a single new element into the DequeBase. More...
 
iterator insert (const_iterator pos, size_t count, const T &value)
 Inserts multiple copies of an element into the DequeBase.
 
iterator insert (iterator pos, const_iterator first, const_iterator last)
 Inserts a range of elements into the DequeBase.
 
void push_back (const T &value)
 Appends the given element value to the end of the container.
 
void pop_back ()
 Removes the last element of the container.
 
void push_front (const T &value)
 Prepends the given element value to the beginning of the container.
 
void pop_front ()
 Removes the first element of the container.
 
iterator erase (iterator pos)
 Removes the element at pos.
 
iterator erase (iterator first, iterator last)
 Removes the elements in the range [first; last].
 
std::size_t size () const
 Returns the number of elements in the container.
 
Constructors & Destructor
 DequeBase (const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Create a default empty List with optional name.
 
 ~DequeBase ()
 Destructor.
 
 DequeBase (size_t, const T &, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Fill Constructor.
 
 DequeBase (const_iterator first, const_iterator last, const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr))
 Range Constructor.
 
 DequeBase (const DequeBase &)
 Copy Constructor.
 
DequeBaseoperator= (const DequeBase &)
 Assignment Constructor.
 
Element Access
T & operator[] (int idx)
 Random Write Access to an element in the Deque. More...
 
const T & operator[] (int idx) const
 Random Access to an element in the Deque. More...
 
DequeBase Unique Identifier
bool operator== (DequeBase const &rhs) const
 Equality Operator checks Deque object UUID's for equivalence. More...
 
const std::array< std::uint8_t, 16 > GetUUID () const
 Returns a vector representing the Unique Identifier assigned to the DequeBase object. More...
 
Timestamping
const std::time_t & ModifiedTime () const
 Returns Time at which the Container was last modified. More...
 
std::string ModifiedTimeFormat () const
 Returns Human-readable string for the time at which the Container was last modified. More...
 
Container Description
const std::string & Name () const
 A string stored with the Container to aid human users in identifying its purpose. More...
 
std::string & Name ()
 

Iterator Specification

Use these iterators when you want to iteratively read through or update the entries stored within a DequeBase. Iterators can be used to access elements at an arbitrary offset position relative to the element they point to.

Two types of iterators are supported; both are random access iterators. Dereferencing const_iterator yields a reference to a constant entry in the DequeBase(const DequeBase&).

typedef std::deque< T >::iterator iterator
 Iterator defined for user manipulation of DequeBase.
 
typedef std::deque< T >::const_iterator const_iterator
 Const Iterator defined for user readback of DequeBase.
 
iterator begin ()
 Returns an iterator pointing to the first element in the DequeBase container. More...
 
iterator end ()
 Returns an iterator referring to the past-the-end element in the DequeBase container. More...
 
const_iterator begin () const
 Returns a const_iterator pointing to the first element in the DequeBase container. More...
 
const_iterator end () const
 Returns a const_iterator referring to the past-the-end element in the DequeBase container. More...
 
const_iterator cbegin () const
 Returns a const_iterator pointing to the first element in the DequeBase container. More...
 
const_iterator cend () const
 Returns a const_iterator referring to the past-the-end element in the DequeBase container. More...
 

Detailed Description

template<typename T>
class iMS::DequeBase< T >

Template Class encapsulating a deque object and acting as a base deque class for other classes in the library to inherit from.

Date
2016-11-09
Since
1.3

Member Function Documentation

template<typename T>
iterator iMS::DequeBase< T >::begin ( )

Returns an iterator pointing to the first element in the DequeBase container.

Returns
An iterator to the beginning of the DequeBase container.
template<typename T>
const_iterator iMS::DequeBase< T >::begin ( ) const

Returns a const_iterator pointing to the first element in the DequeBase container.

Returns
A DequeBase to the beginning of the DequeBase container.
Since
1.2.5
template<typename T>
const_iterator iMS::DequeBase< T >::cbegin ( ) const

Returns a const_iterator pointing to the first element in the DequeBase container.

Returns
A const_iterator to the beginning of the DequeBase container.
template<typename T>
const_iterator iMS::DequeBase< T >::cend ( ) const

Returns a const_iterator referring to the past-the-end element in the DequeBase container.

Returns
A const_iterator to the element past the end of the DequeBase.
template<typename T>
void iMS::DequeBase< T >::clear ( )

clears the contents

Since
1.3
template<typename T>
iterator iMS::DequeBase< T >::end ( )

Returns an iterator referring to the past-the-end element in the DequeBase container.

The past-the-end element is the theoretical element that would follow the last element in the DequeBase container. It does not point to any element, and thus shall not be dereferenced.

Because the ranges used by functions of the standard library do not include the element pointed by their closing iterator, this function can be used in combination with DequeBase::begin to specify a range including all the elements in the container.

Returns
An iterator to the element past the end of the DequeBase
template<typename T>
const_iterator iMS::DequeBase< T >::end ( ) const

Returns a const_iterator referring to the past-the-end element in the DequeBase container.

Returns
A const_iterator to the element past the end of the DequeBase.
Since
1.2.5
template<typename T>
const std::array<std::uint8_t, 16> iMS::DequeBase< T >::GetUUID ( ) const

Returns a vector representing the Unique Identifier assigned to the DequeBase object.

Returns
UUID as an array of uint8_t's
template<typename T>
iterator iMS::DequeBase< T >::insert ( iterator  pos,
const T &  value 
)

Inserts a single new element into the DequeBase.

Since
1.3
template<typename T>
const std::time_t& iMS::DequeBase< T >::ModifiedTime ( ) const

Returns Time at which the Container was last modified.

Any time the container is modified (added to, deleted from, elements updated), the system time is recorded. This happens coincident with the UUID if the container also being updated. This function returns to the user that timestamp.

Returns
a reference to a std::time_t representing the time at which the container was last modified
Since
1.3
template<typename T>
std::string iMS::DequeBase< T >::ModifiedTimeFormat ( ) const

Returns Human-readable string for the time at which the Container was last modified.

Since
1.3
template<typename T>
const std::string& iMS::DequeBase< T >::Name ( ) const

A string stored with the Container to aid human users in identifying its purpose.

Updating the Container Name does not cause the Container UUID to change.

template<typename T>
bool iMS::DequeBase< T >::operator== ( DequeBase< T > const &  rhs) const

Equality Operator checks Deque object UUID's for equivalence.

Each Deque object created in software has its own UUID (Universally Unique ID) assigned. In order to confirm whether two deque objects are identical, their UUIDs are compared. Deque objects can also be compared with Deques residing on iMS Controller hardware, since the UUID of a deque is stored in memory on the hardware.

Parameters
[in]rhsA Deque object to perform the comparison with
Returns
True if the supplied Deque is identical to this one.
Since
1.0.1
template<typename T>
T& iMS::DequeBase< T >::operator[] ( int  idx)

Random Write Access to an element in the Deque.

Parameters
[in]idxInteger offset into the image with respect to the first element in the sequence (DequeBase::begin())
Returns
A reference to an element.
Since
1.3
template<typename T>
const T& iMS::DequeBase< T >::operator[] ( int  idx) const

Random Access to an element in the Deque.

The fastest and preferred method for reading back elements from a Dequeis to use const_iterator to retrieve elements in sequence. In some circumstances however this is not suitable, and so the array subscript operator is defined to permit applications to access an ImagePoint at any arbitrary position for readback.

Parameters
[in]idxInteger offset into the image with respect to the first element in the sequence (DequeBase::cbegin())
Returns
A const reference to an element.
Since
1.0

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