HOPS
HOPS class reference
Public Member Functions | Friends | List of all members
hops::MHO_TableContainer< XValueType, XAxisPackType > Class Template Reference

Class MHO_TableContainer. More...

#include <MHO_TableContainer.hh>

Inheritance diagram for hops::MHO_TableContainer< XValueType, XAxisPackType >:
[legend]

Public Member Functions

 MHO_TableContainer ()
 
 MHO_TableContainer (const MHO_TableContainer &obj)
 
 MHO_TableContainer (const std::size_t *dim)
 
virtual ~MHO_TableContainer ()
 
MHO_TableContainerClone ()
 Clones entire table including contents and axes. More...
 
MHO_TableContainerCloneEmpty ()
 Clones table container shape with empty contents and axes. More...
 
virtual void Copy (const MHO_TableContainer &rhs)
 
XAxisPackTypeGetAxisPack ()
 access to axis pack type alone More...
 
const XAxisPackTypeGetAxisPack () const
 Getter for axis pack. More...
 
virtual uint64_t GetSerializedSize () const override
 Getter for serialized size. More...
 
virtual MHO_ClassVersion GetVersion () const override
 Getter for the class version. More...
 
virtual void Resize (const std::size_t *dim) override
 Resize the multidimensional array and axes according to given dimensions. More...
 
- Public Member Functions inherited from hops::MHO_NDArrayWrapper< XValueType, XAxisPackType::NAXES::value >
 MHO_NDArrayWrapper ()
 
 MHO_NDArrayWrapper (const MHO_NDArrayWrapper &obj)
 
 MHO_NDArrayWrapper (const std::size_t *dim)
 
 MHO_NDArrayWrapper (XValueType *ptr, const std::size_t *dim)
 
virtual ~MHO_NDArrayWrapper ()
 
std::enable_if<(sizeof...(XIndexTypeS)==RANK), XValueType & >::type at (XIndexTypeS... idx)
 at(): same as operator(...) but with bounds checking with bounds checking More...
 
std::enable_if<(sizeof...(XIndexTypeS)==RANK), const XValueType & >::type at (XIndexTypeS... idx) const
 at(): same as const operator(...) but with bounds checking with bounds checking More...
 
iterator begin ()
 
const_iterator cbegin () const
 
const_iterator cend () const
 
bool CheckIndexValidity (const index_type &idx) const
 
const_iterator citerator_at (std::size_t offset) const
 
MHO_NDArrayWrapperClone ()
 clone functionality - creates a deep copy of this MHO_NDArrayWrapper object. More...
 
virtual void Copy (const MHO_NDArrayView< XValueType, RANK > &rhs)
 
virtual void Copy (const MHO_NDArrayWrapper &rhs)
 
const_stride_iterator cstride_begin (std::size_t stride) const
 
const_stride_iterator cstride_end (std::size_t stride) const
 
const_stride_iterator cstride_iterator_at (std::size_t offset, std::size_t stride) const
 
iterator end ()
 
XValueType * GetData ()
 access to underlying data pointer (unsafe) More...
 
const XValueType * GetData () const
 
std::size_t GetDimension (std::size_t idx) const
 Getter for dimension. More...
 
index_type GetDimensionArray () const
 Getter for dimension array. More...
 
const std::size_t * GetDimensions () const
 get the dimensions/shape of the array More...
 
void GetDimensions (std::size_t *dim) const
 Getter for dimensions, fills passed array. More...
 
index_type GetIndicesForOffset (std::size_t offset)
 invert (memory) offset into array to indexes of the associated element More...
 
std::size_t GetOffsetForIndices (const std::size_t *index)
 compute (memory) offset into array from a set of indexes More...
 
std::size_t GetRank () const
 Getter for the rank (dimensionality) of the array. More...
 
std::size_t GetSize () const
 get the total size of the array More...
 
std::size_t GetStride (std::size_t idx) const
 
index_type GetStrideArray () const
 
const std::size_t * GetStrides () const
 Getter for element strides (along each dimension) More...
 
void GetStrides (std::size_t *strd) const
 Getter for strides (along each dimension), fills passed array. More...
 
iterator iterator_at (std::size_t offset)
 
std::enable_if<(sizeof...(XIndexTypeS)==RANK), XValueType & >::type operator() (XIndexTypeS... idx)
 access operator, accepts multiple indices (,,...,) but does no bounds checking More...
 
