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>
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
◆ MHO_IndexLabelInterface() [1/2]
hops::MHO_IndexLabelInterface::MHO_IndexLabelInterface |
( |
| ) |
|
|
inlineprotected |
◆ MHO_IndexLabelInterface() [2/2]
◆ ~MHO_IndexLabelInterface()
virtual hops::MHO_IndexLabelInterface::~MHO_IndexLabelInterface |
( |
| ) |
|
|
inlinevirtual |
◆ ClearIndexLabels()
void hops::MHO_IndexLabelInterface::ClearIndexLabels |
( |
| ) |
|
|
inline |
◆ 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
-
index | Index 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
-
index | Index 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
-
key | Input 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
-
XValueType | Template parameter XValueType |
- Parameters
-
key | Input 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
-
XValueType | Template 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
-
XValueType | Template parameter XValueType |
- Parameters
-
index | Index to retrieve key-value pair for |
key | Key to search for in IndexLabelObjectPtr |
value | Reference 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
-
obj | Pointer 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: