HOPS
HOPS class reference
Public Member Functions | Protected Member Functions | List of all members
hops::MHO_IndexLabelInterface Class Reference

Class MHO_IndexLabelInterface - adds indexes associated with key:value pairs (used by MHO_Axis) constructor is protected this class is only intended to provide an interface that derived classes may inherit this interface is to enforce a specific access pattern associated with modifying meta data attached to a vector/axis like object that is in the form of a mho_json::array_t. More...

#include <MHO_IndexLabelInterface.hh>

Inheritance diagram for hops::MHO_IndexLabelInterface:
[legend]

Public Member Functions

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...
 

Protected Member Functions

 MHO_IndexLabelInterface ()
 
 MHO_IndexLabelInterface (const MHO_IndexLabelInterface &copy)
 
void SetIndexLabelObject (mho_json *obj)
 Setter for index label object. More...
 

Detailed Description

Class MHO_IndexLabelInterface - adds indexes associated with key:value pairs (used by MHO_Axis) constructor is protected this class is only intended to provide an interface that derived classes may inherit this interface is to enforce a specific access pattern associated with modifying meta data attached to a vector/axis like object that is in the form of a mho_json::array_t.

Date
Sun Feb 4 17:21:38 2024 -0500
Author
J. Barrett - barre.nosp@m.ttj@.nosp@m.mit.e.nosp@m.du

Constructor & Destructor Documentation

◆ MHO_IndexLabelInterface() [1/2]

hops::MHO_IndexLabelInterface::MHO_IndexLabelInterface ( )
inlineprotected

◆ MHO_IndexLabelInterface() [2/2]

hops::MHO_IndexLabelInterface::MHO_IndexLabelInterface ( const MHO_IndexLabelInterface copy)
inlineprotected

◆ ~MHO_IndexLabelInterface()

virtual hops::MHO_IndexLabelInterface::~MHO_IndexLabelInterface ( )
inlinevirtual

Member Function Documentation

◆ ClearIndexLabels()

void hops::MHO_IndexLabelInterface::ClearIndexLabels ( )
inline

Clears all index labels.

◆ GetIndexLabelSize()

std::size_t hops::MHO_IndexLabelInterface::GetIndexLabelSize ( ) const
inline

Getter for index label size.

Returns
Size of the index label object as std::size_t

◆ GetLabelObject() [1/2]

mho_json& hops::MHO_IndexLabelInterface::GetLabelObject ( std::size_t  index)
inline

get a reference to the dictionary object associated with this index

Parameters
indexIndex of type std::size_t used to locate the label object.
Returns
Reference to the mho_json object associated with the given index, or a dummy object if the index label interface is missing.

◆ GetLabelObject() [2/2]

mho_json hops::MHO_IndexLabelInterface::GetLabelObject ( std::size_t  index) const
inline

Getter for label object.

Parameters
indexIndex of type std::size_t for retrieving label object
Returns
mho_json reference to label object if found, otherwise dummy object

◆ GetMatchingIndexes() [1/2]

std::vector< std::size_t > hops::MHO_IndexLabelInterface::GetMatchingIndexes ( std::string &  key) const
inline

get a vector of indexes which contain a key with the same name

Parameters
keyInput key to search for
Returns
Vector of matching indexes

◆ GetMatchingIndexes() [2/2]

template<typename XValueType >
std::vector< std::size_t > hops::MHO_IndexLabelInterface::GetMatchingIndexes ( std::string &  key,
const XValueType &  value 
) const
inline

Get a vector of indexes which contain a key with a value which matches the passed value.

Template Parameters
XValueTypeTemplate parameter XValueType
Parameters
keyInput key string to match
value(const XValueType&)
Returns
Vector of matching indexes

◆ InsertIndexLabelKeyValue()

template<typename XValueType >
void hops::MHO_IndexLabelInterface::InsertIndexLabelKeyValue ( std::size_t  index,
const std::string &  key,
const XValueType &  value 
)
inline

Function InsertIndexLabelKeyValue.

Template Parameters
XValueTypeTemplate parameter XValueType
Parameters
index(std::size_t)
key(const std::string&)
value(const XValueType&)

◆ RetrieveIndexLabelKeyValue()

template<typename XValueType >
bool hops::MHO_IndexLabelInterface::RetrieveIndexLabelKeyValue ( std::size_t  index,
const std::string &  key,
XValueType &  value 
) const
inline

Retrieves value associated with given key and index from IndexLabelObjectPtr if it exists.

Template Parameters
XValueTypeTemplate parameter XValueType
Parameters
indexIndex to retrieve key-value pair for
keyKey to search for in IndexLabelObjectPtr
valueReference to store retrieved value of type XValueType
Returns
True if retrieval was successful, false otherwise

◆ SetIndexLabelObject()

void hops::MHO_IndexLabelInterface::SetIndexLabelObject ( mho_json obj)
inlineprotected

Setter for index label object.

Parameters
objPointer to mho_json object

◆ SetLabelObject()

void hops::MHO_IndexLabelInterface::SetLabelObject ( mho_json obj,
std::size_t  index 
)
inline

get a reference to the dictionary object associated with this index

Parameters
obj(mho_json&)
index(std::size_t)

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