std::enable_if<(sizeof...(XIndexTypeS)==RANK), const XValueType & >::type operator() (XIndexTypeS... idx) const
 const reference access operator, accepts multiple indices (,,...,) but does no bounds checking More...
 
MHO_NDArrayWrapperoperator*= (const MHO_NDArrayWrapper &anArray)
 operator*= in place point-wise multiplication by another array More...
 
std::enable_if< std::is_same< XValueType, T >::value or std::is_integral< T >::value or std::is_floating_point< T >::value, MHO_NDArrayWrapper & >::type operator*= (T aScalar)
 operator*= in place multiplication by a scalar factor More...
 
MHO_NDArrayWrapperoperator+= (const MHO_NDArrayWrapper &anArray)
 operator+= in place point-wise addition by another array More...
 
std::enable_if< std::is_same< XValueType, T >::value or std::is_integral< T >::value or std::is_floating_point< T >::value, MHO_NDArrayWrapper & >::type operator+= (T aScalar)
 operator+= in place addition by a scalar amount More...
 
MHO_NDArrayWrapperoperator-= (const MHO_NDArrayWrapper &anArray)
 operator-= in place point-wise subtraction by another array More...
 
std::enable_if< std::is_same< XValueType, T >::value or std::is_integral< T >::value or std::is_floating_point< T >::value, MHO_NDArrayWrapper & >::type operator-= (T aScalar)
 operator+= in place addition by a scalar amount More...
 
MHO_NDArrayWrapperoperator= (const MHO_NDArrayWrapper &rhs)
 
XValueType & operator[] (std::size_t i)
 
const XValueType & operator[] (std::size_t i) const
 
std::enable_if<(sizeof...(XDimSizeTypeS)==RANK), void >::type Resize (XDimSizeTypeS... dim)
 Resize function that destroys contents and resizes according to dimension arguments. More...
 
void SetArray (const XValueType &obj)
 set all elements in the array to a certain value More...
 
void SetExternalData (XValueType *ptr, const std::size_t *dim)
 set data pointer to externally managed array with associated dimensions More...
 
std::enable_if<(sizeof...(XIndexTypeS)==RANK), MHO_NDArrayView< XValueType, count_instances_of_type< const char *, sizeof...(XIndexTypeS) - 1, XIndexTypeS... >::value > >::type SliceView (XIndexTypeS... idx)
 creates a slice-view of the array (given n < RANK indexes), return the remaining chunk of the array with freely spanning indexes the placeholder for the free-spanning indexes is the character ":" for example: a ndarray X of RANK=3, and sizes [4,12,32], then SliceView(":",3,":") returns an MHO_NDArrayView of RANK=2, and dimensions [4,32] starting at the location of X(0,3,0), and spanning the data covered by X(":",3,":") Data of the slice-view points to data owned by original array X More...
 
stride_iterator stride_begin (std::size_t stride)
 
stride_iterator stride_end (std::size_t stride)
 
stride_iterator stride_iterator_at (std::size_t offset, std::size_t stride)
 
std::enable_if<(sizeof...(XIndexTypeS)< RANK), MHO_NDArrayView< XValueType, RANK -(sizeof...(XIndexTypeS)) > >::type SubView (XIndexTypeS... idx)
 creates a sub-view of the array (given n < RANK leading indexes), return the remaining chunk of the array with freely spanning indexes for example: a ndarray X of RANK=3, and sizes [4,12,32], then SubView(2) returns an MHO_NDArrayView of RANK=2, and dimensions [12,32] starting at the location of X(2,0,0). Data of the subview points to data owned by X More...
 
XValueType & ValueAt (const index_type &idx)
 
const XValueType & ValueAt (const index_type &idx) const
 
void ZeroArray ()
 set all elements in the array to zero More...
 
- Public Member Functions inherited from hops::MHO_ExtensibleElement
 MHO_ExtensibleElement ()
 
virtual ~MHO_ExtensibleElement ()
 
void Accept (MHO_Visitor *aVisitor) override
 Visits all extensions of MHO_ExtensibleElement using given visitor. More...
 
template<class XExtensionType >
MHO_ExtendedElement< XExtensionType > * AsExtension ()
 Returns an extension of type XExtensionType if found in the list of extensions. More...
 
template<class XExtensionType >
bool HasExtension () const
 Checks if an extensible element has a specific extension type. More...
 
