SVector Class Template Reference
[Utility Classes and Functions]

#include <support/Vector.h>

Inheritance diagram for SVector:

SAbstractVector List of all members.

Detailed Description

template<class TYPE>
class SVector< TYPE >

Templatized vector (array) container class.

Conceptually similar to an STL vector<>, however designed to hide its implementation to reduce code bloat and enable binary compatibility.

Editing particular items in the vector require explicitly calling EditItemAt(), so that we can support copy-on-write semantics in the future.

Note:
This class is designed to not use exceptions, so error handling semantics -- such as out of memory -- are different than container classes in the STL.


Public Types

typedef TYPE value_type

Public Member Functions

ssize_t AddArray (const TYPE *array, size_t count)
ssize_t AddArrayAt (const TYPE *array, size_t count, size_t index)
ssize_t AddItem (const TYPE &item)
ssize_t AddItem ()
ssize_t AddItemAt (const TYPE &item, size_t index)
ssize_t AddItemAt (size_t index)
ssize_t AddVector (const SVector< TYPE > &o)
ssize_t AddVectorAt (const SVector< TYPE > &o, size_t index)
const TYPE * Array () const
SValue AsValue () const
size_t Capacity () const
size_t CountItems () const
TYPE * EditArray ()
TYPE & EditItemAt (size_t i)
TYPE & EditTop ()
const TYPE & ItemAt (size_t i) const
void MakeEmpty ()
status_t MoveItems (size_t newIndex, size_t oldIndex, size_t count=1)
SVector< TYPE > & operator= (const SVector< TYPE > &o)
const TYPE & operator[] (size_t i) const
void Pop ()
void Push (const TYPE &item)
void Push ()
void RemoveItemsAt (size_t index, size_t count=1)
ssize_t ReplaceItemAt (const TYPE &item, size_t index)
void SetCapacity (size_t total_space)
void SetExtraCapacity (size_t extra_space)
status_t SetFromValue (const SValue &value)
status_t SetSize (size_t total_count, const TYPE &protoElement)
status_t SetSize (size_t total_count)
 SVector (const SVector< TYPE > &o)
 SVector ()
void Swap (SVector< TYPE > &o)
const TYPE & Top () const
virtual ~SVector ()

Static Public Member Functions

static void MoveAfter (SVector< TYPE > &to, SVector< TYPE > &from, size_t count)
static void MoveBefore (SVector< TYPE > &to, SVector< TYPE > &from, size_t count)

Protected Member Functions

SAbstractVectorAbstractVector ()
virtual void PerformAssign (void *to, const void *from, size_t count) const
virtual SValue PerformAsValue (const void *from, size_t count) const
virtual void PerformConstruct (void *base, size_t count) const
virtual void PerformCopy (void *to, const void *from, size_t count) const
virtual void PerformDestroy (void *base, size_t count) const
virtual void PerformMoveAfter (void *to, void *from, size_t count) const
virtual void PerformMoveBefore (void *to, void *from, size_t count) const
virtual void PerformReplicate (void *to, const void *protoElement, size_t count) const
virtual status_t PerformSetFromValue (void *to, const SValue &value, size_t count)


Member Typedef Documentation

typedef TYPE value_type
 


Constructor & Destructor Documentation

SVector  )  [inline]
 

SVector const SVector< TYPE > &  o  )  [inline]
 

~SVector  )  [inline, virtual]
 


Member Function Documentation

SAbstractVector& AbstractVector  )  [inline, protected]
 

ssize_t AddArray const TYPE *  array,
size_t  count
[inline]
 

ssize_t AddArrayAt const TYPE *  array,
size_t  count,
size_t  index
[inline]
 

ssize_t AddItem const TYPE &  item  )  [inline]
 

ssize_t AddItem  )  [inline]
 

ssize_t AddItemAt const TYPE &  item,
size_t  index
[inline]
 

ssize_t AddItemAt size_t  index  )  [inline]
 

ssize_t AddVector const SVector< TYPE > &  o  )  [inline]
 

ssize_t AddVectorAt const SVector< TYPE > &  o,
size_t  index
[inline]
 

const TYPE * Array  )  const [inline]
 

Reimplemented from SAbstractVector.

SValue AsValue  )  const [inline]
 

Reimplemented from SAbstractVector.

size_t Capacity  )  const [inline]
 

Reimplemented from SAbstractVector.

size_t CountItems  )  const [inline]
 

Reimplemented from SAbstractVector.

TYPE * EditArray  )  [inline]
 

Reimplemented from SAbstractVector.

TYPE & EditItemAt size_t  i  )  [inline]
 

TYPE & EditTop  )  [inline]
 

const TYPE & ItemAt size_t  i  )  const [inline]
 

void MakeEmpty  )  [inline]
 

Reimplemented from SAbstractVector.

static void MoveAfter SVector< TYPE > &  to,
SVector< TYPE > &  from,
size_t  count
[static]
 

static void MoveBefore SVector< TYPE > &  to,
SVector< TYPE > &  from,
size_t  count
[static]
 

status_t MoveItems size_t  newIndex,
size_t  oldIndex,
size_t  count = 1
[inline]
 

Reimplemented from SAbstractVector.

SVector< TYPE > & operator= const SVector< TYPE > &  o  )  [inline]
 

const TYPE & operator[] size_t  i  )  const [inline]
 

void PerformAssign void *  to,
const void *  from,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

SValue PerformAsValue const void *  from,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformConstruct void *  base,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformCopy void *  to,
const void *  from,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformDestroy void *  base,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformMoveAfter void *  to,
void *  from,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformMoveBefore void *  to,
void *  from,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

void PerformReplicate void *  to,
const void *  protoElement,
size_t  count
const [protected, virtual]
 

Implements SAbstractVector.

status_t PerformSetFromValue void *  to,
const SValue value,
size_t  count
[protected, virtual]
 

Implements SAbstractVector.

void Pop  )  [inline]
 

void Push const TYPE &  item  )  [inline]
 

void Push  )  [inline]
 

void RemoveItemsAt size_t  index,
size_t  count = 1
[inline]
 

Reimplemented from SAbstractVector.

ssize_t ReplaceItemAt const TYPE &  item,
size_t  index
[inline]
 

void SetCapacity size_t  total_space  )  [inline]
 

Reimplemented from SAbstractVector.

void SetExtraCapacity size_t  extra_space  )  [inline]
 

Reimplemented from SAbstractVector.

status_t SetFromValue const SValue value  )  [inline]
 

Reimplemented from SAbstractVector.

status_t SetSize size_t  total_count,
const TYPE &  protoElement
[inline]
 

status_t SetSize size_t  total_count  )  [inline]
 

void Swap SVector< TYPE > &  o  )  [inline]
 

const TYPE & Top  )  const [inline]
 


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