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

Class MHO_Axis. More...

#include <MHO_Axis.hh>

Inheritance diagram for hops::MHO_Axis< XValueType >:
[legend]

Public Member Functions

 MHO_Axis ()
 
 MHO_Axis (const MHO_Axis &obj)
 
 MHO_Axis (std::size_t dim)
 
virtual ~MHO_Axis ()
 
virtual void Copy (const MHO_Axis &rhs)
 Expensive copy for MHO_Axis that handles special treatment of index/interval labels. More...
 
virtual void CopyTags (const MHO_Axis &rhs)
 Copies tags from rhs MHO_Axis object, handling index/interval labels specially. More...
 
virtual uint64_t GetSerializedSize () const override
 Getter for serialized size of axis object. More...
 
bool SelectFirstMatchingIndex (const XValueType &label_value, std::size_t &result)
 Selects first matching index for a given label value in axis values. More...
 
std::vector< std::size_t > SelectMatchingIndexes (const std::set< XValueType > label_values)
 Selects indexes from axis where the label values match the provided labels, dumb brute force search. More...
 
std::vector< std::size_t > SelectMatchingIndexes (const XValueType &label_value)
 Selects indexes for matching axis values (given a single value) More...
 
- Public Member Functions inherited from hops::MHO_VectorContainer< XValueType >
 MHO_VectorContainer ()
 
 MHO_VectorContainer (const MHO_VectorContainer &obj)
 
 MHO_VectorContainer (std::size_t *dim)
 
 MHO_VectorContainer (std::size_t dim)
 
virtual ~MHO_VectorContainer ()
 
MHO_VectorContainerClone ()
 Clones the current MHO_VectorContainer object. More...
 
uint64_t ComputeSerializedSize () const
 Calculates and returns the serialized size as a uint64_t. More...
 
uint64_t ComputeSerializedSize () const
 Function MHO_VectorContainer<std::string>::ComputeSerializedSize - specialization for string elements. More...
 
virtual void Copy (const MHO_VectorContainer &rhs)
 Expensive copy for MHO_VectorContainer, pointers to exernally managed memory are not transferred, but data is. More...
 
virtual MHO_ClassVersion GetVersion () const override
 Getter for version. More...
 
- Public Member Functions inherited from hops::MHO_NDArrayWrapper< XValueType, 1 >
 MHO_NDArrayWrapper ()
 
 MHO_NDArrayWrapper (const MHO_NDArrayWrapper &obj)
 
 MHO_NDArrayWrapper (const std::size_t *dim)
 
 MHO_NDArrayWrapper (std::size_t dim)
 
 MHO_NDArrayWrapper (XValueType *ptr, const std::size_t *dim)
 
 MHO_NDArrayWrapper (XValueType *ptr, std::size_t dim)
 
virtual ~MHO_NDArrayWrapper ()
 
XValueType & at (std::size_t idx)
 
const XValueType & at (std::size_t idx) const
 
iterator begin ()
 
const_iterator cbegin () const
 
const_iterator cend () const
 
const_iterator citerator_at (std::size_t offset) const
 
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 ()
 Getter for data. More...
 
const XValueType * GetData () const
 Getter for data. More...
 
std::size_t GetDimension (std::size_t idx) const
 
index_type GetDimensionArray () const
 Getter for dimension array. More...
 
const std::size_t * GetDimensions () const
 Getter for dimensions. More...
 
void GetDimensions (std::size_t *dim) const
 Getter for dimensions. More...
 
index_type GetIndicesForOffset (std::size_t offset)
 
std::size_t GetOffsetForIndices (const std::size_t *index)
 
std::size_t GetRank () const
 Getter for rank. More...
 
std::size_t GetSize () const
 Getter for size. More...
 
std::size_t GetStride (std::size_t idx) const
 
index_type GetStrideArray () const
 
const std::size_t * GetStrides () const
 
void GetStrides (std::size_t *strd) const
 
iterator iterator_at (std::size_t offset)
 
XValueType & operator() (std::size_t idx)
 
const XValueType & operator() (std::size_t idx) const
 
MHO_NDArrayWrapperoperator*= (const MHO_NDArrayWrapper &anArray)
 
template<typename T >
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)
 
MHO_NDArrayWrapperoperator+= (const MHO_NDArrayWrapper &anArray)
 
template<typename T >
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)
 
MHO_NDArrayWrapperoperator-= (const MHO_NDArrayWrapper &anArray)
 
