casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
casacore::OrderedMapRep< t, v > Class Template Reference

Representation class for an Ordered Map. More...

#include <OrderedMap.h>

Inheritance diagram for casacore::OrderedMapRep< t, v >:
casacore::NoticeSource casacore::MapRep< key, value >

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 t, class v>
class casacore::OrderedMapRep< t, v >

Representation class for an Ordered Map.

Review Status

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

Definition at line 47 of file OrderedMap.h.

Member Enumeration Documentation

template<class t , class v >
anonymous enum
Enumerator
OrderedMapRepVersion 

Definition at line 169 of file OrderedMap.h.

Constructor & Destructor Documentation

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

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

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

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

template<class t , class v >
casacore::OrderedMapRep< t, v >::~OrderedMapRep ( )

Removes a map.

Member Function Documentation

template<class t , class v >
void casacore::OrderedMapRep< t, v >::clear ( )
virtual

Clear the entire map (ie.

remove all mappings).

Implements casacore::MapRep< key, value >.

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

Defines a mapping (ie.

create a key value mapping)

Implements casacore::MapRep< key, value >.

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

Binary search for the key.

template<class t , class v >
MapIterRep<key,value>* casacore::OrderedMapRep< t, v >::getRep ( Map< key, value > *  ) const
virtual
template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::incr ( ) const
inline

Get or set the Block allocation increment.

Definition at line 160 of file OrderedMap.h.

References casacore::OrderedMapRep< t, v >::nrincr.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::incr ( uInt  nri)
inline

Definition at line 161 of file OrderedMap.h.

References casacore::OrderedMapRep< t, v >::nrincr.

template<class t , class v >
value* casacore::OrderedMapRep< t, v >::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 >.

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

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

Implements casacore::MapRep< key, value >.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::ndefined ( ) const
virtual

Returns the number of user defined mappings.

Implements casacore::MapRep< key, value >.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::ntot ( ) const
inline

Definition at line 154 of file OrderedMap.h.

References casacore::OrderedMapRep< t, v >::nrtot.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::nused ( ) const
inline

Get the number of mappings.

Definition at line 153 of file OrderedMap.h.

References casacore::OrderedMapRep< t, v >::nrused.

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

Undefines a mapping (ie.

remove a key value mapping).

Implements casacore::MapRep< key, value >.

Friends And Related Function Documentation

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

Definition at line 103 of file OrderedMap.h.

Member Data Documentation

template<class t , class v >
PtrBlock<OrderedPair<key,value>*> casacore::OrderedMapRep< t, v >::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.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::lastRef
protected

The index of the last key used.

Definition at line 180 of file OrderedMap.h.

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::nrincr
protected

Definition at line 177 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< t, v >::incr().

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::nrtot
protected

Definition at line 175 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< t, v >::ntot().

template<class t , class v >
uInt casacore::OrderedMapRep< t, v >::nrused
protected

Definition at line 176 of file OrderedMap.h.

Referenced by casacore::OrderedMapRep< t, v >::nused().


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