Skip to content

Commit 430bfa4

Browse files
Enum Camel Case
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
1 parent ce9755f commit 430bfa4

14 files changed

Lines changed: 219 additions & 219 deletions

File tree

ddsenabler/examples/action/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ static void test_action_feedback_notification_callback(
244244
static void test_action_status_notification_callback(
245245
const char* action_name,
246246
const eprosima::ddsenabler::participants::UUID& goal_id,
247-
eprosima::ddsenabler::participants::STATUS_CODE statusCode,
247+
eprosima::ddsenabler::participants::StatusCode statusCode,
248248
const char* statusMessage,
249249
int64_t publish_time)
250250
{
@@ -428,7 +428,7 @@ bool server_specific_logic(
428428
if (!enabler->send_action_result(
429429
action_name.c_str(),
430430
request_id,
431-
eprosima::ddsenabler::participants::STATUS_CODE::SUCCEEDED,
431+
eprosima::ddsenabler::participants::StatusCode::SUCCEEDED,
432432
json.c_str()))
433433
{
434434
std::cerr << "Failed to send action result" << std::endl;

ddsenabler/include/ddsenabler/DDSEnabler.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@ class DDSEnabler
118118
* for the corresponding request and reply topics.
119119
*
120120
* @param service_name The name of the service to be announced.
121-
* @param rpc_protocol The RPC protocol to be used (default is ROS2).
121+
* @param RpcProtocol The RPC protocol to be used (default is ROS2).
122122
*
123123
* @return true if the service was successfully announced, false otherwise.
124124
*/
125125
DDSENABLER_DllAPI
126126
bool announce_service(
127127
const std::string& service_name,
128-
participants::RPC_PROTOCOL rpc_protocol = participants::RPC_PROTOCOL::ROS2);
128+
participants::RpcProtocol RpcProtocol = participants::RpcProtocol::ROS2);
129129

130130
/**
131131
* @brief Stops the server for the given service.
@@ -154,7 +154,7 @@ class DDSEnabler
154154
* @param service_name The target service name.
155155
* @param json The JSON-formatted request data.
156156
* @param request_id Reference to store the unique request identifier.
157-
* @param rpc_protocol The RPC protocol to be used (default is ROS2).
157+
* @param RpcProtocol The RPC protocol to be used (default is ROS2).
158158
*
159159
* @return true if the request was successfully sent, false otherwise.
160160
*/
@@ -163,7 +163,7 @@ class DDSEnabler
163163
const std::string& service_name,
164164
const std::string& json,
165165
uint64_t& request_id,
166-
participants::RPC_PROTOCOL rpc_protocol = participants::RPC_PROTOCOL::ROS2);
166+
participants::RpcProtocol RpcProtocol = participants::RpcProtocol::ROS2);
167167

168168
/**
169169
* @brief Sends a reply to the given service.
@@ -198,14 +198,14 @@ class DDSEnabler
198198
* Failure may occur if there is an issue requesting the data types to user's app.
199199
*
200200
* @param action_name The name of the action to be announced.
201-
* @param rpc_protocol The RPC protocol to be used (default is ROS2).
201+
* @param RpcProtocol The RPC protocol to be used (default is ROS2).
202202
*
203203
* @return true if the action was successfully announced, false otherwise.
204204
*/
205205
DDSENABLER_DllAPI
206206
bool announce_action(
207207
const std::string& action_name,
208-
participants::RPC_PROTOCOL rpc_protocol = participants::RPC_PROTOCOL::ROS2);
208+
participants::RpcProtocol RpcProtocol = participants::RpcProtocol::ROS2);
209209

210210
/**
211211
* @brief Stops the server for the given action.
@@ -257,7 +257,7 @@ class DDSEnabler
257257
bool send_action_result(
258258
const char* action_name,
259259
const participants::UUID& goal_id,
260-
const participants::STATUS_CODE& status_code,
260+
const participants::StatusCode& status_code,
261261
const char* json);
262262

263263
/**
@@ -277,7 +277,7 @@ class DDSEnabler
277277
bool send_action_cancel_goal_reply(
278278
const char* action_name,
279279
const std::vector<participants::UUID>& goal_ids,
280-
const participants::CANCEL_CODE& cancel_code,
280+
const participants::CancelCode& cancel_code,
281281
const uint64_t request_id);
282282

283283
/**
@@ -298,7 +298,7 @@ class DDSEnabler
298298
bool update_action_status(
299299
const std::string& action_name,
300300
const participants::UUID& goal_id,
301-
const participants::STATUS_CODE& status_code);
301+
const participants::StatusCode& status_code);
302302

303303
/*****************************************/
304304
/* ACTION CLIENT */
@@ -317,7 +317,7 @@ class DDSEnabler
317317
* @param action_name The name of the action to send the goal to.
318318
* @param json The JSON data to be sent with the action goal.
319319
* @param goal_id Reference to store the unique identifier of the action goal.
320-
* @param rpc_protocol The RPC protocol to be used (default is ROS2).
320+
* @param RpcProtocol The RPC protocol to be used (default is ROS2).
321321
*
322322
* @return true if the action goal was successfully sent, false otherwise.
323323
*/
@@ -326,7 +326,7 @@ class DDSEnabler
326326
const std::string& action_name,
327327
const std::string& json,
328328
participants::UUID& goal_id,
329-
participants::RPC_PROTOCOL rpc_protocol = participants::RPC_PROTOCOL::ROS2);
329+
participants::RpcProtocol RpcProtocol = participants::RpcProtocol::ROS2);
330330