template<typename T >
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)
 
MHO_NDArrayWrapperoperator= (const MHO_NDArrayWrapper &rhs)
 
XValueType & operator[] (std::size_t i)
 
const XValueType & operator[] (std::size_t i) const
 
virtual void Resize (const std::size_t *dim)
 Resize an externally managed array using provided dimensions. More...
 
void Resize (std::size_t dim)
 Sets dimensions for externally managed array. More...
 
void SetArray (const XValueType &obj)
 
void SetExternalData (XValueType *ptr, const std::size_t *dim)
 Setter for external data. More...
 
void SetExternalData (XValueType *ptr, std::size_t dim)
 Setter for external data. More...
 
MHO_NDArrayView< XValueType, 1 > SliceView (const char *)
 
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)
 
template<typename... XIndexTypeS>
std::enable_if<(sizeof...(XIndexTypeS)< 1), MHO_NDArrayWrapper< XValueType, 1 -(sizeof...(XIndexTypeS)) > >::type SubView (XIndexTypeS... idx)
 
XValueType & ValueAt (const index_type &idx)
 
const XValueType & ValueAt (const index_type &idx) const
 
void ZeroArray ()
 
- 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...
 
- Public Member Functions inherited from hops::MHO_IndexLabelInterface
virtual ~MHO_IndexLabelInterface ()
 
void ClearIndexLabels ()
 Clears all index labels. More...
 
std::size_t GetIndexLabelSize () const
 Getter for index label size. More...
 
mho_jsonGetLabelObject (std::size_t index)
 get a reference to the dictionary object associated with this index More...
 
mho_json GetLabelObject (std::size_t index) const
 Getter for label object. More...
 
std::vector< std::size_t > GetMatchingIndexes (std::string &key) const
 get a vector of indexes which contain a key with the same name More...
 
template<typename XValueType >
std::vector< std::size_t > GetMatchingIndexes (std::string &key, const XValueType &value) const
 Get a vector of indexes which contain a key with a value which matches the passed value. More...
 
template<typename XValueType >
void InsertIndexLabelKeyValue (std::size_t index, const std::string &key, const XValueType &value)
 Function InsertIndexLabelKeyValue. More...
 
template<typename XValueType >
bool RetrieveIndexLabelKeyValue (std::size_t index, const std::string &key, XValueType &value) const
 Retrieves value associated with given key and index from IndexLabelObjectPtr if it exists. More...
 
void SetLabelObject (mho_json &obj, std::size_t index)
 get a reference to the dictionary object associated with this index More...
 
- Public Member Functions inherited from hops::MHO_IntervalLabelInterface
virtual ~MHO_IntervalLabelInterface ()
 
void ClearIntervalLabels ()
 Clears interval labels by setting *fIntervalLabelObjectPtr to an empty json object. More...
 
bool ExtractIndexesFromKey (const std::string &key, std::size_t &lower_index, std::size_t &upper_index)
 Extracts lower and upper indexes from a key string separated by comma. More...
 
template<typename XLabelValueType >
mho_json GetFirstIntervalWithKeyValue (std::string key, const XLabelValueType &value) const
 Getter for first interval with key value. More...
 
mho_jsonGetIntervalLabelObject (std::size_t lower_index, std::size_t upper_index)
 Get a reference to the dictionary object associated with this index. More...
 
std::vector< mho_jsonGetMatchingIntervalLabels (std::string key) const
 get a vector of interval labels which contain a key with the same name More...
 
template<typename XValueType >
void InsertIntervalLabelKeyValue (std::size_t lower_index, std::size_t upper_index, const std::string &key, const XValueType &value)
 Inserts an interval label key-value pair into a map referenced by fIntervalLabelObjectPtr. More...
 
template<typename XValueType >
bool RetrieveIntervalLabelKeyValue (std::size_t lower_index, std::size_t upper_index, const std::string &key, const XValueType &value) const
 Retrieves a value associated with a key within an interval range. More...
 
void SetIntervalLabelObject (mho_json &obj, std::size_t lower_index, std::size_t upper_index)
 Setter for interval label object. More...
 

Friends

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

Additional Inherited Members

- Public Types inherited from hops::MHO_NDArrayWrapper< XValueType, 1 >
using const_iterator = MHO_BidirectionalConstIterator< XValueType >
 
using const_stride_iterator = MHO_BidirectionalConstStrideIterator< XValueType >
 
