My Project
|
#include <NeutronVector.hh>
Public Member Functions | |
NeutronVector () | |
Constructor. | |
NeutronVector (H pheader) | |
Constructor. | |
~NeutronVector () | |
Destructor. | |
NeutronVector (const NeutronVector &ob) | |
NeutronVector | operator= (const NeutronVector &ob) |
void | Allocate (UInt4 size) |
All of data stored in this container are deleted, and created a new vector whose sise is specified by the argument. | |
void | Set (UInt4 index, T *value) |
UInt4 | AddPointer (T *value) |
"T*" is the each array element pointer. | |
UInt4 | Add (T value) |
"T value" is the data object, and each object is copied to a dynamical object. | |
UInt4 | Add (NeutronVector< T, H > &value) |
T | Put (UInt4 index=0) |
T * | PutPointer (UInt4 index=0) |
T * | operator() (UInt4 index) |
Returns the pointer of stored container(ElementContainer for ElementContainerArray, ECA for ECM... whose index number is "index". | |
T & | ref (UInt4 index) |
ref() reference implementation of the operator[] | |
const T & | ref (UInt4 index) const |
ref() reference implementation of the operator[] | |
void | InputHeader (H pheader) |
input header object. | |
H | PutHeader () |
H * | PutHeaderPointer () const |
Returns the pointer of the header object. | |
void | reset () |
Reset the data storage in this class. | |
UInt4 | PutTableSize () const |
alias of getTableSize() | |
UInt4 | EraseElement (UInt4 i) |
Delete the i-th data in the vector, the vector size decreases by 1. | |
UInt4 | PutSize () const |
alias of PutTableSize() | |
UInt4 | ClearElement (UInt4 i) |
Clear the i-th element in the vector. | |
UInt4 | copy (UInt4 i) |
Copy and add a T-type object from the i-th object to the end of the vector-container. | |
void | AddToHeader (string Key, Int4 value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (string Key, Double value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (string Key, string value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (string Key, vector< Int4 > value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (string Key, vector< Double > value) |
Data objects can be installed into the header-object with its name-tag. | |
void | AddToHeader (string Key, vector< string > value) |
Data objects can be installed into the header-object with its name-tag. | |
template<class Func > | |
void | Transform (const std::string &Key, std::vector< Func > F, const std::string &newunit="None") |
void | Reverse (void) |
reverse all std::vector | |
void | Resize (UInt4 newsize) |
NeutronVector< T, H > & | operator+= (const NeutronVector< T, H > &r) |
NeutronVector< T, H > & | operator-= (const NeutronVector< T, H > &r) |
NeutronVector< T, H > & | operator*= (const NeutronVector< T, H > &r) |
NeutronVector< T, H > & | operator/= (const NeutronVector< T, H > &r) |
NeutronVector< T, H > | operator+ (NeutronVector< T, H > &r) |
NeutronVector< T, H > | operator- (NeutronVector< T, H > &r) |
NeutronVector< T, H > | operator* (NeutronVector< T, H > &r) |
NeutronVector< T, H > | operator/ (NeutronVector< T, H > &r) |
Protected Member Functions | |
template<class Archive > | |
std::vector< std::string > | presave (Archive &ar, const std::string &masterfile, const unsigned int splitnum) const |
template<class Archive > | |
void | preload (Archive &ar, std::vector< std::string > &S, std::vector< UInt4 > &csize) |
Protected Attributes | |
vector< T * > | v |
H * | header |
Friends | |
class | boost::serialization::access |
class | WriteNeXusFile |
class | ReadNeXusFile |
class | WriteSerializationFile |
to access from WriteSerializationFile::SplitSave() to presave() (parallel save) | |
class | ReadSerializationFile |
to access from ReadSerializationFile::SplitLoad() to preload() (parallel save) |
Data container template.
This class is a container class. If you want to put objects, for example NeutronVector, into this class, it must be set 1 (default value).
The STL vector is used as a data object storage in this template, you can add data objects at any time by using "add( T* )". When you call the destructor of this class, Not only the pointer entry in the vector, but also the substance of the data objects and header object will be deleted completely.
The example are given in following,
UInt4 NeutronVector< T, H >::Add | ( | T | value | ) |
"T value" is the data object, and each object is copied to a dynamical object.
The dynamical object will be stored into the container. Each T is stored into the STL vector object, you can use this method at any time.
UInt4 NeutronVector< T, H >::AddPointer | ( | T * | value | ) |
"T*" is the each array element pointer.
Each T is stored into the STL vector object, you can use this method at any time.
CAUTION: stored pointer still be pointing external object
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
Int4 | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
Double | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
string | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
vector< Int4 > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
vector< Double > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
void NeutronVector< T, H >::AddToHeader | ( | string | Key, |
vector< string > | value | ||
) | [inline] |
Data objects can be installed into the header-object with its name-tag.
The method of the header-object is executed in this method. See the manual of HeaderBase.
UInt4 NeutronVector< T, H >::ClearElement | ( | UInt4 | i | ) |
Clear the i-th element in the vector.
The size of vector is not changed. The i-th value in the vector is set as NULL.
UInt4 NeutronVector< T, H >::copy | ( | UInt4 | i | ) |
Copy and add a T-type object from the i-th object to the end of the vector-container.
A return value of this method is the number of vector size added in this method.
UInt4 NeutronVector< T, H >::EraseElement | ( | UInt4 | i | ) |
Delete the i-th data in the vector, the vector size decreases by 1.
Not only the pointer entry in the vector but also the substance of the i-th data object will be deleted by this method.
void NeutronVector< T, H >::InputHeader | ( | H | pheader | ) |
input header object.
If the object have existed already, the old one will be deleted.
void NeutronVector< T, H >::preload | ( | Archive & | ar, |
std::vector< std::string > & | S, | ||
std::vector< UInt4 > & | csize | ||
) | [protected] |
preprocess for the reading header serialization object
std::vector< std::string > NeutronVector< T, H >::presave | ( | Archive & | ar, |
const std::string & | masterfile, | ||
const unsigned int | splitnum | ||
) | const [protected] |
preprocess for the generation of filenames
void NeutronVector< T, H >::reset | ( | ) | [inline] |
Reset the data storage in this class.
Data storage is erased competely.
void NeutronVector< T, H >::Resize | ( | UInt4 | newsize | ) |
resize its vector
if newsize is smaller than current size (shrink), objects pointed from vector v are remove. new size is larger, new pointers in vector point created new objects
newsize | size of vector v to become |
void NeutronVector< T, H >::Transform | ( | const std::string & | Key, |
std::vector< Func > | F, | ||
const std::string & | newunit = "None" |
||
) |
performs std::transform() to a vector with specified key and function object
Key | a key which specifies the target vector |
F | a std vector of function object (or a vector of vector of ... of function object) |
newunit | new unit |