331331
/**
332332
* @brief Cancels an action goal for the specified action.

ddsenabler/src/cpp/DDSEnabler.cpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,16 @@ bool DDSEnabler::send_service_request(
296296
const std::string& service_name,
297297
const std::string& json,
298298
uint64_t& request_id,
299-
participants::RPC_PROTOCOL rpc_protocol)
299+
participants::RpcProtocol RpcProtocol)
300300
{
301301
std::string prefix, suffix;
302-
switch (rpc_protocol)
302+
switch (RpcProtocol)
303303
{
304-
case participants::RPC_PROTOCOL::ROS2:
304+
case participants::RpcProtocol::ROS2:
305305
prefix = participants::ROS_REQUEST_PREFIX;
306306
suffix = participants::ROS_REQUEST_SUFFIX;
307307
break;
308-
case participants::RPC_PROTOCOL::FASTDDS:
308+
case participants::RpcProtocol::FASTDDS:
309309
prefix = participants::FASTDDS_REQUEST_PREFIX;
310310
suffix = participants::FASTDDS_REQUEST_SUFFIX;
311311
break;
@@ -329,9 +329,9 @@ bool DDSEnabler::send_service_request(
329329

330330
bool DDSEnabler::announce_service(
331331
const std::string& service_name,
332-
participants::RPC_PROTOCOL rpc_protocol)
332+
participants::RpcProtocol RpcProtocol)
333333
{
334-
return enabler_participant_->announce_service(service_name, rpc_protocol);
334+
return enabler_participant_->announce_service(service_name, RpcProtocol);
335335
}
336336

337337
bool DDSEnabler::revoke_service(
@@ -345,15 +345,15 @@ bool DDSEnabler::send_service_reply(
345345
const std::string& json,
346346
const uint64_t request_id)
347347
{
348-
RPC_PROTOCOL rpc_protocol = enabler_participant_->get_service_rpc_protocol(service_name);
348+
RpcProtocol RpcProtocol = enabler_participant_->get_service_rpc_protocol(service_name);
349349
std::string prefix, suffix;
350-
switch (rpc_protocol)
350+
switch (RpcProtocol)
351351
{
352-
case participants::RPC_PROTOCOL::ROS2:
352+
case participants::RpcProtocol::ROS2:
353353
prefix = participants::ROS_REPLY_PREFIX;
354354
suffix = participants::ROS_REPLY_SUFFIX;
355355
break;
356-
case participants::RPC_PROTOCOL::FASTDDS:
356+
case participants::RpcProtocol::FASTDDS:
357357
prefix = participants::FASTDDS_REPLY_PREFIX;
358358
suffix = participants::FASTDDS_REPLY_SUFFIX;
359359
break;
@@ -373,7 +373,7 @@ bool DDSEnabler::send_action_goal(
373373
const std::string& action_name,
374374
const std::string& json,
375375
UUID& action_id,
376-
participants::RPC_PROTOCOL rpc_protocol)
376+
participants::RpcProtocol RpcProtocol)
377377
{
378378
std::string goal_json = RpcUtils::create_goal_request_msg(json, action_id);
379379
std::string goal_request_topic = action_name + participants::ACTION_GOAL_SUFFIX;
@@ -383,7 +383,7 @@ bool DDSEnabler::send_action_goal(
383383
goal_request_topic,
384384
goal_json,
385385
goal_request_id,
386-
rpc_protocol))
386+
RpcProtocol))
387387
{
388388
EPROSIMA_LOG_ERROR(DDSENABLER_EXECUTION,
389389
"Failed to send action goal request to action " << action_name);
@@ -394,8 +394,8 @@ bool DDSEnabler::send_action_goal(
394394
action_name,
395395
action_id,
396396
goal_request_id,
397-
ACTION_TYPE::GOAL,
398-
rpc_protocol))
397+
ActionType::GOAL,
398+
RpcProtocol))
399399
{
400400
EPROSIMA_LOG_ERROR(DDSENABLER_EXECUTION,
401401
"Failed to store action goal request to action " << action_name);
@@ -429,7 +429,7 @@ bool DDSEnabler::send_action_get_result_request(
429429
action_name,
430430
action_id,
431431
get_result_request_id,
432-
ACTION_TYPE::RESULT))
432+
ActionType::RESULT))
433433
{
434434
EPROSIMA_LOG_ERROR(DDSENABLER_EXECUTION,
435435
"Failed to store action get result request to action " << action_name
@@ -475,9 +475,9 @@ bool DDSEnabler::cancel_action_goal(
475475

476476
bool DDSEnabler::announce_action(
477477
const std::string& action_name,
478-
participants::RPC_PROTOCOL rpc_protocol)
478+
participants::RpcProtocol RpcProtocol)
479479
{
480-
return enabler_participant_->announce_action(action_name, rpc_protocol);
480+
return enabler_participant_->announce_action(action_name, RpcProtocol);
481481
}
482482

483483
bool DDSEnabler::revoke_action(
@@ -508,7 +508,7 @@ void DDSEnabler::send_action_send_goal_reply(
508508
bool DDSEnabler::send_action_cancel_goal_reply(
509509
const char* action_name,
510510
const std::vector<participants::UUID>& goal_ids,
511-
const participants::CANCEL_CODE& cancel_code,
511+
const participants::CancelCode& cancel_code,
512512
const uint64_t request_id)
513513
{
514514
std::vector<std::pair<participants::UUID, std::chrono::system_clock::time_point>> cancelling_goals;
@@ -540,7 +540,7 @@ bool DDSEnabler::send_action_cancel_goal_reply(
540540
bool DDSEnabler::send_action_result(
541541
const char* action_name,
542542
const participants::UUID& goal_id,
543-
const participants::STATUS_CODE& status_code,
543+
const participants::StatusCode& status_code,
544544
const char* json)
545545
{
546546
if (!handler_->is_UUID_active(action_name, goal_id))
@@ -589,15 +589,15 @@ bool DDSEnabler::send_action_feedback(
589589
return false;
590590
}
591591

592-
RPC_PROTOCOL protocol = handler_->get_action_rpc_protocol(action_name, goal_id);
592+
RpcProtocol protocol = handler_->get_action_rpc_protocol(action_name, goal_id);
593593

594594
std::string prefix;
595595
switch (protocol)
596596
{
597-
case RPC_PROTOCOL::ROS2:
597+
case RpcProtocol::ROS2:
598598
prefix = participants::ROS_TOPIC_PREFIX;
599599
break;
600-
case RPC_PROTOCOL::FASTDDS:
600+
case RpcProtocol::FASTDDS:
601601
prefix = participants::FASTDDS_TOPIC_PREFIX;
602602
break;
603603
default:
@@ -616,7 +616,7 @@ bool DDSEnabler::send_action_feedback(
616616
bool DDSEnabler::update_action_status(
617617
const std::string& action_name,
618618
const participants::UUID& goal_id,
619-
const participants::STATUS_CODE& status_code)
619+
const participants::StatusCode& status_code)
620620
{
621621
std::chrono::system_clock::time_point goal_accepted_stamp;
622622
if (!handler_->is_UUID_active(action_name, goal_id, &goal_accepted_stamp))
@@ -627,15 +627,15 @@ bool DDSEnabler::update_action_status(
627627
return false;
628628
}
629629

630-
RPC_PROTOCOL protocol = handler_->get_action_rpc_protocol(action_name, goal_id);
630+
RpcProtocol protocol = handler_->get_action_rpc_protocol(action_name, goal_id);
631631

632632
std::string prefix;
633633
switch (protocol)
634634
{
635-
case RPC_PROTOCOL::ROS2:
635+
case RpcProtocol::ROS2:
636636
prefix = participants::ROS_TOPIC_PREFIX;
637637
break;
638-
case RPC_PROTOCOL::FASTDDS:
638+
case RpcProtocol::FASTDDS:
639639
prefix = participants::FASTDDS_TOPIC_PREFIX;
640640
break;
641641
default:

ddsenabler_participants/include/ddsenabler_participants/Callbacks.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ typedef void (* ActionFeedbackNotification)(
334334
typedef void (* ActionStatusNotification)(
335335
const char* action_name,
336336
const UUID& goal_id,
337-
STATUS_CODE status_code,
337+
StatusCode status_code,
338338
const char* status_message,
339339
int64_t publish_time);
340340

ddsenabler_participants/include/ddsenabler_participants/EnablerParticipant.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ class EnablerParticipant : public ddspipe::participants::SchemaParticipant
9393
DDSENABLER_PARTICIPANTS_DllAPI
9494
bool announce_service(
9595
const std::string& service_name,
96-
RPC_PROTOCOL rpc_protocol = RPC_PROTOCOL::ROS2);
96+
RpcProtocol RpcProtocol = RpcProtocol::ROS2);
9797

9898
DDSENABLER_PARTICIPANTS_DllAPI
9999
bool revoke_service(
100100
const std::string& service_name);
101101

102102
DDSENABLER_PARTICIPANTS_DllAPI
103-
RPC_PROTOCOL get_service_rpc_protocol(
103+
RpcProtocol get_service_rpc_protocol(
104104
const std::string& service_name);
105105

106106
DDSENABLER_PARTICIPANTS_DllAPI
@@ -110,7 +110,7 @@ class EnablerParticipant : public ddspipe::participants::SchemaParticipant
110110
DDSENABLER_PARTICIPANTS_DllAPI
111111
bool announce_action(
112112
const std::string& action_name,
113-
RPC_PROTOCOL rpc_protocol);
113+
RpcProtocol RpcProtocol);
114114

115115
DDSENABLER_PARTICIPANTS_DllAPI
116116
bool revoke_action(
@@ -124,11 +124,11 @@ class EnablerParticipant : public ddspipe::participants::SchemaParticipant
124124

125125
bool query_service_nts_(
126126
std::shared_ptr<ServiceDiscovered> service,
127-
RPC_PROTOCOL rpc_protocol);
127+
RpcProtocol RpcProtocol);
128128

129129
bool query_action_nts_(
130130
ActionDiscovered& action,
131-
RPC_PROTOCOL rpc_protocol,
131+
RpcProtocol RpcProtocol,
132132
std::unique_lock<std::mutex>& lck);
133133

134134
bool create_topic_writer_nts_(
@@ -155,7 +155,7 @@ class EnablerParticipant : public ddspipe::participants::SchemaParticipant
155155
bool fullfill_service_type_nts_(
156156
const ServiceInfo& service_info,
157157
std::shared_ptr<ServiceDiscovered> service,
158-
RPC_PROTOCOL rpc_protocol);
158+
RpcProtocol RpcProtocol);
159159

160160
std::shared_ptr<ddspipe::core::IReader> lookup_reader_nts_(
161161
const std::string& topic_name,

ddsenabler_participants/include/ddsenabler_participants/Handler.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -196,16 +196,16 @@ class Handler : public ddspipe::participants::ISchemaHandler
196196
* @param [in] action_id UUID of the action.
197197
* @param [in] request_id Request ID of the action request.
198198
* @param [in] action_type Type of the action (GOAL, RESULT, CANCEL).
199-
* @param [in] rpc_protocol Protocol of the action, only used to create the ActionRequestInfo if action_type is GOAL.
199+
* @param [in] RpcProtocol Protocol of the action, only used to create the ActionRequestInfo if action_type is GOAL.
200200
* @return \c true if the action request was successfully stored, \c false otherwise.
201201
*/
202202
DDSENABLER_PARTICIPANTS_DllAPI
203203
bool store_action_request(
204204
const std::string& action_name,
205205
const UUID& action_id,
206206
const uint64_t request_id,
207-
const ACTION_TYPE action_type,
208-
const RPC_PROTOCOL rpc_protocol = RPC_PROTOCOL::ROS2);
207+
const ActionType action_type,
208+
const RpcProtocol RpcProtocol = RpcProtocol::ROS2);
209209

