casacore
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
casacore::OrderedMapRep< key, value > Class Template Reference

Representation class for an Ordered Map. More...

#include <OrderedMap.h>

Public Types

enum  { OrderedMapRepVersion }
 
- Public Types inherited from casacore::MapRep< key, value >
enum  { MapRepVersion }
 

Public Member Functions

 OrderedMapRep (const value &, uInt size)
 Creates a map with the specified default value, "value", and the internal block size. More...
 
 OrderedMapRep (const value &)
 Creates a map with the specified default value, "value". More...
 
valueisDefined (const key &)
 These functions check to see if a mapping is defined between the specified key and some value. More...
 
const valueisDefined (const key &) const
 Returns a non-zero value if a mapping is defined for the key parameter. More...
 
uInt ndefined () const
 Returns the number of user defined mappings. More...
 
valuedefine (const key &, const value &)
 Defines a mapping (ie. More...
 
void remove (const key &)
 Undefines a mapping (ie. More...
 
void clear ()
 Clear the entire map (ie. More...
 
MapIterRep< key, value > * getRep (Map< key, value > *) const
 
MapRep< key, value > * Clone () const
 
uInt nused () const
 Get the number of mappings. More...
 
uInt ntot () const
 
uInt incr () const
 Get or set the Block allocation increment. More...
 
uInt incr (uInt nri)
 
 ~OrderedMapRep ()
 Removes a map. More...
 
- Public Member Functions inherited from casacore::NoticeSource
 NoticeSource ()
 
virtual ~NoticeSource ()
 
void notify (const Notice &note)
 Sends the note to all NoticeTargets in the target list. More...
 
- Public Member Functions inherited from casacore::MapRep< key, value >
 MapRep (const value &dflt)
 This is the only MapRep constructor. More...
 
valueoperator() (const key &ky)
 This is the mapping function which maps keys to values. More...
 
const valueoperator() (const key &ky) const
 
valuedefaultVal ()
 Returns the default value for the Map. More...
 
const valuedefaultVal () const
 
virtual ~MapRep ()
 Does nothing. More...
 

Protected Member Functions

Int findKey (const key &, Bool &) const
 Binary search for the key. More...
 

Protected Attributes

PtrBlock< OrderedPair< key, value > * > kvblk
 The blocks to hold the keys and values and the total, used and increment size of these blocks. More...
 
uInt nrtot
 
uInt nrused
 
uInt nrincr
 
uInt lastRef
 The index of the last key used. More...
 
- Protected Attributes inherited from casacore::MapRep< key, value >
value DefaultVal
 This is the default value which is return when no match is found. More...
 

Friends

class OrderedMap< key, value >
 

Detailed Description

template<class key, class value>
class casacore::OrderedMapRep< key, value >

Representation class for an Ordered Map.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Definition at line 102 of file OrderedMap.h.

Member Enumeration Documentation

◆ anonymous enum

template<class key , class value >
anonymous enum
Enumerator
OrderedMapRepVersion 

Definition at line 169 of file OrderedMap.h.

Constructor & Destructor Documentation

◆ OrderedMapRep() [1/2]

template<class key , class value >
casacore::OrderedMapRep< key, value >::OrderedMapRep ( const value ,
uInt  size 
)

Creates a map with the specified default value, "value", and the internal block size.

◆ OrderedMapRep() [2/2]

template<class key , class value >
casacore::OrderedMapRep< key, value >::OrderedMapRep ( const value )

Creates a map with the specified default value, "value".

◆ ~OrderedMapRep()

template<class key , class value >
casacore::OrderedMapRep< key, value >::~OrderedMapRep ( )

Removes a map.

Member Function Documentation

◆ clear()

template<class key , class value >
void casacore::OrderedMapRep< key, value >::clear ( )
virtual

Clear the entire map (ie.

remove all mappings).

Implements casacore::MapRep< key, value >.

◆ Clone()

template<class key , class value >
MapRep<key,value>* casacore::OrderedMapRep< key, value >::Clone ( ) const
virtual

◆ define()

template<class key , class value >
value& casacore::OrderedMapRep< key, value >::define ( const key &  ,
const value  
)
virtual

Defines a mapping (ie.

create a key value mapping)

Implements casacore::MapRep< key, value >.

◆ findKey()

template<class key , class value >
Int casacore::OrderedMapRep< key, value >::findKey ( const key &  ,
Bool  
) const
protected

Binary search for the key.

◆ getRep()

template<class key , class value >
MapIterRep<key,value>* casacore::OrderedMapRep< key, value >::getRep ( Map< key, value > *  ) const
virtual

◆ incr() [1/2]

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::incr ( ) const
inline

Get or set the Block allocation increment.

Definition at line 160 of file OrderedMap.h.

References casacore::OrderedMapRep< key, value >::nrincr.

◆ incr() [2/2]

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::incr ( uInt  nri)
inline

Definition at line 161 of file OrderedMap.h.

References casacore::OrderedMapRep< key, value >::nrincr.

◆ isDefined() [1/2]

template<class key , class value >
value* casacore::OrderedMapRep< key, value >::isDefined ( const key &  )
virtual

These functions check to see if a mapping is defined between the specified key and some value.

If one is, a pointer to the value is returned, otherwise 0 is returned.

Implements casacore::MapRep< key, value >.

◆ isDefined() [2/2]

template<class key , class value >
const value* casacore::OrderedMapRep< key, value >::isDefined ( const key &  ) const
virtual

Returns a non-zero value if a mapping is defined for the key parameter.

Implements casacore::MapRep< key, value >.

◆ ndefined()

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::ndefined ( ) const
virtual

Returns the number of user defined mappings.

Implements casacore::MapRep< key, value >.

◆ ntot()

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::ntot ( ) const
inline

Definition at line 154 of file OrderedMap.h.

References casacore::OrderedMapRep< key, value >::nrtot.

◆ nused()

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::nused ( ) const
inline

Get the number of mappings.

Definition at line 153 of file OrderedMap.h.

References casacore::OrderedMapRep< key, value >::nrused.

◆ remove()

template<class key , class value >
void casacore::OrderedMapRep< key, value >::remove ( const key &  )
virtual

Undefines a mapping (ie.

remove a key value mapping).

Implements casacore::MapRep< key, value >.

Friends And Related Function Documentation

◆ OrderedMap< key, value >

template<class key , class value >
friend class OrderedMap< key, value >
friend

Definition at line 88 of file OrderedMap.h.

Member Data Documentation

◆ kvblk

template<class key , class value >
PtrBlock<OrderedPair<key,value>*> casacore::OrderedMapRep< key, value >::kvblk
protected

The blocks to hold the keys and values and the total, used and increment size of these blocks.

Definition at line 174 of file OrderedMap.h.

◆ lastRef

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::lastRef
protected

The index of the last key used.

Definition at line 180 of file OrderedMap.h.

◆ nrincr

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::nrincr
protected

Definition at line 177 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< key, value >::incr().

◆ nrtot

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::nrtot
protected

Definition at line 175 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< key, value >::ntot().

◆ nrused

template<class key , class value >
uInt casacore::OrderedMapRep< key, value >::nrused
protected

Definition at line 176 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< key, value >::nused().


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