Serialbox  2.2.0
Data serialization library and tools for C/C++, Python and Fortran
serialbox::stella::DataFieldInfo Class Reference

Information of a data-field. More...

#include <DataFieldInfo.h>

Public Member Functions

 DataFieldInfo ()
 Default constructor.
 
 DataFieldInfo (const boost::shared_ptr< FieldMetainfoImpl > &fieldMetainfoImpl)
 Construct with FieldMetainfoImpl.
 
 DataFieldInfo (const DataFieldInfo &other)
 Copy constructor.
 
DataFieldInfooperator= (const DataFieldInfo &other)
 Assignment operator.
 
template<typename TDataField >
void Init (const TDataField &dataField)
 Initialize with field. More...
 
template<typename TDataField >
void Init (const TDataField &dataField, std::string name)
 Initializer with field and new name. More...
 
void Init (std::string name, std::string type, int bytesPerElement, int rank, int iSize, int jSize, int kSize, int lSize, int iMinusHalo, int iPlusHalo, int jMinusHalo, int jPlusHalo, int kMinusHalo, int kPlusHalo, int lMinusHalo, int lPlusHalo)
 Initializer with sparse information. More...
 
const MetainfoSetmetainfo () const
 Gives read-only access to the metainformation associated with the field.
 
std::string name () const
 The field name.
 
std::string type () const
 The field scalar type.
 
int dataSize () const
 The size of the field data in bytes is returned.
 
int bytesPerElement () const
 The dimension in bytes of a single element.
 
int rank () const
 The number of dimensions of the field.
 
int iSize () const
 The size of the field in i-direction, including the halo.
 
int jSize () const
 The size of the field in j-direction, including the halo.
 
int kSize () const
 The size of the field in k-direction, including the halo.
 
int lSize () const
 The size of the field in l-direction, including the halo.
 
int iMinusHaloSize () const
 The size of the halo in negative i-direction.
 
int iPlusHaloSize () const
 The size of the halo in positive i-direction.
 
int jMinusHaloSize () const
 The size of the halo in negative j-direction.
 
int jPlusHaloSize () const
 The size of the halo in positive j-direction.
 
int kMinusHaloSize () const
 The size of the halo in negative k-direction.
 
int kPlusHaloSize () const
 The size of the halo in positive k-direction.
 
int lMinusHaloSize () const
 The size of the halo in negative l-direction.
 
int lPlusHaloSize () const
 The size of the halo in positive l-direction.
 
int fieldLength () const
 The number of bytes occupied by the field.
 
IJKSize calculationDomain () const
 The calculation domain of the field.
 
IJKSize size () const
 The total storage of the field (calculation domain and boundary)
 
IJKBoundary boundary () const
 The size of the halo of the field.
 
template<typename ValueType >
void AddMetainfo (const std::string &key, const ValueType &value)
 Add new metainformation.
 
bool operator== (const DataFieldInfo &other) const
 Comparator operator.
 
bool operator!= (const DataFieldInfo &other) const
 Comparator operator.
 
std::string ToString () const
 Gives a string representation of the object, useful for debugging.
 
void setImpl (const boost::shared_ptr< FieldMetainfoImpl > &fieldMetainfoImpl)
 Set implementation pointer.
 
boost::shared_ptr< FieldMetainfoImpl > & getImpl ()
 Get implementation pointer.
 
const boost::shared_ptr< FieldMetainfoImpl > & getImpl () const
 

Detailed Description

Information of a data-field.

Definition at line 31 of file DataFieldInfo.h.

Member Function Documentation

◆ Init() [1/3]

template<typename TDataField >
void serialbox::stella::DataFieldInfo::Init ( const TDataField &  dataField)
inline

Initialize with field.

This general-purpose initializer reads the information from a given data field.

Parameters
dataFieldThe field of which the information must be read

Definition at line 51 of file DataFieldInfo.h.

◆ Init() [2/3]

template<typename TDataField >
void serialbox::stella::DataFieldInfo::Init ( const TDataField &  dataField,
std::string  name 
)
inline

Initializer with field and new name.

This general-purpose initializer recovers the information from a given data field.

Parameters
dataFieldThe field of which the information must be read
nameThe name of the field when serialized

Definition at line 62 of file DataFieldInfo.h.

◆ Init() [3/3]

void serialbox::stella::DataFieldInfo::Init ( std::string  name,
std::string  type,
int  bytesPerElement,
int  rank,
int  iSize,
int  jSize,
int  kSize,
int  lSize,
int  iMinusHalo,
int  iPlusHalo,
int  jMinusHalo,
int  jPlusHalo,
int  kMinusHalo,
int  kPlusHalo,
int  lMinusHalo,
int  lPlusHalo 
)

Initializer with sparse information.

This initializer collects the information given in the multiple parameters.

Parameters
nameThe name of the field
typeThe data type of the field (e.g. "double")
bytesPerElementThe size in bytes of a single entry
rankThe number of dimensions of the field
iSizeThe size in i-direction (including of halo)
jSizeThe size in j-direction (including of halo)
kSizeThe size in k-direction (including of halo)
lSizeThe size in l-direction (including of halo)
iMinusHaloThe dimension of the halo in negative i-direction
iPlusHaloThe dimension of the halo in positive i-direction
jMinusHaloThe dimension of the halo in negative j-direction
jPlusHaloThe dimension of the halo in positive j-direction
kMinusHaloThe dimension of the halo in negative k-direction
kPlusHaloThe dimension of the halo in positive k-direction
lMinusHaloThe dimension of the halo in negative l-direction
lPlusHaloThe dimension of the halo in positive l-direction

Definition at line 39 of file DataFieldInfo.cpp.


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