Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Development/nmos-cpp-node/node_implementation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1293,7 +1293,7 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr

utility::ostringstream_t role;
role << U("receiver-monitor-") << ++count;
const auto& receiver = nmos::find_resource(model.node_resources, receiver_id);
const auto receiver = nmos::find_resource(model.node_resources, receiver_id);
auto receiver_monitor = nmos::make_receiver_monitor(++oid, true, receivers_block_oid, role.str(), nmos::fields::label(receiver->data), nmos::fields::description(receiver->data), value_of({ { nmos::nc::details::make_touchpoint_nmos({nmos::ncp_touchpoint_resource_types::receiver, receiver_id}) } }));
// optionally indicate dependencies within the device model
nmos::set_object_dependency_paths(receiver_monitor, {{U("root"), U("receivers")}});
Expand All @@ -1314,7 +1314,7 @@ void node_implementation_init(nmos::node_model& model, nmos::experimental::contr

utility::ostringstream_t role;
role << U("sender-monitor-") << ++count;
const auto& sender = nmos::find_resource(model.node_resources, sender_id);
const auto sender = nmos::find_resource(model.node_resources, sender_id);
const auto sender_monitor = nmos::make_sender_monitor(++oid, true, nmos::root_block_oid, role.str(), nmos::fields::label(sender->data), nmos::fields::description(sender->data), value_of({ { nmos::nc::details::make_touchpoint_nmos({nmos::ncp_touchpoint_resource_types::sender, sender_id}) } }));

// add sender-monitor to root-block
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/configuration_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace nmos
{
// get resource based on the oid
const auto& oid = nmos::fields::nc::oid(member);
const auto& found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
build_role_paths(resources, *found, role_path, role_paths);
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/configuration_methods.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace nmos

for (const auto& member : members)
{
const auto& found = find_resource(resources, utility::s2us(std::to_string(nmos::fields::nc::oid(member))));
const auto found = find_resource(resources, utility::s2us(std::to_string(nmos::fields::nc::oid(member))));

if (resources.end() != found)
{
Expand Down
4 changes: 2 additions & 2 deletions Development/nmos/configuration_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ namespace nmos
{
// If constant oid then check oid from property holder and verify with oid from block member
// Is this oid already in use?
const auto& child = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto child = find_resource(resources, utility::s2us(std::to_string(oid)));

if (resources.end() != child)
{
Expand Down Expand Up @@ -577,7 +577,7 @@ namespace nmos

while (utility::s2us(std::to_string(nmos::root_block_oid)) != oid.as_string())
{
const auto& found = nmos::find_resource(resources, utility::s2us(std::to_string(nmos::fields::nc::owner(found_resource.data))));
const auto found = nmos::find_resource(resources, utility::s2us(std::to_string(nmos::fields::nc::owner(found_resource.data))));
if (resources.end() == found)
{
break;
Expand Down
22 changes: 11 additions & 11 deletions Development/nmos/control_protocol_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ namespace nmos
{
// get resource based on the oid
const auto& oid = nmos::fields::nc::oid(*member_found);
const auto& found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
return get_nc_block_member_descriptor(resources, *found, role_path_segments);
Expand Down Expand Up @@ -411,7 +411,7 @@ namespace nmos
auto transition_counter = get_property(resources, oid, status_transition_counter_property_id, get_control_protocol_class_descriptor, gate).as_integer();
set_property_and_notify(resources, oid, status_transition_counter_property_id, ++transition_counter, get_control_protocol_class_descriptor, gate);
}
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
if (nmos::nc::is_sender_monitor(parse_class_id(nmos::fields::nc::class_id(found->data))))
Expand Down Expand Up @@ -721,7 +721,7 @@ namespace nmos
{
// get resource based on the oid
const auto& oid = nmos::fields::nc::oid(member);
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
nc::get_member_descriptors(resources, *found, recurse, descriptors);
Expand Down Expand Up @@ -775,7 +775,7 @@ namespace nmos
{
// get resource based on the oid
const auto& oid = nmos::fields::nc::oid(member);
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
nc::find_members_by_role(resources, *found, role, match_whole_string, case_sensitive, recurse, descriptors);
Expand Down Expand Up @@ -823,7 +823,7 @@ namespace nmos
{
// get resource based on the oid
const auto& oid = nmos::fields::nc::oid(member);
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
nc::find_members_by_class_id(resources, *found, class_id_, include_derived, recurse, descriptors);
Expand Down Expand Up @@ -1025,7 +1025,7 @@ namespace nmos
if (!block_member_descriptor.is_null())
{
const auto& oid = nmos::fields::nc::oid(block_member_descriptor);
const auto& found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = nmos::find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
return found;
Expand Down Expand Up @@ -1113,7 +1113,7 @@ namespace nmos
web::json::value get_property(const resources& resources, nc_oid oid, const nc_property_id& property_id, get_control_protocol_class_descriptor_handler get_control_protocol_class_descriptor, slog::base_gate& gate)
{
// get resource based on the oid
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
// find the relevant nc_property_descriptor
Expand All @@ -1130,7 +1130,7 @@ namespace nmos

bool set_property_and_notify(resources& resources, nc_oid oid, const nc_property_id& property_id, const web::json::value& value, get_control_protocol_class_descriptor_handler get_control_protocol_class_descriptor, slog::base_gate& gate)
{
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
const auto& property = nc::find_property_descriptor(property_id, nc::details::parse_class_id(nmos::fields::nc::class_id(found->data)), get_control_protocol_class_descriptor);
Expand Down Expand Up @@ -1184,7 +1184,7 @@ namespace nmos
web::json::value get_property(const resources& resources, nc_oid oid, const utility::string_t& property_name, slog::base_gate& gate)
{
// get resource based on the oid
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found)
{
// find the relevant nc_property_descriptor
Expand Down Expand Up @@ -1323,7 +1323,7 @@ namespace nmos
// domain specific statuses offering an Inactive option MUST transition immediately to the Healthy state.
// Furthermore, after activation, as long as the monitor isn't being deactivated, it MUST delay the reporting
// of non Healthy states for the duration specified by statusReportingDelay, and then transition to any other appropriate state.
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found && nc::is_status_monitor(nc::details::parse_class_id(nmos::fields::nc::class_id(found->data))))
{
const auto& class_id = nc::details::parse_class_id(nmos::fields::nc::class_id(found->data));
Expand Down Expand Up @@ -1382,7 +1382,7 @@ namespace nmos

bool deactivate_monitor(resources& resources, nc_oid oid, get_control_protocol_class_descriptor_handler get_control_protocol_class_descriptor, slog::base_gate& gate)
{
const auto& found = find_resource(resources, utility::s2us(std::to_string(oid)));
const auto found = find_resource(resources, utility::s2us(std::to_string(oid)));
if (resources.end() != found && nc::is_status_monitor(nc::details::parse_class_id(nmos::fields::nc::class_id(found->data))))
{
const auto& class_id = nc::details::parse_class_id(nmos::fields::nc::class_id(found->data));
Expand Down
2 changes: 1 addition & 1 deletion Development/nmos/test/configuration_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ BST_TEST_CASE(testApplyBackupDataSet)
};

// Capture initial state of device model so we can reset after each check
const auto& root_resource = nmos::nc::find_resource_by_role_path(resources, value_of({ U("root") }).as_array());
const auto root_resource = nmos::nc::find_resource_by_role_path(resources, value_of({ U("root") }).as_array());
auto initial_backup_dataset = nmos::get_properties_by_path(resources, *root_resource, true, false, get_control_protocol_class_descriptor, get_control_protocol_datatype_descriptor, nullptr);
auto& initial_object_properties_holders = nmos::fields::nc::values(nmos::fields::nc::value(initial_backup_dataset));

Expand Down
Loading