template<class XExtensionType >
MHO_ExtendedElement< XExtensionType > * MakeExtension ()
 Creates and adds a new extension of type XExtensionType to the list of extensions. More...
 
- Public Member Functions inherited from hops::MHO_Element
 MHO_Element ()
 
virtual ~MHO_Element ()
 
- Public Member Functions inherited from hops::MHO_Taggable
 MHO_Taggable ()
 
 MHO_Taggable (const MHO_Taggable &copy)
 
virtual ~MHO_Taggable ()
 
void ClearTags ()
 Clears all tags from the object. More...
 
void CopyFrom (const MHO_Taggable &copy_from_obj)
 Copies the contents of another MHO_Taggable object into this object. More...
 
virtual void CopyTags (const MHO_Taggable &rhs)
 Copies tags from rhs to this instance if rhs is not empty and has valid object. More...
 
void CopyTo (MHO_Taggable &copy_to_obj) const
 Copies the contents of this object to another MHO_Taggable object if they are not the same. More...
 
mho_json GetMetaDataAsJSON () const
 Getter for all meta data stored in this object as a json object. More...
 
MHO_Taggableoperator= (const MHO_Taggable &rhs)
 
void SetMetaDataAsJSON (mho_json obj)
 Setter for meta data as json. More...
 
- Public Member Functions inherited from hops::MHO_JSONWrapper
virtual ~MHO_JSONWrapper ()
 
void Clear ()
 Clears the internal object. More...
 
bool ContainsKey (const std::string &key) const
 Checks if a map contains a specific key. More...
 
std::vector< std::string > DumpKeys () const
 Dumps all keys from the internal object. More...
 
void DumpMap () const
 Dumps the contents of the map fObject to standard output. More...
 
bool HasKey (const char *char_key) const
 Checks if a key exists in the internal map. More...
 
bool HasKey (const std::string &key) const
 Checks if a key exists in the internal map. More...
 
template<typename XValueType >
void Insert (const std::string &key, const XValueType &value)
 Inserts or replaces an object in a map using a key and value. More...
 
MHO_JSONWrapperoperator= (const MHO_JSONWrapper &rhs)
 
template<>
bool Retrieve (const std::string &key, mho_json &value) const
 Retrieves a value from the JSON object by key and stores it in the provided reference. More...
 
template<typename XValueType >
bool Retrieve (const std::string &key, XValueType &value) const
 Retrieves a value from an object by key and casts it to the specified type. More...
 
- Public Member Functions inherited from hops::MHO_Serializable
 MHO_Serializable ()
 
 MHO_Serializable (const MHO_UUID &uuid)
 
 MHO_Serializable (std::size_t n)
 
virtual ~MHO_Serializable ()
 
MHO_UUID GetObjectUUID () const
 Getter for object uuid. More...
 
virtual MHO_UUID GetTypeUUID () const
 Getter for type uuid. More...
 
void SetObjectUUID (const MHO_UUID &uuid)
 Setter for object uuid. More...
 

Friends

template<typename XStream >
XStream & operator<< (XStream &s, const MHO_TableContainer &aData)
 
template<typename XStream >
XStream & operator>> (XStream &s, MHO_TableContainer &aData)
 

Additional Inherited Members

- Public Types inherited from hops::MHO_NDArrayWrapper< XValueType, XAxisPackType::NAXES::value >
using const_iterator = MHO_BidirectionalConstIterator< XValueType >
 
using const_stride_iterator = MHO_BidirectionalConstStrideIterator< XValueType >
 
using index_type = std::array< std::size_t, RANK >
 
using iterator = MHO_BidirectionalIterator< XValueType >
 
typedef std::integral_constant< std::size_t, RANK > rank
 
using stride_iterator = MHO_BidirectionalStrideIterator< XValueType >
 
using value_type = XValueType
 
- Protected Member Functions inherited from hops::MHO_JSONWrapper
 MHO_JSONWrapper ()
 
 MHO_JSONWrapper (const MHO_JSONWrapper &copy)
 
void SetObject (mho_json obj)
 Setter for object. More...
 
- Protected Attributes inherited from hops::MHO_ExtensibleElement
std::vector< MHO_Element * > fExtensions
 
- Protected Attributes inherited from hops::MHO_JSONWrapper
mho_json fObject
 

Detailed Description

template<typename XValueType, typename XAxisPackType>
class hops::MHO_TableContainer< XValueType, XAxisPackType >

Class MHO_TableContainer.

