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

  PUBLIC
CollectionC::CollectionC(void)
CollectionC::CollectionC(SizeT)
CollectionC::CollectionC(const SArray1dC &)
CollectionC::Copy(void) const
CollectionC::Insert(const DataT &)
CollectionC::InsertRandom(const DataT &)
CollectionC::operator +=(const DataT &)
CollectionC::Pick(void)
CollectionC::Shuffle(void) const
CollectionC::ShuffleIP(void)
CollectionC::Merge(const CollectionC &)
CollectionC::Merge(const SArray1dC &)
CollectionC::IsEmpty(void) const
CollectionC::Empty(void)
CollectionC::Size(void) const
CollectionC::Array(void)
CollectionC::Array(void) const
CollectionC::Split(SizeT)
CollectionC::Sample(SizeT) const
CollectionC::operator [](IndexC)
CollectionC::operator [](IndexC) const
RCHandleC::operator =(const RCHandleC &)
RCHandleC::DeepCopy(UIntT) const
RCHandleC::operator ==(const RCHandleC &) const
RCHandleC::operator !=(const RCHandleC &) const
RCHandleC::Hash(void) const
RCHandleC::IsValid(void) const
RCHandleC::Invalidate(void)
RCHandleC::IsHandleType(const DT &) const
RCHandleC::CheckHandleType(const DT &) const
RCHandleC::References(void) const
RCHandleC::operator <<(ostream &,const RCHandleC &)
RCHandleC::operator >>(istream &,RCHandleC &)

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

Comments:
An unordered collection of data.

Parent Classes: Typedefs:
typedef CollectionIterC<DataT> IteratorT;
Type of iterator.

Methods:
CollectionC()
Default constructor.
creates an invalid handle.

CollectionC(SizeT maxSize)
Creat an empty collection.
maxSize should be set to maximum number of elements the collection will contain.

CollectionC(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.

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.

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

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. ne must be smaller than the size of the collection.

CollectionC<DataT> Sample(SizeT ne) const
Take a random sample from the collection.
This collection is not modified. There is no garantee that an element will be picked only once. 'ne' may be bigger than the size of this collection.

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

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

#include "Ravl/RefCounter.hh"
const RCHandleC<CollectionBodyC<DataT>> & operator =(const RCHandleC<CollectionBodyC<DataT>> & oth)
Assign handle.

RCHandleC<CollectionBodyC<DataT>> DeepCopy(UIntT levels = ((UIntT))) const
Do a deep copy of the object.

bool operator ==(const RCHandleC<CollectionBodyC<DataT>> & oth) const
Are handles to the same object ?

bool operator !=(const RCHandleC<CollectionBodyC<DataT>> & oth) const
Are handles to different objects ?

UIntT Hash() const
Default hash function.
This hashes on the address of the body.

bool IsValid() const
Test if this is a valid handle.

void Invalidate()
Invalidate this handle.
Unattaches the body from the handle.

bool IsHandleType(const DT &) const
Is handle of given type ?

void CheckHandleType(const DT & dummy) const
Check handle type. Throw an expception if not.

UIntT References() const
Find the number of references to the body of this object.

ostream & operator <<(ostream & strm,const RCHandleC<CollectionBodyC<DataT>> & obj)

istream & operator >>(istream & strm,RCHandleC<CollectionBodyC<DataT>> & obj)


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