User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Misc - CollectionBodyC<class DataT>
 

  PUBLIC
CollectionBodyC::CollectionBodyC(SizeT)
CollectionBodyC::CollectionBodyC(const SArray1dC &)
CollectionBodyC::Copy(void) const
CollectionBodyC::Insert(const DataT &)
CollectionBodyC::InsertRandom(const DataT &)
CollectionBodyC::Pick(void)
CollectionBodyC::Shuffle(void) const
CollectionBodyC::ShuffleIP(void)
CollectionBodyC::Merge(const CollectionC &)
CollectionBodyC::Merge(const SArray1dC &)
CollectionBodyC::IsEmpty(void) const
CollectionBodyC::Empty(void)
CollectionBodyC::Size(void) const
CollectionBodyC::Array(void)
CollectionBodyC::Array(void) const
CollectionBodyC::Split(SizeT)
CollectionBodyC::Sample(SizeT) const
CollectionBodyC::operator [](IndexC)
CollectionBodyC::operator [](IndexC) const
RCBodyC::References(void) const
RCBodyC::Copy(void) const
RCBodyC::DeepCopy(UIntT) const
RCBodyC::IncRefCounter(void)
RCBodyC::DecRefCounter(void)

   CollectionBodyC<class DataT>   
 
Collection of data.
 
include "Ravl/Collection.hh"
User Level:Develop
Library:RavlCore
In Scope:RavlN

Parent Classes: Variables:
Methods:
CollectionBodyC(SizeT maxSize = 10)
Create an empty collection.
maxSize should be set to maximum number of elements the collection will contain.

CollectionBodyC(const SArray1dC<DataT> & dat)
Create a collection from an array of data.

CollectionC<DataT> Copy() const
Create a copy of this collection.

UIntT Insert(const DataT & dat)
Add a data item to the collection.
NB. This may cause the storage array to be reallocated which will invalidate any iterators held on the collection.

The index at which the item was placed is returned.


UIntT InsertRandom(const DataT & dat)
Add a data item to the collection in a random place.
NB. This may cause the storage array to be reallocated which will invalidate any iterators held on the collection.

The index at which the item was placed is returned.


DataT Pick()
Pick a random item from the collection.
the element will be removed from the set. It is the users responsiblity to ensure the set is not empty when this method is called. See 'IsEmpty()'

CollectionC<DataT> Shuffle() const
Create a shuffled version of this collection.

void ShuffleIP()
Shuffle collection in place.

void Merge(const CollectionC<DataT> & x)
Merge collection 'x' into this one.

void Merge(const SArray1dC<DataT> & x)
Merge of array 'x' into this collection.

bool IsEmpty() const
Test if collection is empty.

void Empty()
Empty the collection of all its contents.

SizeT Size() const
Returns the number of data elements in the collection.

SArray1dC<DataT> Array()
Access data as array.
Note: The returned array is a direct access to the internal data structure, no operations that modify the collection should be performed while its in use.

const SArray1dC<DataT> Array() const
Access data as array.
Note: The returned array is a direct access to the internal data structure, no operations that modify the collection should be performed while its in use.

CollectionC<DataT> Split(SizeT ne)
Split the collection in two
return a random set of 'ne' elements from this one.

CollectionC<DataT> Sample(SizeT ne) const
Take a random sample from the collection.
This collection is not modified. NOTE: Items may be taken more than once.

DataT & operator [](IndexC ind)
Array style access.

const DataT & operator [](IndexC ind) const
Array style access.

#include "Ravl/RefCounter.hh"
UIntT References() const
Access count of handles open to this object.

RCBodyC & Copy() const
Make copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

RCBodyC & DeepCopy(UIntT levels = ((UIntT))) const
Make a deep copy of body.
This should be provided in derived classes. this funtion will issue an assertion failure if called.

void IncRefCounter()
Increment reference counter.

bool DecRefCounter()
Decrement reference counter.


Maintainer:Charles Galambos, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002