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;
208 if(this->
fObject.contains(
"index_labels"))
213 if(this->
fObject.contains(
"interval_labels"))
232 aData.StreamInData_V0(s);
248 aData.StreamOutData_V0(s);
252 "error, cannot stream out MHO_Axis object with unknown version: " << aData.
GetVersion() << eom);
264 template<
typename XStream >
void StreamInData_V0(XStream& s)
268 if(this->
fObject.contains(
"index_labels"))
272 if(this->
fObject.contains(
"interval_labels"))
284 template<
typename XStream >
void StreamOutData_V0(XStream& s)
const
286 s << static_cast< const MHO_VectorContainer< XValueType >& >(*this);
289 virtual MHO_UUID DetermineTypeUUID()
const override
291 MHO_MD5HashGenerator gen;
296 return gen.GetDigestAsUUID();
#define msg_error(xKEY, xCONTENT)
Definition: MHO_Message.hh:244
Definition: MHO_Meta.hh:378
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:202
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:242
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:225
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:23
void SetIndexLabelObject(mho_json *obj)
Setter for index label object.
Definition: MHO_IndexLabelInterface.hh:38
Class MHO_IntervalLabelInterface - adds intervals with associated key:value pairs (used by MHO_Axis) ...
Definition: MHO_IntervalLabelInterface.hh:23
void SetIntervalLabelObject(mho_json *obj)
Setter for interval label object.
Definition: MHO_IntervalLabelInterface.hh:45
mho_json fObject
Definition: MHO_JSONHeaderWrapper.hh:43
std::size_t GetSize() const
Getter for size.
Definition: MHO_NDArrayWrapper_1.hh:107
MHO_VectorContainer - basis for for axis data objects in HOPS4, it is an 1-dimensional array object,...
Definition: MHO_VectorContainer.hh:28
virtual MHO_ClassVersion GetVersion() const override
Getter for version.
Definition: MHO_VectorContainer.hh:55
virtual void Copy(const MHO_VectorContainer &rhs)
Expensive copy for MHO_VectorContainer, pointers to exernally managed memory are not transferred,...
Definition: MHO_VectorContainer.hh:82
virtual uint64_t GetSerializedSize() const override
Getter for serialized size.
Definition: MHO_VectorContainer.hh:63
Definition: MHO_ChannelLabeler.hh:17
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:99
static std::string ClassName()
Returns the class name as a string.
Definition: MHO_ClassIdentity.hh:36
static void SetUnknown(XStreamType &)
Setter for unknown.
Definition: MHO_FileStreamer.hh:215