Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
Template Class encapsulating a list object and acting as a base list class for other classes in the library to inherit from. More...
#include <include/Containers.h>
Public Member Functions | |
bool | operator== (ListBase const &rhs) const |
Equality Operator checks ListBase object for equivalence. More... | |
Constructors & Destructor | |
ListBase (const std::string &Name="[no name]", const std::time_t &modified_time=std::time(nullptr)) | |
Create a default empty List with optional name parameter. | |
~ListBase () | |
Destructor. | |
ListBase (const ListBase &) | |
Copy Constructor. | |
ListBase & | operator= (const ListBase &) |
Assignment Constructor. | |
ListBase Unique Identifier | |
const std::array< std::uint8_t, 16 > | GetUUID () const |
Returns a vector representing the Unique Identifier assigned to the ListBase 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 () |
Modifiers | |
void | assign (size_t n, const T &val) |
Assign new content to ImageSequence list. More... | |
void | push_front (const T &val) |
Insert ImageSequenceEntry at beginning. More... | |
void | pop_front () |
Delete first ImageSequenceEntry. More... | |
void | push_back (const T &val) |
Add ImageSequenceEntry at end. More... | |
void | pop_back () |
Delete last ImageSequenceEntry. More... | |
iterator | insert (iterator position, const T &val) |
Insert ImageSequenceEntry. More... | |
iterator | insert (iterator position, const_iterator first, const_iterator last) |
Insert Range Of ImageSequenceEntry's. More... | |
iterator | erase (iterator position) |
Erase ImageSequenceEntry. More... | |
iterator | erase (iterator first, iterator last) |
Erase a range of ImageSequenceEntry's. More... | |
void | resize (size_t n) |
Change Size. More... | |
void | clear () |
Clear Content. More... | |
Helper Functions | |
bool | empty () const |
Returns True if the ListBase is empty. More... | |
std::size_t | size () const |
Returns the Number of Entries in the ListBase. More... | |
Iterator Specification | |
Use these iterators when you want to iteratively read through or update the entries stored within a ListBase. 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 ListBase(const ListBase&). | |
typedef std::list< T >::iterator | iterator |
Iterator defined for user manipulation of ListBase. | |
typedef std::list< T >::const_iterator | const_iterator |
Const Iterator defined for user readback of ListBase. | |
iterator | begin () |
Returns an iterator pointing to the first element in the ListBase container. More... | |
iterator | end () |
Returns an iterator referring to the past-the-end element in the ListBase container. More... | |
const_iterator | begin () const |
Returns a const_iterator pointing to the first element in the ListBase container. More... | |
const_iterator | end () const |
Returns a const_iterator referring to the past-the-end element in the ListBase container. More... | |
const_iterator | cbegin () const |
Returns a const_iterator pointing to the first element in the ListBase container. More... | |
const_iterator | cend () const |
Returns a const_iterator referring to the past-the-end element in the ListBase container. More... | |
Template Class encapsulating a list object and acting as a base list class for other classes in the library to inherit from.
void iMS::ListBase< T >::assign | ( | size_t | n, |
const T & | val | ||
) |
Assign new content to ImageSequence list.
Assigns new contents to the ImageSequence list container, replacing its current contents, and modifying its size accordingly. the new contents are n
elements, each initialized to a copy of val
.
[in] | n | New size for the container. |
[in] | val | ImageSequenceEntry to fill the ImageSequence with. Each of the n elements in the container will be initialized to a copy of this value. |
iterator iMS::ListBase< T >::begin | ( | ) |
const_iterator iMS::ListBase< T >::begin | ( | ) | const |
const_iterator iMS::ListBase< T >::cbegin | ( | ) | const |
const_iterator iMS::ListBase< T >::cend | ( | ) | const |
void iMS::ListBase< T >::clear | ( | ) |
Clear Content.
Removes all elements from the list container (which are destroyed), and leaving the ImageSequence with a size of 0.
bool iMS::ListBase< T >::empty | ( | ) | const |
iterator iMS::ListBase< T >::end | ( | ) |
Returns an iterator referring to the past-the-end element in the ListBase container.
The past-the-end element is the theoretical element that would follow the last element in the ListBase 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 ListBase::begin to specify a range including all the elements in the container.
const_iterator iMS::ListBase< T >::end | ( | ) | const |
iterator iMS::ListBase< T >::erase | ( | iterator | position | ) |
Erase ImageSequenceEntry.
Removes a single ImageSequenceEntry element (at position) from the list container
[in] | position | Iterator pointing to a single element to be removed from the list. |
iterator iMS::ListBase< T >::erase | ( | iterator | first, |
iterator | last | ||
) |
Erase a range of ImageSequenceEntry's.
Removes a range of ImageSequenceEntry elements (first,last) from the list container
[in] | first | Iterators within the list to be removed. |
[in] | last | Iterators within the list to be removed. |
const std::array<std::uint8_t, 16> iMS::ListBase< T >::GetUUID | ( | ) | const |
Returns a vector representing the Unique Identifier assigned to the ListBase object.
iterator iMS::ListBase< T >::insert | ( | iterator | position, |
const T & | val | ||
) |
Insert ImageSequenceEntry.
The ImageSequence container is extended by inserting new elements before the element at the specified position. This effectively increases the ImageSequence list size by one.
[in] | position | Position in the container where the new elements are inserted. |
[in] | val | ImageSequenceEntry Value to be copied (or moved) to the inserted elements. |
iterator iMS::ListBase< T >::insert | ( | iterator | position, |
const_iterator | first, | ||
const_iterator | last | ||
) |
Insert Range Of ImageSequenceEntry's.
The ImageSequence container is extended by inserting new elements before the element at the specified position from a range of ImageSequenceEntries present in another ImageSequence. This effectively increases the ImageSequence list size by the number of entries in the range
[in] | position | Position in the container where the new elements are inserted. |
[in] | first | Iterator specifying the first of a range of elements. |
[in] | last | Iterator specifying the last of a range of elements. All the elements between first and last, including the element pointed by first but not the one pointed by last are inserted to the ImageSequence before position. |
const std::time_t& iMS::ListBase< 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::ListBase< T >::ModifiedTimeFormat | ( | ) | const |
Returns Human-readable string for the time at which the Container was last modified.
const std::string& iMS::ListBase< 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::ListBase< T >::operator== | ( | ListBase< T > const & | rhs | ) | const |
void iMS::ListBase< T >::pop_back | ( | ) |
Delete last ImageSequenceEntry.
Removes the last ImageSequenceEntry in the ImageSequence list container, effectively reducing its size by one. This destroys the removed entry.
void iMS::ListBase< T >::pop_front | ( | ) |
Delete first ImageSequenceEntry.
Removes the first ImageSequenceEntry in the ImageSequence list container, effectively reducing its size by one. This destroys the removed entry.
void iMS::ListBase< T >::push_back | ( | const T & | val | ) |
Add ImageSequenceEntry at end.
Adds a new ImageSequenceEntry at the end of the ImageSequence list container, after its current last element. The content of val is copied (or moved) to the new element. This effectively increases the Sequence size by one.
[in] | val | ImageSequenceEntry to be copied (or moved) to the new element. |
void iMS::ListBase< T >::push_front | ( | const T & | val | ) |
Insert ImageSequenceEntry at beginning.
Inserts a new element at the beginning of the list, right before its current first element. The content of val is copied (or moved) to the inserted element. This effectively increases the Sequence size by one.
[in] | val | ImageSequenceEntry to be copied (or moved) to the inserted element. |
void iMS::ListBase< T >::resize | ( | size_t | n | ) |
Change Size.
Resizes the ImageSequence container so that it contains n elements. If n is smaller than the current container size, the content is reduced to its first n elements, removing those beyond (and destroying them). If n is greater than the current container size, the content is expanded by inserting at the end as many elements as needed to reach a size of n. The new ImageSequenceEntry 's are default-initialized. Notice that this function changes the actual content of the container by inserting or erasing elements from it.
[in] | n | New container size, expressed in number of elements. |
std::size_t iMS::ListBase< T >::size | ( | ) | const |