UCommon
Public Member Functions
ucommon::vectorof< T > Class Template Reference

A templated vector for a list of a specific Object subtype. More...

#include <vector.h>

Inheritance diagram for ucommon::vectorof< T >:
Inheritance graph
[legend]
Collaboration diagram for ucommon::vectorof< T >:
Collaboration graph
[legend]

Public Member Functions

const T & at (int index)
 
T * begin (void)
 Get the first typed object pointer contained in the vector. More...
 
T * end (void)
 Get the last typed object pointer contained in the vector. More...
 
T * operator() (vectorsize_t position)
 Retrieve a typed member of the vector directly. More...
 
Vectoroperator+ (Vector &vector)
 Concatenate typed vector in an expression. More...
 
T & operator[] (int index)
 
 vectorof ()
 Create an empty vector for specified type.
 
 vectorof (vectorsize_t size)
 Create an empty vector of allocated size for specified type. More...
 
- Public Member Functions inherited from ucommon::Vector
void add (ObjectProtocol **list)
 Add (append) a NULL terminated list of objects to the vector. More...
 
void add (ObjectProtocol *pointer)
 Add (append) a single object pointer to the vector. More...
 
void add (Vector &vector)
 Add (append) an existing vector to our vector. More...
 
ObjectProtocolbegin (void) const
 Get the first object pointer contained in the vector. More...
 
void clear (void)
 De-reference and remove all pointers from the vector.
 
ObjectProtocolend (void) const
 Get the last object pointer contained in the vector. More...
 
vectorsize_t find (ObjectProtocol *pointer, vectorsize_t offset=0) const
 Find the first instance of a specific pointer in the vector. More...
 
ObjectProtocolget (int index) const
 Get an object pointer from a specified member of the vector. More...
 
vectorsize_t get (void **mem, vectorsize_t max) const
 Copy the vector to an external pointer array. More...
 
vectorsize_t len (void) const
 Get the size of the vector (number of active members). More...
 
void operator() (vectorsize_t position, ObjectProtocol *pointer)
 Assign a member of the vector directly. More...
 
ObjectProtocoloperator() (vectorsize_t position)
 Retrieve a member of the vector directly. More...
 
void operator() (ObjectProtocol *pointer)
 Append a member to the vector directly. More...
 
Vectoroperator+ (Vector &vector)
 Concatenate into our existing vector from assignment list. More...
 
void operator++ ()
 Drop first member of vector.
 
void operator+= (Vector &vector)
 Append into our existing vector from another vector. More...
 
void operator+= (vectorsize_t count)
 Drop first specified members from the vector. More...
 
void operator-- ()
 Drop last member of the vector.
 
void operator-= (vectorsize_t count)
 Drop last specified members from the vector. More...
 
void operator= (Vector &vector)
 Assign (copy) into our existing vector from another vector. More...
 
ObjectProtocoloperator[] (int index)
 Return a pointer from the vector by array reference. More...
 
Vectoroperator^ (Vector &vector)
 Release vector and concat vector from another vector. More...
 
void operator^= (Vector &vector)
 Release our existing vector and duplicate from another vector. More...
 
virtual bool resize (vectorsize_t size)
 Re-size & re-allocate the total (allocated) size of the vector. More...
 
void rsplit (vectorsize_t position)
 Split the vector after a specified offset. More...
 
void set (vectorsize_t position, ObjectProtocol *pointer)
 Set a member of the vector to an object. More...
 
void set (ObjectProtocol **list)
 Set the vector to a list of objects terminated by a NULL pointer. More...
 
void set (Vector &vector)
 Set (duplicate) an existing vector into our vector. More...
 
vectorsize_t size (void) const
 Get the effective allocation space used by the vector. More...
 
void split (vectorsize_t position)
 Split the vector at a specified offset. More...
 
 Vector ()
 Create an initially empty vector.
 
 Vector (vectorsize_t size)
 Create a vector of size object pointers. More...
 
 Vector (ObjectProtocol **items, vectorsize_t size=0)
 Create a vector of size objects from existing object pointers. More...
 
virtual ~Vector ()
 Destroy the current reference counted vector of object pointers.
 

Additional Inherited Members

- Static Public Member Functions inherited from ucommon::Vector
static vectorsize_t size (void **list)
 Compute the effective vector size of a list of object pointers. More...
 
- Static Public Attributes inherited from ucommon::Vector
static const vectorsize_t npos
 npos is a constant for an "invalid" position value.
 
- Protected Member Functions inherited from ucommon::Vector
virtual void cow (vectorsize_t adj=0)
 
array * create (vectorsize_t size) const
 
virtual ObjectProtocolinvalid (void) const
 Object handler for index outside vector range. More...
 
ObjectProtocol ** list (void) const
 
virtual void release (void)
 
- Protected Attributes inherited from ucommon::Vector
array * data
 

Detailed Description

template<class T>
class ucommon::vectorof< T >

A templated vector for a list of a specific Object subtype.

The templated type must be derived from Object.

Author
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 433 of file vector.h.

Constructor & Destructor Documentation

template<class T >
ucommon::vectorof< T >::vectorof ( vectorsize_t  size)
inline

Create an empty vector of allocated size for specified type.

Parameters
sizeof vector to allocate.

Definition at line 445 of file vector.h.

Member Function Documentation

template<class T >
T* ucommon::vectorof< T >::begin ( void  )
inline

Get the first typed object pointer contained in the vector.

Returns
first typed object pointer.

Definition at line 465 of file vector.h.

template<class T >
T* ucommon::vectorof< T >::end ( void  )
inline

Get the last typed object pointer contained in the vector.

Returns
last typed object pointer.

Definition at line 472 of file vector.h.

template<class T >
T* ucommon::vectorof< T >::operator() ( vectorsize_t  position)
inline

Retrieve a typed member of the vector directly.

Parameters
positionto retrieve object from.
Returns
typed object pointer retrieved from vector.

Definition at line 458 of file vector.h.

template<class T >
Vector& ucommon::vectorof< T >::operator+ ( Vector vector)
inline

Concatenate typed vector in an expression.

Parameters
vectorto concatenate.
Returns
effective object to continue in expression.

Definition at line 480 of file vector.h.


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