Class MultiMessage
Defined in File multi.hpp
Base Type
public morpheus::DerivedMultiMessage< MultiMessage >
(Template Class DerivedMultiMessage)
-
class MultiMessage : public morpheus::DerivedMultiMessage<MultiMessage>
This class holds data for multiple messages (rows in a DataFrame) at a time. To avoid copying data for slicing operations, it holds a reference to a batched metadata object and stores the offset and count into that batch.
Public Functions
- MultiMessage(const MultiMessage &other) = default
Default copy constructor.
Construct a new Multi Message object.
- Parameters
m – : Deserialized messages metadata for large batch
o – : Offset into the metadata batch
c – : Messages count
-
TableInfo get_meta(const std::string &col_name)
Returns column value from a meta object.
- Parameters
- Throws
std::runtime_error –
std::runtime_error –
- Returns
col_name –
-
TableInfo get_meta(const std::vector<std::string> &column_names)
Returns columns value from a meta object. When
columns_names
is empty all columns are returned.- Parameters
- Throws
- Returns
column_names –
std::runtime_error –
-
void set_meta(const std::string &col_name, TensorObject tensor)
Set the meta object with a given column name.
- Parameters
col_name –
tensor –
-
void set_meta(const std::vector<std::string> &column_names, const std::vector<TensorObject> &tensors)
Set the meta object with a given column names.
- Parameters
column_names –
tensors –
Public Members
- std::shared_ptr<MessageMeta> meta
- TensorIndex mess_offset = {0}
- TensorIndex mess_count = {0}
Protected Functions
Applies a slice of the attribures contained in
new_message
. Subclasses need only be concerned with their own attributes, and can safely avoid overriding this method if they don’t add any new attributes to their base.- Parameters
new_message –
start –
stop –
Similar to
get_slice_impl
, performs a copy of all attributes innew_message
according to the rows specified byranges
. Subclasses need only be concerned with copying their own attributes, and can safely avoid overriding this method if they don’t add any new attributes to their base.- Parameters
new_message –
ranges –
num_selected_rows –
-
virtual std::shared_ptr<MessageMeta> copy_meta_ranges(const std::vector<RangeType> &ranges) const
Creates a deep copy of
meta
with the specified ranges.- Parameters
- Returns
ranges –
std::shared_ptr<MessageMeta>
-
std::vector<RangeType> apply_offset_to_ranges(TensorIndex offset, const std::vector<RangeType> &ranges) const
Applies the message offset to the elements in
ranges
casting the results toTensorIndex
- Parameters
offset –
ranges –
- Returns
std::vector<RangeType>