210210
/**
211211
* @brief Send the reply containing the result of an action or store it for a later reply.
@@ -258,10 +258,10 @@ class Handler : public ddspipe::participants::ISchemaHandler
258258
*
259259
* @param [in] action_name Name of the action.
260260
* @param [in] action_id UUID of the action to be checked.
261-
* @return The RPC protocol of the action, or RPC_PROTOCOL::PROTOCOL_UNKNOWN if the action is not found.
261+
* @return The RPC protocol of the action, or RpcProtocol::PROTOCOL_UNKNOWN if the action is not found.
262262
*/
263263
DDSENABLER_PARTICIPANTS_DllAPI
264-
RPC_PROTOCOL get_action_rpc_protocol(
264+
RpcProtocol get_action_rpc_protocol(
265265
const std::string& action_name,
266266
const UUID& action_id);
267267

@@ -428,7 +428,7 @@ class Handler : public ddspipe::participants::ISchemaHandler
428428
*/
429429
bool get_action_request_UUID(
430430
const uint64_t request_id,
431-
const ACTION_TYPE action_type,
431+
const ActionType action_type,
432432
UUID& action_id);
433433

434434
/**
@@ -609,7 +609,7 @@ class Handler : public ddspipe::participants::ISchemaHandler
609609
const fastdds::dds::DynamicType::_ref_type& dyn_type,
610610
const uint64_t request_id,
611611
const std::string& action_name,
612-
const ACTION_TYPE action_type);
612+
const ActionType action_type);
613613

614614
/**
615615
* @brief Register a type using the given serialized type data.

0 commit comments

Comments
 (0)