Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
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. | |
DequeBase & | operator= (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... | |
Template Class encapsulating a deque object and acting as a base deque class for other classes in the library to inherit from.
iterator iMS::DequeBase< T >::begin | ( | ) |
const_iterator iMS::DequeBase< T >::begin | ( | ) | const |
const_iterator iMS::DequeBase< T >::cbegin | ( | ) | const |
const_iterator iMS::DequeBase< T >::cend | ( | ) | const |
void iMS::DequeBase< T >::clear | ( | ) |
clears the contents
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.
const_iterator iMS::DequeBase< T >::end | ( | ) | const |
const std::array<std::uint8_t, 16> iMS::DequeBase< T >::GetUUID | ( | ) | const |
Returns a vector representing the Unique Identifier assigned to the DequeBase object.
iterator iMS::DequeBase< T >::insert | ( | iterator | pos, |
const T & | value | ||
) |
Inserts a single new element into the DequeBase.
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.
std::string iMS::DequeBase< T >::ModifiedTimeFormat | ( | ) | const |
Returns Human-readable string for the time at which the Container was last modified.
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.
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.
[in] | rhs | A Deque object to perform the comparison with |
T& iMS::DequeBase< T >::operator[] | ( | int | idx | ) |
Random Write Access to an element in the Deque.
[in] | idx | Integer offset into the image with respect to the first element in the sequence (DequeBase::begin()) |
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.
[in] | idx | Integer offset into the image with respect to the first element in the sequence (DequeBase::cbegin()) |