TBTK
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable > Class Template Reference

Abstract Property class. More...

#include <AbstractProperty.h>

Inheritance diagram for TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >:
TBTK::Serializable

Public Member Functions

unsigned int getBlockSize () const
 
void setSize (unsigned int size)
 
unsigned int getSize () const
 
const DataType * getData () const
 
DataType * getDataRW ()
 
unsigned int getSizeInBytes () const
 
char * getRawData ()
 
unsigned int getDimensions () const
 
std::vector< int > getRanges () const
 
int getOffset (const Index &index) const
 
const IndexDescriptorgetIndexDescriptor () const
 
bool contains (const Index &index) const
 
virtual const DataType & operator() (const Index &index, unsigned int offset=0) const
 
virtual DataType & operator() (const Index &index, unsigned int offset=0)
 
virtual const DataType & operator() (unsigned int offset) const
 
virtual DataType & operator() (unsigned int offset)
 
void setAllowIndexOutOfBoundsAccess (bool allowIndexOutOfBoundsAccess)
 
void setDefaultValue (const DataType &defaultValue)
 
virtual std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 
template<>
std::string serialize (Mode mode) const
 

Protected Member Functions

 AbstractProperty ()
 
 AbstractProperty (unsigned int blockSize)
 
 AbstractProperty (unsigned int blockSize, const DataType *data)
 
 AbstractProperty (unsigned int dimensions, const int *ranges, unsigned int blockSize)
 
 AbstractProperty (unsigned int dimensions, const int *ranges, unsigned int blockSize, const DataType *data)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize)
 
 AbstractProperty (const IndexTree &indexTree, unsigned int blockSize, const DataType *data)
 
 AbstractProperty (const AbstractProperty &abstractProperty)
 
 AbstractProperty (AbstractProperty &&abstractProperty)
 
 AbstractProperty (const std::string &serialization, Mode mode)
 
virtual ~AbstractProperty ()
 
AbstractPropertyoperator= (const AbstractProperty &abstractProperty)
 
AbstractPropertyoperator= (AbstractProperty &&abstractProperty)
 
template<>
 AbstractProperty (const std::string &serialization, Mode mode)
 
template<>
 AbstractProperty (const std::string &serialization, Mode mode)
 
template<>
 AbstractProperty (const std::string &serialization, Mode mode)
 

Additional Inherited Members

- Public Types inherited from TBTK::Serializable
enum  Mode { Debug, Binary, XML, JSON }
 
- Static Public Member Functions inherited from TBTK::Serializable
static bool hasID (const std::string &serialization, Mode mode)
 
static std::string getID (const std::string &serialization, Mode mode)
 
- Static Protected Member Functions inherited from TBTK::Serializable
static bool validate (const std::string &serialization, const std::string &id, Mode mode)
 
static std::string getContent (const std::string &serialization, Mode mode)
 
static std::vector< std::string > split (const std::string &content, Mode mode)
 
static std::string serialize (bool b, Mode mode)
 
static void deserialize (const std::string &serialization, bool *b, Mode mode)
 
static std::string serialize (int i, Mode mode)
 
static void deserialize (const std::string &serialization, int *i, Mode mode)
 
static std::string serialize (unsigned int u, Mode mode)
 
static void deserialize (const std::string &serialization, unsigned int *u, Mode mode)
 
static std::string serialize (double d, Mode mode)
 
static void deserialize (const std::string &serialization, double *d, Mode mode)
 
static std::string serialize (std::complex< double > c, Mode mode)
 
static void deserialize (const std::string &serialization, std::complex< double > *c, Mode mode)
 
static std::string serialize (Statistics s, Mode mode)
 
static void deserialize (const std::string &serialization, Statistics *s, Mode mode)
 
static std::string extract (const std::string &serialization, Mode mode, std::string component)
 

Detailed Description

template<typename DataType, bool isFundamental = std::is_fundamental<DataType>::value, bool isSerializable = std::is_base_of<Serializable, DataType>::value>
class TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >

Abstract Property class.

Constructor & Destructor Documentation

template<typename DataType , bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( )
protected

Constructor.

template<typename DataType , bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( unsigned int  blockSize)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( unsigned int  blockSize,
const DataType *  data 
)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( unsigned int  dimensions,
const int *  ranges,
unsigned int  blockSize 
)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( unsigned int  dimensions,
const int *  ranges,
unsigned int  blockSize,
const DataType *  data 
)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( const IndexTree indexTree,
unsigned int  blockSize 
)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( const IndexTree indexTree,
unsigned int  blockSize,
const DataType *  data 
)
protected

Constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( const AbstractProperty< DataType, isFundamental, isSerializable > &  abstractProperty)
protected

Copy constructor.

