User Documentation
RAVL, Recognition And Vision Library
DEVELOP HOME PAGE CLASS LIST CONTENTS
Ravl - Core - Hash Tables - RCHashC<class Key,class Dat>
 

  PUBLIC
RCHashC::RCHashC(const RCHashC &)
RCHashC::RCHashC(bool)
RCHashC::RCHashC(const RCWrapC> &)
RCHashC::RCHashC(istream &)
RCHashC::operator [](const Key &)
RCHashC::operator [](const Key &) const
RCHashC::Del(const Key &)
RCHashC::IsElm(const Key &) const
RCHashC::Move(RCHashC &)
RCHashC::IsEmpty(void) const
RCHashC::Empty(void)
RCHashC::Insert(const Key &,const Dat &)
RCHashC::Size(void) const
RCHashC::Lookup(const Key &)
RCHashC::Lookup(const Key &) const
RCHashC::Lookup(const Key &,Dat &) const
RCHashC::Update(const Key &,const Dat &)
RCHashC::Update(const Key &)
RCHashC::Access(const Key &,const Dat &)
RCHashC::AddFrom(RCHashC &,bool)
RCWrapC::Copy(void) const
RCWrapC::Data(void)
RCWrapC::Data(void) const
RCWrapC::operator DataT &(void)
RCWrapC::operator const DataT &(void) const
RCWrapAbstractC::DataType(void) const
RCHandleVC::Save(ostream &) const
RCHandleVC::Save(BinOStreamC &) const
RCHandleVC::Abstract(void)
RCHandleVC::operator >>(istream &,RCHandleVC &)
RCHandleVC::operator >>(BinIStreamC &,RCHandleVC &)
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 &)

   RCHashC<class Key,class Dat>   
 
Reference counted auto-resizing hash table.
 
include "Ravl/RCHash.hh"
Created:06/05/1998 
User Level:Normal
Library:RavlCore
Example:WordFreq.cc
In Scope:RavlN

Comments:
This is a BIG OBJECT. See HashC for more details.

NB. This class requires the standard stream operators to be implemented. ie. operator<<(ostream &os,xxx) etc...

Parent Classes: Methods:
RCHashC(const RCHashC<Key,Dat> & oth)
Copy constructor.

RCHashC(bool makeBod = true)
Default constructor.
Will make a body by default.

RCHashC(const RCWrapC<HashC<Key,Dat>> & base)
Base constructor.

RCHashC(istream & in)
Stream constructor.

Dat & operator [](const Key & a)
Accesss an element.
Will create an empty element with the default constructor and return a reference to it, if it doesn't already exist.

const Dat & operator [](const Key & a) const
Accesss an element.
Will create an empty element with the default constructor and return a reference to it, if it doesn't already exist.

bool Del(const Key & aKey)
Delete member from table.
Returns true if Key was in hash table.

bool IsElm(const Key & aKey) const
Is key used in the table.

void Move(RCHashC<Key,Dat> & oth)
Move contents of another table into this one.
leave other empty.

bool IsEmpty(void) const
Is table empty ?

void Empty(void)
Empty table

bool Insert(const Key & aKey,const Dat & data)
Insert Data with Key.
Returns: True=Member existed already. False=New one was added.

UIntT Size() const
Get number of elements in table.

Dat * Lookup(const Key & aKey)
Look to see if data is present in the table.
Do not use, Try Lookup(key,data); If data is present return a ptr to it, othersize return a 0 ptr.

const Dat * Lookup(const Key & aKey) const
Look to see if data is present in the table.
Do not use, Try Lookup(key,data); If data is present return a ptr to it, othersize return a 0 ptr.

bool Lookup(const Key & aKey,Dat & data) const
Lookup data for key.
Returns true if entry is found, and is assigned to 'data'.

bool Update(const Key & key,const Dat & data)
Update member of HashCable, will create new one if it doesn't exist.
OBSOLETE: Use Insert(key,data) Returns: True=Member existed already. False=New one was added.

Dat & Update(const Key & key)
Get value, add default if its not there. Return reference anyway.
OBSOLETE: Use operator[].

Dat & Access(const Key & key,const Dat & def = Dat ())
Access key, if it does exists create a new bin with value 'def'
Retuns a reference to the new entry.

void AddFrom(RCHashC<Key,Dat> & oth,bool replace = true)
Add contents of another table into this one.
leave other empty. if replace is false the contents of the old table are not replace by the new entries.

#include "Ravl/RCWrap.hh"
RCWrapC<HashC<Key,Dat>> Copy() const
Make a copy of this handle.
NB. This assumes the wrapped object is SMALL, and so just using the copy constructor is sufficent.

HashC<Key,Dat> & Data()
Access data.

const HashC<Key,Dat> & Data() const
Access data.

operator HashC<Key,Dat> &()
Default conversion to data type.

operator const HashC<Key,Dat> &() const
Default conversion to data type.

const type_info & DataType() const
Get type of wrapped object.

#include "Ravl/RCHandleV.hh"
bool Save(ostream & out) const
Save to stream 'out'.

bool Save(BinOStreamC & out) const
Save to binary stream 'out'.

RCAbstractC Abstract()
Create an abstract handle.

istream & operator >>(istream & strm,RCHandleVC<RCWrapBaseBodyC> & obj)

BinIStreamC & operator >>(BinIStreamC & strm,RCHandleVC<RCWrapBaseBodyC> & obj)

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

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

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

bool operator !=(const RCHandleC<RCWrapBaseBodyC> & 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<RCWrapBaseBodyC> & obj)

istream & operator >>(istream & strm,RCHandleC<RCWrapBaseBodyC> & obj)


Maintainer:Charles Galambos, Created: 06/05/1998, Documentation by CxxDoc: Tue Aug 13 09:59:02 2002