using index_type = std::array< std::size_t, 1 >
 
using iterator = MHO_BidirectionalIterator< XValueType >
 
typedef std::integral_constant< std::size_t, 1 > rank
 
using stride_iterator = MHO_BidirectionalStrideIterator< XValueType >
 
using value_type = XValueType
 
- Static Public Member Functions inherited from hops::MHO_IntervalLabelInterface
static std::string ConstructKey (std::size_t lower_index, std::size_t upper_index)
 Constructs a key string from lower and upper indices, ensuring lower_index <= upper_index. More...
 
static std::pair< std::size_t, std::size_t > ExtractIndexesFromKey (const std::string &key)
 Extracts lower and upper indexes from a key string separated by comma. More...
 
- 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 Member Functions inherited from hops::MHO_IndexLabelInterface
 MHO_IndexLabelInterface ()
 
 MHO_IndexLabelInterface (const MHO_IndexLabelInterface &copy)
 
void SetIndexLabelObject (mho_json *obj)
 Setter for index label object. More...
 
- Protected Member Functions inherited from hops::MHO_IntervalLabelInterface
 MHO_IntervalLabelInterface ()
 
 MHO_IntervalLabelInterface (const MHO_IntervalLabelInterface &copy)
 
void SetIntervalLabelObject (mho_json *obj)
 Setter for interval label 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>
class hops::MHO_Axis< XValueType >

Class MHO_Axis.

A class representing a coordinate axis, inherits from MHO_VectorContainer.

Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du
Date
Mon Oct 19 11:34:27 2020 -0400

Constructor & Destructor Documentation

◆ MHO_Axis() [1/3]

template<typename XValueType >
hops::MHO_Axis< XValueType >::MHO_Axis ( )
inline

◆ MHO_Axis() [2/3]

template<typename XValueType >
hops::MHO_Axis< XValueType >::MHO_Axis ( std::size_t  dim)
inline

◆ MHO_Axis() [3/3]

template<typename XValueType >
hops::MHO_Axis< XValueType >::MHO_Axis ( const MHO_Axis< XValueType > &  obj)
inline

◆ ~MHO_Axis()

template<typename XValueType >
virtual hops::MHO_Axis< XValueType >::~MHO_Axis ( )
inlinevirtual

Member Function Documentation

◆ Copy()

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

Expensive copy for MHO_Axis that handles special treatment of index/interval labels.

Parameters
rhsConst reference to source MHO_Axis object
Note
This is a virtual function.

expensive copy (as opposed to the assignment operator), pointers to exernally managed memory are not transferred

◆ CopyTags()

template<typename XValueType >
virtual void hops::MHO_Axis< XValueType >::CopyTags ( const MHO_Axis< XValueType > &  rhs)
inlinevirtual

Copies tags from rhs MHO_Axis object, handling index/interval labels specially.

Parameters
rhsReference to the source MHO_Axis object
Note
This is a virtual function.

◆ GetSerializedSize()

template<typename XValueType >
virtual uint64_t hops::MHO_Axis< XValueType >::GetSerializedSize ( ) const
inlineoverridevirtual

Getter for serialized size of axis object.

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

Reimplemented from hops::MHO_VectorContainer< XValueType >.

◆ SelectFirstMatchingIndex()

template<typename XValueType >
bool hops::MHO_Axis< XValueType >::SelectFirstMatchingIndex ( const XValueType &  label_value,
std::size_t &  result 
)
inline

Selects first matching index for a given label value in axis values.

Parameters
label_valueInput label value to match.
result(std::size_t&)
Returns
True if a match is found, false otherwise. Result contains matched index.

◆ SelectMatchingIndexes() [1/2]

template<typename XValueType >
std::vector< std::size_t > hops::MHO_Axis< XValueType >::SelectMatchingIndexes ( const std::set< XValueType >  label_values)
inline

Selects indexes from axis where the label values match the provided labels, dumb brute force search.

Parameters
label_valuesSet of label values to match against axis elements
Returns
Vector of matching indexes

◆ SelectMatchingIndexes() [2/2]

template<typename XValueType >
std::vector< std::size_t > hops::MHO_Axis< XValueType >::SelectMatchingIndexes ( const XValueType &  label_value)
inline

Selects indexes for matching axis values (given a single value)

Parameters
label_value(const XValueType&)
Returns
Vector of selected indexes where axis element matches the label value

Friends And Related Function Documentation

◆ operator<<

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

◆ operator>>

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

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