My Project
|
Data container for various data type with name-tag. More...
#include <HeaderBase.hh>
Public Member Functions | |
HeaderBase () | |
Constructor. | |
~HeaderBase () | |
Destructor. | |
HeaderBase (const HeaderBase &ob) | |
Copy constructor. | |
HeaderBase | operator= (const HeaderBase &ob) |
void | Add (string Key, Int4 value) |
Add a new value with its key. | |
void | Add (string Key, Double value) |
Add a new value with its key. | |
void | Add (string Key, string value) |
Add a new value with its key. | |
void | Add (string Key, vector< Int4 > value) |
Add a new value with its key. | |
void | Add (string Key, vector< Double > value) |
Add a new value with its key. | |
void | Add (string Key, vector< string > value) |
Add a new value with its key. | |
void | AddHeader (string Key, Int4 value) |
Alias of Add(Key,value) | |
void | AddHeader (string Key, Double value) |
Alias of Add(Key,value) | |
void | AddHeader (string Key, string value) |
Alias of Add(Key,value) | |
void | AddHeader (string Key, vector< Int4 > value) |
Alias of Add(Key,value) | |
void | AddHeader (string Key, vector< Double > value) |
Alias of Add(Key,value) | |
void | AddHeader (string Key, vector< string > value) |
Alias of Add(Key,value) | |
void | add (string Key, Int4 value) |
Alias of Add(Key,value) | |
void | add (string Key, Double value) |
Alias of Add(Key,value) | |
void | add (string Key, string value) |
Alias of Add(Key,value) | |
void | add (string Key, vector< Int4 > value) |
Alias of Add(Key,value) | |
void | add (string Key, vector< Double > value) |
Alias of Add(Key,value) | |
void | add (string Key, vector< string > value) |
Alias of Add(Key,value) | |
void | AddInt4List (string Key, PyObject *List) |
void | AddDoubleList (string Key, PyObject *List) |
void | AddStringList (string Key, PyObject *List) |
bool | Empty (void) |
void | Erase (string Key) |
Remove a value and its name-tag from the storage. | |
void | erase (string Key) |
Alias of "Erase(Key)". | |
void | clear () |
Clear completely entire information stored in this class. | |
void | Clear () |
Alias of "clear()". | |
void | OverWrite (string Key, Int4 value) |
Changes the value assigned to "Key". | |
void | OverWrite (string Key, Double value) |
Changes the value assigned to "Key". | |
void | OverWrite (string Key, string value) |
Changes the value assigned to "Key". | |
void | OverWrite (string Key, vector< Int4 > value) |
Changes the value assigned to "Key". | |
void | OverWrite (string Key, vector< Double > value) |
Changes the value assigned to "Key". | |
void | OverWrite (string Key, vector< string > value) |
Changes the value assigned to "Key". | |
void | Dump () |
Dump all information in user-frendly format to the STD-out. | |
PyObject * | PyDump () |
This method returns a Python-list object whose content equal strings shown by "void Dump()". | |
void | dump () |
Alias of "Dump()". | |
void | DumpHeader () |
void | Search (string Key) |
Searchs the six Maps for "Key". | |
UInt4 | CheckKey (string Key) |
Returns the number of "Key". | |
Int4 | PutInt4 (string Key) |
Returns an integer type value assigned to "Key". | |
Double | PutDouble (string Key) |
Returns an double type value assigned to "Key". | |
string | PutString (string Key) |
Returns an string type value assigned to "Key". | |
vector< Int4 > | PutInt4Vector (string Key) |
Returns an pointer of vector<Int4> assigned to "Key". | |
vector< Double > | PutDoubleVector (string Key) |
Returns an pointer of vector<Double> assigned to "Key". | |
vector< string > | PutStringVector (string Key) |
Returns an pointer of vector<string> assigned to "Key". | |
Int4 | PutInt4 (UInt4 Index) |
Double | PutDouble (UInt4 Index) |
string | PutString (UInt4 Index) |
vector< Int4 > | PutInt4Vector (UInt4 Index) |
vector< Double > | PutDoubleVector (UInt4 Index) |
vector< string > | PutStringVector (UInt4 Index) |
string | DumpToString () |
Convert all information stored in this class to a string. | |
void | InputString (string s) |
Receives a string generated by "DumpToString()" and re-build the information. | |
void | InputFile (string FileName) |
Int4 | i (string Key) |
This method is leaved keeping compatibility with "HeaderBase". | |
Double | d (string Key) |
This method is leaved keeping compatibility with "HeaderBase". | |
Float | f (string Key) |
This method is leaved keeping compatibility with "HeaderBase". | |
string | s (string Key) |
This method is leaved keeping compatibility with "HeaderBase". | |
vector< Int4 > | iv (string Key) |
Alias of PuInt4Vector(string). | |
vector< Double > | dv (string Key) |
Alias of PutDoubleVector(string). | |
vector< string > | sv (string Key) |
Alias of PutStringVector(string). | |
UInt4 | PutKeyLocation (string Key) |
Protected Member Functions | |
void | MakeMaps () |
Protected Attributes | |
Map< Int4 > * | Int4Map |
Map< Double > * | DoubleMap |
Map< string > * | StringMap |
Map< vector< Int4 > > * | Int4VectorMap |
Map< vector< Double > > * | DoubleVectorMap |
Map< vector< string > > * | StringVectorMap |
Friends | |
class | boost::serialization::access |
class | ReadNeXusFile |
class | WriteNeXusFile |
makes enable to direct access to Int4Map etc. from WriteNeXusFile::AppendAttribute(), instead of using the obsolete PutInt4Map() series functions | |
class | NeutronExchanger |
makes enable to direct access to Int4Map etc. from NeutronExchanger::TransmitHeaderBase() and ReceiveHeaderBase() |
Data container for various data type with name-tag.
This class is improved in its functionarities from "HeaderBase". "vector<Int4>", "vector<Double>" and vector<string> can be stored into this container, and "Int4", "Double" and "string" can be also kept in it with its names.
To keep the convenience for storing various types of objects, "HeaderBase" is not more efficient than "ElementContainer" and "NeutronVectorS", and this class should not be used as containers for experimental numerical data sets. This class is applied to keep header information in "ElementContainer". Please see the data structure of it.
To keep compatibility with the old-version of "HeaderBase", some methods are added in this class. This class object has six class objects as protected member, "Map<Int4>", "Map<Double>", "Map<string>", "Map<vector<Int4> >", "Map<vector<Double> >" and "Map<vector<string> >". If you want to append the other functionarities to this class, the protected methods are manipulated from your sub-class and see the manuals of "Map".
You cannot register the data object with the same key-name as the already used key-name over the six categories. To avoid the duplication, the addition process is checked in the methods of "Add(...)" If you want to know the key-names registered in this storage, use "Search(string)" or "Dump()".
Delimiter in this class is "," -- don't forget this rule. Comma(s) should not be contained in strings appending to this storage.
"DumpToString()" and "InputString()" is used exchanging the all information between servers. All information can be converted into a string object by "DumpToString()", and re-builded with the string object to "HeaderBase" by "InputString(string)".
All information including vector-objects stored in this class will be deleted in the destructor. If data-objects extracted from "HeaderBase" are installed into other containers, the objects should be copied in your application before executing this destructor.
Because both "Erase(Key)" and Add(Key,Value) is executed in the method of "OverWrite(Key,Value)", the type of Value can be changed by "OverWrite(Key,Value)".
Destructor.
All information stored in this class will be deleted in this method.
UInt4 HeaderBase::CheckKey | ( | string | Key | ) | [inline] |
Returns the number of "Key".
If "Key" has been entered, this method will return 1. Under normal conditions, this method returns 1 or 0.
string HeaderBase::DumpToString | ( | ) |
Convert all information stored in this class to a string.
All information can be rebuild from the string by inputting it into "InputString(string)".
void HeaderBase::Erase | ( | string | Key | ) |
Remove a value and its name-tag from the storage.
This method searches the six-Maps for "Key". If the "Key" cannot be found in the storage, warning messages will be output to the STD-out.
void HeaderBase::Search | ( | string | Key | ) |
Searchs the six Maps for "Key".
The name of map contained the "Key" returns to the STD-out.