MHO_TableContainer - basis for large majority of data objects in HOPS4, it is an N-dimensional array object associated with coordinate axes. Additional key:value tags can be attached to this object as well as the coordinate axies.

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Sun Jan 24 14:03:03 2021 -0500

Constructor & Destructor Documentation

◆ MHO_TableContainer() [1/3]

template<typename XValueType , typename XAxisPackType >
hops::MHO_TableContainer< XValueType, XAxisPackType >::MHO_TableContainer ( )
inline

◆ MHO_TableContainer() [2/3]

template<typename XValueType , typename XAxisPackType >
hops::MHO_TableContainer< XValueType, XAxisPackType >::MHO_TableContainer ( const std::size_t *  dim)
inline

◆ MHO_TableContainer() [3/3]

template<typename XValueType , typename XAxisPackType >
hops::MHO_TableContainer< XValueType, XAxisPackType >::MHO_TableContainer ( const MHO_TableContainer< XValueType, XAxisPackType > &  obj)
inline

◆ ~MHO_TableContainer()

template<typename XValueType , typename XAxisPackType >
virtual hops::MHO_TableContainer< XValueType, XAxisPackType >::~MHO_TableContainer ( )
inlinevirtual

Member Function Documentation

◆ Clone()

template<typename XValueType , typename XAxisPackType >
MHO_TableContainer* hops::MHO_TableContainer< XValueType, XAxisPackType >::Clone ( )
inline

Clones entire table including contents and axes.

Returns
Pointer to cloned MHO_TableContainer object.

◆ CloneEmpty()

template<typename XValueType , typename XAxisPackType >
MHO_TableContainer* hops::MHO_TableContainer< XValueType, XAxisPackType >::CloneEmpty ( )
inline

Clones table container shape with empty contents and axes.

Returns
New MHO_TableContainer instance with cloned dimensions.

◆ Copy()

template<typename XValueType , typename XAxisPackType >
virtual void hops::MHO_TableContainer< XValueType, XAxisPackType >::Copy ( const MHO_TableContainer< XValueType, XAxisPackType > &  rhs)
inlinevirtual

◆ GetAxisPack() [1/2]

template<typename XValueType , typename XAxisPackType >
XAxisPackType* hops::MHO_TableContainer< XValueType, XAxisPackType >::GetAxisPack ( )
inline

access to axis pack type alone

Returns
Pointer to XAxisPackType

◆ GetAxisPack() [2/2]

template<typename XValueType , typename XAxisPackType >
const XAxisPackType* hops::MHO_TableContainer< XValueType, XAxisPackType >::GetAxisPack ( ) const
inline

Getter for axis pack.

Returns
Current instance of XAxisPackType

◆ GetSerializedSize()

template<typename XValueType , typename XAxisPackType >
virtual uint64_t hops::MHO_TableContainer< XValueType, XAxisPackType >::GetSerializedSize ( ) const
inlineoverridevirtual

Getter for serialized size.

Returns
Total serialized size as uint64_t
Note
This is a virtual function.

Reimplemented from hops::MHO_Taggable.

◆ GetVersion()

template<typename XValueType , typename XAxisPackType >
virtual MHO_ClassVersion hops::MHO_TableContainer< XValueType, XAxisPackType >::GetVersion ( ) const
inlineoverridevirtual

Getter for the class version.

Returns
MHO_ClassVersion version number.
Note
This is a virtual function.

Reimplemented from hops::MHO_Taggable.

◆ Resize()

template<typename XValueType , typename XAxisPackType >
virtual void hops::MHO_TableContainer< XValueType, XAxisPackType >::Resize ( const std::size_t *  dim)
inlineoverridevirtual

Resize the multidimensional array and axes according to given dimensions.

Parameters
dimPointer to a size_t array representing new dimensions.
Note
This is a virtual function.

Reimplemented from hops::MHO_NDArrayWrapper< XValueType, XAxisPackType::NAXES::value >.

Friends And Related Function Documentation

◆ operator<<

template<typename XValueType , typename XAxisPackType >
template<typename XStream >
XStream& operator<< ( XStream &  s,
const MHO_TableContainer< XValueType, XAxisPackType > &  aData 
)
friend

◆ operator>>

template<typename XValueType , typename XAxisPackType >
template<typename XStream >
XStream& operator>> ( XStream &  s,
MHO_TableContainer< XValueType, XAxisPackType > &  aData 
)
friend

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