My Project
Public Member Functions | Protected Member Functions | Friends
Map< T > Class Template Reference

General container like STL Map. More...

#include <Map.hh>

List of all members.

Public Member Functions

 Map ()
 Constructor.
 ~Map ()
 Destructor.
 Map (const Map< T > &ob)
 copy constructor
Map< T > operator= (const Map< T > &ob)
bool Empty ()
 Returns empty or no.
UInt4 Size () const
 Returns the size of vector.
UInt4 PutTableSize () const
 Alias of Size().
UInt4 PutIndexNumber (string key)
 Returns "IndexNumber" assigned to "key".
void Add (string key, T value)
 Input a pair of information.
Find (string key)
 Returns an data element whose name is "key".
Put (string key)
 Returns an data element whose name is "key". This is an alias of "Find(string)".
Put (UInt4 index)
string PutKey (UInt4 index)
const T & operator[] (const string &key) const
 returns a const reference to content (key must be exist)
T & operator[] (const string &key)
 returns a reference to content if key does not exist, new content is added
void Clear ()
 Delete all information stored in this class.
void Remove (UInt4 IndexNumber)
 Remove a data element whose index number is "IndexNumber".
void Remove (string key)
 Remove a data element whose name is "key".
void Dump ()
 Dump all information to standard-output with index numbers and keys.
UInt4 Check (string Key)
 Check the existence of the "Key" included in this storage.

Protected Member Functions

Int4 _Check (string Key) const
 used in Check() and PutIndexNumber()
void _Add (string key, T value)
 Add() without checking key.

Friends

class boost::serialization::access
class HeaderBase

Detailed Description

template<class T>
class Map< T >

General container like STL Map.

This class is a general container class like STL-map. Because the STL-map applied to template classes cannot be used with the swig, this class will be utilized instead of the STL-map.

If this class is used from the Python environment, you should use concrete class names, MapInt4, MapDoubleVector, etc. These definitions are written in "analysis/Template.i" which is the interface file of SWIG.

The type of T can be set as not only int, double.... but also various pointers, *vector<Double> and class objects. Any objects can be stored in this class object.

This class is not include a copy constructor. If you want to copy the class object of this class, you should copy each element in your application.


Member Function Documentation

template<class T >
Int4 Map< T >::_Check ( string  Key) const [protected]

used in Check() and PutIndexNumber()

Returns:
-1: non existing; n(>=0): index number
template<class T>
void Map< T >::Add ( string  key,
value 
)

Input a pair of information.

The first argument is a key-word whose type is string. The second argument is a value whose type is T. This class checks the name of "key" not to register doubly. If the installing key name is already installed in the storage, you will receive an warning message and this addition procedure will be rejected.

template<class T >
UInt4 Map< T >::Check ( string  Key)

Check the existence of the "Key" included in this storage.

If the "Key" is in this storage, returns 1. If the "Key" is not found in it, returns 0.

template<class T >
void Map< T >::Dump ( )

Dump all information to standard-output with index numbers and keys.

If the type of T is pointer, the address of the pointer will be displayed.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Friends