IfdIntKey Class Reference

#include <IfdIntKey.h>

Inheritance diagram for IfdIntKey:

IfdKey List of all members.

Public Member Functions

 IfdIntKey (const int i)
virtual int operator== (const IfdKey &k) const
virtual ~IfdIntKey ()
virtual IfdKeyclone (void) const
virtual void print (std::ostream &o) const
int operator!= (const IfdKey &k) const
virtual void add (const IfdKey &)
int cardinality (void) const
virtual unsigned int hash (void) const

Static Public Member Functions

static unsigned int nHashBuckets (void)

Public Attributes

unsigned int _hashVal

Protected Types

 _nHashBuckets = 1031
 intKey
 strKey
 compositeKey
 typeKey
 odfTypeKey
enum  { _nHashBuckets = 1031 }
enum  keyKind {
  intKey, strKey, compositeKey, typeKey,
  odfTypeKey
}

Protected Member Functions

IfdKey::keyKind getKeyKind (void) const

Protected Attributes

keyKind _myKeyKind
int _myCardinality
union {
   int   intVal
   unsigned int   uintVal
   char *   strVal
}; 

Private Member Functions

 IfdIntKey (const IfdIntKey &)
IfdIntKeyoperator= (IfdIntKey &)

Friends

class IfdIntKey
class IfdStrKey
class IfdTypeKeyIFace
class IfdCompositeKey
class BdbOdfIfdTypeKeyIFace
std::ostreamoperator<< (std::ostream &o, const IfdKey &k)
unsigned ifdKeyHash (const IfdDictKey &k)

Detailed Description

Definition at line 28 of file IfdIntKey.h.


Member Enumeration Documentation

anonymous enum [protected, inherited]

Enumerator:
_nHashBuckets 

Definition at line 86 of file IfdKey.h.

00086 { _nHashBuckets = 1031 }; // .33 msec/ev, not opt

enum IfdKey::keyKind [protected, inherited]

Enumerator:
intKey 
strKey 
compositeKey 
typeKey 
odfTypeKey 

Definition at line 88 of file IfdKey.h.


Constructor & Destructor Documentation

IfdIntKey::IfdIntKey ( const int  i  ) 

Definition at line 26 of file IfdIntKey.cxx.

References IfdKey::_hashVal, IfdKey::_nHashBuckets, and IfdKey::intVal.

Referenced by clone().

00027   : IfdKey( intKey )
00028 {
00029    intVal   =  i; 
00030    _hashVal = i % _nHashBuckets;
00031 }

virtual IfdIntKey::~IfdIntKey (  )  [inline, virtual]

Definition at line 37 of file IfdIntKey.h.

00037 {}

IfdIntKey::IfdIntKey ( const IfdIntKey  )  [private]


Member Function Documentation

void IfdKey::add ( const IfdKey  )  [virtual, inherited]

Definition at line 34 of file IfdKey.cxx.

00034                            {
00035   // only makes sense for the composite class.
00036 
00037   assert( 0 );
00038 }

int IfdKey::cardinality ( void   )  const [inline, inherited]

Definition at line 166 of file IfdKey.h.

References IfdKey::_myCardinality.

00166                               { 
00167 //*****************************************************************************
00168     return _myCardinality;
00169 }

virtual IfdKey* IfdIntKey::clone ( void   )  const [inline, virtual]

Implements IfdKey.

Definition at line 39 of file IfdIntKey.h.

References IfdIntKey(), and IfdKey::intVal.

00039 { return new IfdIntKey( intVal ); }

IfdKey::keyKind IfdKey::getKeyKind ( void   )  const [inline, protected, inherited]

Definition at line 98 of file IfdKey.h.

References IfdKey::_myKeyKind.

Referenced by IfdStrKey::operator<(), IfdStrKey::operator==(), and operator==().

00098 { return _myKeyKind; }

virtual unsigned int IfdKey::hash ( void   )  const [inline, virtual, inherited]

Definition at line 77 of file IfdKey.h.

References IfdKey::_hashVal.

00078         { return _hashVal;}

static unsigned int IfdKey::nHashBuckets ( void   )  [inline, static, inherited]

Definition at line 82 of file IfdKey.h.

References IfdKey::_nHashBuckets.

00083        { return _nHashBuckets; }

int IfdKey::operator!= ( const IfdKey k  )  const [inline, inherited]

Definition at line 182 of file IfdKey.h.

00182                                             {
00183 //*****************************************************************************
00184 
00185     return ! ( *this == k );
00186 }

IfdIntKey& IfdIntKey::operator= ( IfdIntKey  )  [private]

virtual int IfdIntKey::operator== ( const IfdKey k  )  const [inline, virtual]

Implements IfdKey.

Definition at line 33 of file IfdIntKey.h.

References IfdKey::getKeyKind(), IfdKey::intKey, and IfdKey::intVal.

00033                                                    {
00034       return ( intKey == k.getKeyKind() ) && ( intVal == k.intVal );
00035    }

virtual void IfdIntKey::print ( std::ostream o  )  const [inline, virtual]

Implements IfdKey.

Definition at line 43 of file IfdIntKey.h.

References IfdKey::intVal.

00047      { o << "IfdIntKey(" << intVal << ")"; }


Friends And Related Function Documentation

friend class BdbOdfIfdTypeKeyIFace [friend, inherited]

Definition at line 136 of file IfdKey.h.

friend class IfdCompositeKey [friend, inherited]

Definition at line 135 of file IfdKey.h.

friend class IfdIntKey [friend, inherited]

Definition at line 132 of file IfdKey.h.

unsigned ifdKeyHash ( const IfdDictKey &  k  )  [friend, inherited]

friend class IfdStrKey [friend, inherited]

Definition at line 133 of file IfdKey.h.

friend class IfdTypeKeyIFace [friend, inherited]

Definition at line 134 of file IfdKey.h.

std::ostream& operator<< ( std::ostream o,
const IfdKey k 
) [friend, inherited]


Member Data Documentation

union { ... } [protected, inherited]

unsigned int IfdKey::_hashVal [inherited]

Definition at line 80 of file IfdKey.h.

Referenced by IfdStrKey::clone(), IfdKey::hash(), IfdIntKey(), IfdStrKey::IfdStrKey(), and IfdStrKey::operator==().

int IfdKey::_myCardinality [protected, inherited]

Definition at line 122 of file IfdKey.h.

Referenced by IfdKey::cardinality().

keyKind IfdKey::_myKeyKind [protected, inherited]

Definition at line 116 of file IfdKey.h.

Referenced by IfdKey::getKeyKind().

int IfdKey::intVal [protected, inherited]

Definition at line 126 of file IfdKey.h.

Referenced by clone(), IfdIntKey(), operator==(), and print().

char* IfdKey::strVal [protected, inherited]

Definition at line 128 of file IfdKey.h.

Referenced by IfdStrKey::asString(), IfdStrKey::clone(), IfdStrKey::IfdStrKey(), IfdStrKey::operator<(), IfdStrKey::operator==(), and IfdStrKey::~IfdStrKey().

unsigned int IfdKey::uintVal [protected, inherited]

Definition at line 127 of file IfdKey.h.


Generated on Tue Nov 29 23:19:43 2016 for BOSS_7.0.2 by  doxygen 1.4.7