Base Module  VST 3.6.5
SDK for developing VST Plug-in
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions | Protected Member Functions | Protected Attributes
TContainer< T > Class Template Referenceabstract

Template container base class (abstract). More...

#include <tcontainer.h>

+ Inheritance diagram for TContainer< T >:

Public Member Functions

 TContainer ()
 
 TContainer (const TContainer< T > &)
 
virtual ~TContainer ()
 
bool operator== (const TContainer< T > &) const
 
bool operator!= (const TContainer< T > &) const
 
virtual TContainer< T > * newInstance () const =0
 Create a copy of this container. More...
 
T & operator[] (int32) const
 "[]" indexing operator returns the item at the specified index. More...
 
virtual int32 total () const
 Return number of items. More...
 
virtual bool isEmpty () const
 Is container empty? More...
 
virtual int32 size () const
 Returns the container size. More...
 
virtual bool add (const T &item)=0
 Add item to container. More...
 
virtual bool remove (const T &item)=0
 Remove equal item. More...
 
virtual bool remove (const TIterator< T > &)=0
 Remove item at current iterator position. More...
 
virtual bool removeAt (int32 index)=0
 Remove item at given index. More...
 
virtual void removeAll ()=0
 Remove all items from list. More...
 
virtual T & at (int32 index) const
 Get item at index. More...
 
virtual T & lookup (const T &item) const
 Searches for the item equal to the specified item in the list and returns the first occurrence. More...
 
virtual bool contains (const T &item) const
 See if container has equal item. More...
 
virtual int32 occurrences (const T &item) const
 Count occurrences of equal items. More...
 
virtual TIterator< T > * newIterator () const =0
 Create container iterator instance. More...
 
TContainer< T > * lookupAll (const T &item) const
 Allocate and returns a container with all items in this container equal to the specified item. More...
 
bool addAllFrom (const TContainer< T > &container)
 Adds all the items from the specified container to this container. More...
 
bool addNewFrom (const TContainer< T > &container)
 Adds the items from the specified container to this container that are not in this container already. More...
 
T & error () const
 Access error object. More...
 

Protected Member Functions

void copy (const TContainer< T > &container)
 Internal copy method. Copies the contents of the specified container into this container. More...
 

Protected Attributes

errorObject
 Object used as return value when methods returning a T& fail. More...
 
int32 _size
 Container size. More...
 

Detailed Description

template<class T>
class Steinberg::TContainer< T >

Template container base class (abstract).

This class defines the basic interface for any container implementation in this module.
Please note that:

See also
TIterator, TArray, TLinkedList, TDLinkedList

Constructor & Destructor Documentation

TContainer ( )
inline
TContainer ( const TContainer< T > &  )
~TContainer ( )
virtual

Member Function Documentation

bool operator== ( const TContainer< T > &  other) const
bool operator!= ( const TContainer< T > &  other) const
virtual TContainer<T>* newInstance ( ) const
pure virtual
T & operator[] ( int32  idx) const
inline

"[]" indexing operator returns the item at the specified index.

int32 total ( ) const
virtual
bool isEmpty ( ) const
virtual
int32 size ( ) const
virtual

Returns the container size.

The size of a container can be larger than the number of items it contains. For example the TArray implementation returns the number of items that fit into the allocated memory and not the number of actually inserted items

virtual bool add ( const T &  item)
pure virtual
virtual bool remove ( const T &  item)
pure virtual
virtual bool remove ( const TIterator< T > &  )
pure virtual
virtual bool removeAt ( int32  index)
pure virtual
virtual void removeAll ( )
pure virtual
T & at ( int32  index) const
virtual
T & lookup ( const T &  item) const
virtual
bool contains ( const T &  item) const
virtual
int32 occurrences ( const T &  item) const
virtual
virtual TIterator<T>* newIterator ( ) const
pure virtual
TContainer< T > * lookupAll ( const T &  item) const

Allocate and returns a container with all items in this container equal to the specified item.

bool addAllFrom ( const TContainer< T > &  container)

Adds all the items from the specified container to this container.

bool addNewFrom ( const TContainer< T > &  container)

Adds the items from the specified container to this container that are not in this container already.

T& error ( ) const
inline

Access error object.

void copy ( const TContainer< T > &  container)
protected

Internal copy method. Copies the contents of the specified container into this container.

Field Documentation

T errorObject
protected

Object used as return value when methods returning a T& fail.

int32 _size
protected

Container size.

Empty

Copyright ©2015 Steinberg Media Technologies GmbH. All Rights Reserved.