26 template<
typename XValueType >
63 if(obj.
fObject.contains(
"index_labels"))
67 if(obj.
fObject.contains(
"interval_labels"))
87 if(
this != &rhs && !(rhs.
fObject.empty()))
90 if(this->
fObject.contains(
"index_labels"))
94 if(this->
fObject.contains(
"interval_labels"))
119 std::vector< std::size_t > selected_idx;
122 for(
auto label_it = label_values.begin(); label_it != label_values.end(); label_it++)
124 for(std::size_t i = 0; i < this->
GetSize(); i++)
126 if((*
this)[i] == *label_it)
128 selected_idx.push_back(i);
143 std::vector< std::size_t > selected_idx;
146 for(std::size_t i = 0; i < this->
GetSize(); i++)
148 if((*
this)[i] == label_value)
150 selected_idx.push_back(i);
167 for(std::size_t i = 0; i < this->
GetSize(); i++)
169 if((*
this)[i] == label_value)
186 uint64_t total_size = 0;
206 if(this->
fObject.contains(
"index_labels"))
211 if(this->
fObject.contains(
"interval_labels"))
230 aData.StreamInData_V0(s);
246 aData.StreamOutData_V0(s);
250 "error, cannot stream out MHO_Axis object with unknown version: " << aData.
GetVersion() << eom);
262 template<
typename XStream >
void StreamInData_V0(XStream& s)
266 if(this->
fObject.contains(
"index_labels"))
270 if(this->
fObject.contains(
"interval_labels"))
282 template<
typename XStream >
void StreamOutData_V0(XStream& s)
const
284 s << static_cast< const MHO_VectorContainer< XValueType >& >(*this);
287 virtual MHO_UUID DetermineTypeUUID()
const override
289 MHO_MD5HashGenerator gen;
294 return gen.GetDigestAsUUID();
#define msg_error(xKEY, xCONTENT)
Definition: MHO_Message.hh:238
Definition: MHO_Meta.hh:408
Class MHO_Axis.
Definition: MHO_Axis.hh:31
virtual ~MHO_Axis()
Definition: MHO_Axis.hh:76
virtual uint64_t GetSerializedSize() const override
Getter for serialized size of axis object.
Definition: MHO_Axis.hh:184
bool SelectFirstMatchingIndex(const XValueType &label_value, std::size_t &result)
Selects first matching index for a given label value in axis values.
Definition: MHO_Axis.hh:164
virtual void Copy(const MHO_Axis &rhs)
Expensive copy for MHO_Axis that handles special treatment of index/interval labels.
Definition: MHO_Axis.hh:200
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.
Definition: MHO_Axis.hh:117
friend XStream & operator<<(XStream &s, const MHO_Axis &aData)
Definition: MHO_Axis.hh:240
std::vector< std::size_t > SelectMatchingIndexes(const XValueType &label_value)
Selects indexes for matching axis values (given a single value)
Definition: MHO_Axis.hh:141
friend XStream & operator>>(XStream &s, MHO_Axis &aData)
Definition: MHO_Axis.hh:223
MHO_Axis(std::size_t dim)
Definition: MHO_Axis.hh:46
MHO_Axis()
Definition: MHO_Axis.hh:34
virtual void CopyTags(const MHO_Axis &rhs)
Copies tags from rhs MHO_Axis object, handling index/interval labels specially.
Definition: MHO_Axis.hh:85
MHO_Axis(const MHO_Axis &obj)
Definition: MHO_Axis.hh:60
Class MHO_IndexLabelInterface - adds indexes associated with key:value pairs (used by MHO_Axis) const...
Definition: MHO_IndexLabelInterface.hh:22
void SetIndexLabelObject(mho_json *obj)
Setter for index label object.
Definition: MHO_IndexLabelInterface.hh:37
Class MHO_IntervalLabelInterface - adds intervals with associated key:value pairs (used by MHO_Axis) ...
Definition: MHO_IntervalLabelInterface.hh:22
void SetIntervalLabelObject(mho_json *obj)
Setter for interval label object.
Definition: MHO_IntervalLabelInterface.hh:44
mho_json fObject
Definition: MHO_JSONHeaderWrapper.hh:43
std::size_t GetSize() const
Getter for size.
Definition: MHO_NDArrayWrapper_1.hh:99
MHO_VectorContainer - basis for for axis data objects in HOPS4, it is an 1-dimensional array object,...
Definition: MHO_VectorContainer.hh:27
virtual MHO_ClassVersion GetVersion() const override
Getter for version.
Definition: MHO_VectorContainer.hh:54
virtual void Copy(const MHO_VectorContainer &rhs)
Expensive copy for MHO_VectorContainer, pointers to exernally managed memory are not transferred,...
Definition: MHO_VectorContainer.hh:80
virtual uint64_t GetSerializedSize() const override
Getter for serialized size.
Definition: MHO_VectorContainer.hh:62
Definition: MHO_AdhocFlagging.hh:18
uint32_t MHO_ClassVersion
Definition: MHO_ClassIdentity.hh:22
static void ClassVersionErrorMsg(const XClassType &obj, MHO_ClassVersion version)
Generates an error message for when an unknown or unsupported class version is encountered.
Definition: MHO_ClassIdentity.hh:112
static std::string ClassName()
Returns the class name as a string.
Definition: MHO_ClassIdentity.hh:51
static void SetUnknown(XStreamType &)
Setter for unknown.
Definition: MHO_FileStreamer.hh:214