mirror of
https://github.com/paulscherrerinstitute/sf_daq_buffer.git
synced 2026-05-03 16:34:13 +02:00
Shared pointer instead of value copy
This commit is contained in:
+1
-1
@@ -22,7 +22,7 @@ struct FrameMetadata
|
||||
std::vector<size_t> frame_shape;
|
||||
|
||||
// Pass additional header values.
|
||||
std::map<std::string, boost::any> header_values;
|
||||
std::map<std::string, std::shared_ptr<boost::any>> header_values;
|
||||
};
|
||||
|
||||
class RingBuffer
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ shared_ptr<FrameMetadata> ZmqReceiver::read_json_header(const string& header)
|
||||
|
||||
const auto& name = value_mapping.first;
|
||||
const auto& data_type = value_mapping.second;
|
||||
const boost::any& value = get_value_from_json(json_header, name, data_type);
|
||||
auto value = make_shared<boost::any>(get_value_from_json(json_header, name, data_type));
|
||||
|
||||
header_data->header_values.insert(
|
||||
{name, value}
|
||||
|
||||
Reference in New Issue
Block a user