Skip to content

Commit

Permalink
Minor change in configuration_request and test
Browse files Browse the repository at this point in the history
Signed-off-by: Javier Gil Aviles <javiergil@eprosima.com>
  • Loading branch information
Javgilavi committed Jan 22, 2025
1 parent 45d2d28 commit 981b6c0
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,8 @@ class OrchestratorNode
* @param [in] req configuration request, contain which node and configuration file
* @param [out] res response from the node with its new configuration
*/
bool configuration_request(
const types::RequestType req,
const types::ResponseType& res);
types::ResponseType configuration_request(
const types::RequestType& req);

/**
* @brief Public method to get the mutex in order to correctly synchronise user
Expand Down
4 changes: 2 additions & 2 deletions sustainml_cpp/include/sustainml_cpp/types/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2519,7 +2519,7 @@ class RequestType
* @brief This function returns the implementation
* @return Pointer to implementation
*/
RequestTypeImpl* get_impl();
RequestTypeImpl* get_impl() const;

/*!
* @brief This function retrives the implementation type info
Expand Down Expand Up @@ -2706,7 +2706,7 @@ class ResponseType
* @brief This function returns the implementation
* @return Pointer to implementation
*/
ResponseTypeImpl* get_impl();
ResponseTypeImpl* get_impl() const;

/*!
* @brief This function retrives the implementation type info
Expand Down
5 changes: 2 additions & 3 deletions sustainml_cpp/src/cpp/orchestrator/OrchestratorNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,9 +481,8 @@ void OrchestratorNode::send_control_command(
control_writer_->write(cmd.get_impl());
}

bool OrchestratorNode::configuration_request(
const types::RequestType req,
const types::ResponseType& res)
types::ResponseType OrchestratorNode::configuration_request(
const types::RequestType& req)
{
//TODO: Implement this method
return true;
Expand Down
4 changes: 2 additions & 2 deletions sustainml_cpp/src/cpp/types/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2234,7 +2234,7 @@ std::string& RequestType::configuration()
return impl_->configuration();
}

RequestTypeImpl* RequestType::get_impl()
RequestTypeImpl* RequestType::get_impl() const
{
return impl_;
}
Expand Down Expand Up @@ -2398,7 +2398,7 @@ std::string& ResponseType::configuration()
return impl_->configuration();
}

ResponseTypeImpl* ResponseType::get_impl()
ResponseTypeImpl* ResponseType::get_impl() const
{
return impl_;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ TEST(OrchestratorNode, OrchestratorConfigurationService)
req.node_id(static_cast<long>(NodeID::ID_ML_MODEL_METADATA));
req.transaction_id(1);
req.configuration("Test");
types::ResponseType res;
types::ResponseType res = orchestrator.configuration_request(req);

ASSERT_TRUE(orchestrator.configuration_request(req, res));
ASSERT_TRUE(res.success());
orchestrator.destroy();
}

Expand Down

0 comments on commit 981b6c0

Please sign in to comment.