template<typename DataType, bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( AbstractProperty< DataType, isFundamental, isSerializable > &&  abstractProperty)
protected

Move constructor.

template<typename DataType, bool isFundamental = std::is_fundamental<DataType>::value, bool isSerializable = std::is_base_of<Serializable, DataType>::value>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::AbstractProperty ( const std::string &  serialization,
Mode  mode 
)
protected

Constructor. Constructs the AbstractProperty from a serialization string.

template<typename DataType , bool isFundamental, bool isSerializable>
TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::~AbstractProperty ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

template<typename DataType , bool isFundamental, bool isSerializable>
bool TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::contains ( const Index index) const
inline

Returns true if the property contains data for the given index.

template<typename DataType , bool isFundamental, bool isSerializable>
unsigned int TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getBlockSize ( ) const
inline

Get block size.

template<typename DataType , bool isFundamental, bool isSerializable>
const DataType * TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getData ( ) const
inline

Get data.

template<typename DataType , bool isFundamental, bool isSerializable>
DataType * TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getDataRW ( )
inline

Same as getData, but with write access.

template<typename DataType , bool isFundamental, bool isSerializable>
unsigned int TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getDimensions ( ) const
inline

Get the dimension of the data.

template<typename DataType , bool isFundamental, bool isSerializable>
const IndexDescriptor & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getIndexDescriptor ( ) const
inline
template<typename DataType , bool isFundamental, bool isSerializable>
int TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getOffset ( const Index index) const
inline

Get the offset in memory for given Index.

template<typename DataType , bool isFundamental, bool isSerializable>
std::vector< int > TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getRanges ( ) const
inline

Get the ranges for the dimensions of the density.

template<typename DataType , bool isFundamental, bool isSerializable>
char * TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getRawData ( )
inline

Returns data on raw format. Intended for use in serialization.

template<typename DataType , bool isFundamental, bool isSerializable>
unsigned int TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getSize ( ) const
inline

Get size.

template<typename DataType , bool isFundamental, bool isSerializable>
unsigned int TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::getSizeInBytes ( ) const
inline

Get size in bytes.

template<typename DataType , bool isFundamental, bool isSerializable>
const DataType & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator() ( const Index index,
unsigned int  offset = 0 
) const
inlinevirtual

Function call operator.

Reimplemented in TBTK::Property::WaveFunctions.

template<typename DataType , bool isFundamental, bool isSerializable>
DataType & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator() ( const Index index,
unsigned int  offset = 0 
)
inlinevirtual

Function call operator.

Reimplemented in TBTK::Property::WaveFunctions.

template<typename DataType , bool isFundamental, bool isSerializable>
const DataType & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator() ( unsigned int  offset) const
inlinevirtual

Function call operator.

template<typename DataType , bool isFundamental, bool isSerializable>
DataType & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator() ( unsigned int  offset)
inlinevirtual

Function call operator.

template<typename DataType , bool isFundamental, bool isSerializable>
AbstractProperty< DataType, isFundamental, isSerializable > & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator= ( const AbstractProperty< DataType, isFundamental, isSerializable > &  abstractProperty)
protected

Assignment operator.

template<typename DataType , bool isFundamental, bool isSerializable>
AbstractProperty< DataType, isFundamental, isSerializable > & TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::operator= ( AbstractProperty< DataType, isFundamental, isSerializable > &&  abstractProperty)
protected

Move assignment operator.

template<typename DataType, bool isFundamental = std::is_fundamental<DataType>::value, bool isSerializable = std::is_base_of<Serializable, DataType>::value>
virtual std::string TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::serialize ( Mode  mode) const
virtual
template<>
std::string TBTK::Property::AbstractProperty< bool, true, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< char, true, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< int, true, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< float, true, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< double, true, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< std::complex< double >, false, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<>
std::string TBTK::Property::AbstractProperty< SpinMatrix, false, false >::serialize ( Mode  mode) const
inlinevirtual

Serialize object.

Implements TBTK::Serializable.

template<typename DataType , bool isFundamental, bool isSerializable>
void TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::setAllowIndexOutOfBoundsAccess ( bool  allowIndexOutOfBoundsAccess)
inline

Set whether access of index not contained in the Property is allowed or not. If eneabled, remember to also initialize the value used for out of bounds access using AbstractProperty::setDefaultValue().

template<typename DataType, bool isFundamental, bool isSerializable>
void TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::setDefaultValue ( const DataType &  defaultValue)
inline

Set the value that is returned when accessing indices not contained in the Property. Only use if AbstractProperty::setAllowIndexOutOfBoundsAccess(true) is called.

template<typename DataType , bool isFundamental, bool isSerializable>
void TBTK::Property::AbstractProperty< DataType, isFundamental, isSerializable >::setSize ( unsigned int  size)
inline

Set size.


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