Skip to content

Commit

Permalink
fixup! change realdds::topics::device_info to be json-based
Browse files Browse the repository at this point in the history
change && to const &, per CR
  • Loading branch information
maloel committed Dec 27, 2023
1 parent 48ef97f commit f8ae6df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions third-party/realdds/include/realdds/topics/device-info-msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ class device_info
//bool locked = true;

std::string const & name() const;
void set_name( std::string && );
void set_name( std::string const & );

std::string const & topic_root() const;
void set_topic_root( std::string && );
void set_topic_root( std::string const & );

std::string const & serial_number() const;
void set_serial_number( std::string && );
void set_serial_number( std::string const & );

nlohmann::json const & to_json() const;
static device_info from_json( nlohmann::json const & j );
static device_info from_json( nlohmann::json const & );

// Substring of information already stored in the device-info that can be used to print the device 'name'.
// (mostly for use with debug messages)
Expand Down
12 changes: 6 additions & 6 deletions third-party/realdds/src/topics/device-info-msg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ std::string const & device_info::name() const
return rsutils::json::nested( _json, name_key ).string_ref_or_empty();
}

void device_info::set_name( std::string && v )
void device_info::set_name( std::string const & v )
{
_json[name_key] = std::move( v );
_json[name_key] = v;
}


Expand All @@ -54,9 +54,9 @@ std::string const & device_info::topic_root() const
return rsutils::json::nested( _json, topic_root_key ).string_ref_or_empty();
}

void device_info::set_topic_root( std::string && v )
void device_info::set_topic_root( std::string const & v )
{
_json[topic_root_key] = std::move( v );
_json[topic_root_key] = v;
}


Expand All @@ -65,9 +65,9 @@ std::string const & device_info::serial_number() const
return rsutils::json::nested( _json, serial_number_key ).string_ref_or_empty();
}

void device_info::set_serial_number( std::string && v )
void device_info::set_serial_number( std::string const & v )
{
_json[serial_number_key] = std::move( v );
_json[serial_number_key] = v;
}


Expand Down

0 comments on commit f8ae6df

Please sign in to comment.