Skip to content

Commit c3279cb

Browse files
Rpc name & Type name passed as argument to writer
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
1 parent 96d50ee commit c3279cb

4 files changed

Lines changed: 105 additions & 114 deletions

File tree

ddsenabler_participants/include/ddsenabler_participants/Handler.hpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
500500
void write_service_reply_nts_(
501501
const Message& msg,
502502
const fastdds::dds::DynamicType::_ref_type& dyn_type,
503-
const uint64_t request_id);
503+
const uint64_t request_id,
504+
const std::string& service_name);
504505

505506
/**
506507
* @brief Write the service request to user's app.
@@ -512,7 +513,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
512513
void write_service_request_nts_(
513514
const Message& msg,
514515
const fastdds::dds::DynamicType::_ref_type& dyn_type,
515-
const uint64_t request_id);
516+
const uint64_t request_id,
517+
const std::string& service_name);
516518

517519
/**
518520
* @brief Write the action result to user's app.
@@ -524,7 +526,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
524526
void write_action_result_nts_(
525527
const Message& msg,
526528
const fastdds::dds::DynamicType::_ref_type& dyn_type,
527-
const UUID& action_id);
529+
const UUID& action_id,
530+
const std::string& action_name);
528531

529532
/**
530533
* @brief Write the action feedback to user's app.
@@ -534,7 +537,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
534537
*/
535538
void write_action_feedback_nts_(
536539
const Message& msg,
537-
const fastdds::dds::DynamicType::_ref_type& dyn_type);
540+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
541+
const std::string& action_name);
538542

539543
/**
540544
* @brief Write the action goal reply to user's app.
@@ -546,7 +550,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
546550
void write_action_goal_reply_nts_(
547551
const Message& msg,
548552
const fastdds::dds::DynamicType::_ref_type& dyn_type,
549-
const UUID& action_id);
553+
const UUID& action_id,
554+
const std::string& action_name);
550555

551556
/**
552557
* @brief Write the action cancel reply to user's app.
@@ -558,7 +563,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
558563
void write_action_cancel_reply_nts_(
559564
const Message& msg,
560565
const fastdds::dds::DynamicType::_ref_type& dyn_type,
561-
const uint64_t request_id);
566+
const uint64_t request_id,
567+
const std::string& action_name);
562568

563569
/**
564570
* @brief Write the action status to user's app.
@@ -568,7 +574,8 @@ class Handler : public ddspipe::participants::ISchemaHandler
568574
*/
569575
void write_action_status_nts_(
570576
const Message& msg,
571-
const fastdds::dds::DynamicType::_ref_type& dyn_type);
577+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
578+
const std::string& action_name);
572579

573580
/**
574581
* @brief Write the action (goal or cancel) request to user's app.
@@ -580,7 +587,9 @@ class Handler : public ddspipe::participants::ISchemaHandler
580587
void write_action_request_nts_(
581588
const Message& msg,
582589
const fastdds::dds::DynamicType::_ref_type& dyn_type,
583-
const uint64_t request_id);
590+
const uint64_t request_id,
591+
const std::string& action_name,
592+
const RpcUtils::RpcType& rpc_type);
584593

585594
/**
586595
* @brief Register a type using the given serialized type data.

ddsenabler_participants/include/ddsenabler_participants/Writer.hpp

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,13 +177,15 @@ class Writer
177177
void write_service_reply_notification(
178178
const Message& msg,
179179
const fastdds::dds::DynamicType::_ref_type& dyn_type,
180-
const uint64_t request_id);
180+
const uint64_t request_id,
181+
const std::string& service_name);
181182

182183
DDSENABLER_PARTICIPANTS_DllAPI
183184
void write_service_request_notification(
184185
const Message& msg,
185186
const fastdds::dds::DynamicType::_ref_type& dyn_type,
186-
const uint64_t request_id);
187+
const uint64_t request_id,
188+
const std::string& service_name);
187189

188190
DDSENABLER_PARTICIPANTS_DllAPI
189191
void write_action_notification(
@@ -193,35 +195,42 @@ class Writer
193195
void write_action_result_notification(
194196
const Message& msg,
195197
const fastdds::dds::DynamicType::_ref_type& dyn_type,
196-
const UUID& action_id);
198+
const UUID& action_id,
199+
const std::string& action_name);
197200

198201
DDSENABLER_PARTICIPANTS_DllAPI
199202
void write_action_feedback_notification(
200203
const Message& msg,
201-
const fastdds::dds::DynamicType::_ref_type& dyn_type);
204+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
205+
const std::string& action_name);
202206

203207
DDSENABLER_PARTICIPANTS_DllAPI
204208
void write_action_goal_reply_notification(
205209
const Message& msg,
206210
const fastdds::dds::DynamicType::_ref_type& dyn_type,
207-
const UUID& action_id);
211+
const UUID& action_id,
212+
const std::string& action_name);
208213

209214
DDSENABLER_PARTICIPANTS_DllAPI
210215
void write_action_cancel_reply_notification(
211216
const Message& msg,
212217
const fastdds::dds::DynamicType::_ref_type& dyn_type,
213-
const uint64_t request_id);
218+
const uint64_t request_id,
219+
const std::string& action_name);
214220

215221
DDSENABLER_PARTICIPANTS_DllAPI
216222
void write_action_status_notification(
217223
const Message& msg,
218-
const fastdds::dds::DynamicType::_ref_type& dyn_type);
224+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
225+
const std::string& action_name);
219226

220227
DDSENABLER_PARTICIPANTS_DllAPI
221228
void write_action_request_notification(
222229
const Message& msg,
223230
const fastdds::dds::DynamicType::_ref_type& dyn_type,
224-
const uint64_t request_id);
231+
const uint64_t request_id,
232+
const std::string& action_name,
233+
const RpcUtils::RpcType& rpc_type);
225234

226235
DDSENABLER_PARTICIPANTS_DllAPI
227236
void set_is_UUID_active_callback(

ddsenabler_participants/src/cpp/Handler.cpp

Lines changed: 47 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -168,14 +168,14 @@ void Handler::add_data(
168168
requests_id_++;
169169
RpcPayloadData& rpc_data = dynamic_cast<RpcPayloadData&>(data);
170170
rpc_data.sent_sequence_number = eprosima::fastdds::rtps::SequenceNumber_t(requests_id_);
171-
write_service_request_nts_(msg, dyn_type, requests_id_);
171+
write_service_request_nts_(msg, dyn_type, requests_id_, rpc_name);
172172
break;
173173
}
174174

175175
case RpcUtils::RpcType::RPC_REPLY:
176176
{
177177
auto request_id = dynamic_cast<ddspipe::core::types::RpcPayloadData&>(data).write_params.get_reference().related_sample_identity().sequence_number().to64long();
178-
write_service_reply_nts_(msg, dyn_type, request_id);
178+
write_service_reply_nts_(msg, dyn_type, request_id, rpc_name);
179179
break;
180180
}
181181

@@ -185,7 +185,7 @@ void Handler::add_data(
185185
auto action_id = dynamic_cast<ddspipe::core::types::RpcPayloadData&>(data).write_params.get_reference().related_sample_identity().sequence_number().to64long();
186186
UUID action_id_uuid;
187187
if (get_action_request_UUID(action_id, RpcUtils::ActionType::RESULT, action_id_uuid))
188-
write_action_result_nts_(msg, dyn_type, action_id_uuid);
188+
write_action_result_nts_(msg, dyn_type, action_id_uuid, rpc_name);
189189
erase_action_UUID(action_id_uuid, ActionEraseReason::RESULT);
190190
break;
191191
}
@@ -195,26 +195,26 @@ void Handler::add_data(
195195
auto action_id = dynamic_cast<ddspipe::core::types::RpcPayloadData&>(data).write_params.get_reference().related_sample_identity().sequence_number().to64long();
196196
UUID action_id_uuid;
197197
if (get_action_request_UUID(action_id, RpcUtils::ActionType::GOAL, action_id_uuid))
198-
write_action_goal_reply_nts_(msg, dyn_type, action_id_uuid);
198+
write_action_goal_reply_nts_(msg, dyn_type, action_id_uuid, rpc_name);
199199
break;
200200
}
201201

202202
case RpcUtils::RpcType::ACTION_CANCEL_REPLY:
203203
{
204204
auto request_id = dynamic_cast<ddspipe::core::types::RpcPayloadData&>(data).write_params.get_reference().related_sample_identity().sequence_number().to64long();
205-
write_action_cancel_reply_nts_(msg, dyn_type, request_id);
205+
write_action_cancel_reply_nts_(msg, dyn_type, request_id, rpc_name);
206206
break;
207207
}
208208

209209
case RpcUtils::RpcType::ACTION_FEEDBACK:
210210
{
211-
write_action_feedback_nts_(msg, dyn_type);
211+
write_action_feedback_nts_(msg, dyn_type, rpc_name);
212212
break;
213213
}
214214

215215
case RpcUtils::RpcType::ACTION_STATUS:
216216
{
217-
write_action_status_nts_(msg, dyn_type);
217+
write_action_status_nts_(msg, dyn_type, rpc_name);
218218
break;
219219
}
220220

@@ -242,7 +242,7 @@ void Handler::add_data(
242242
requests_id_,
243243
RpcUtils::get_action_type(rpc_type)))
244244
{
245-
write_action_request_nts_(msg, dyn_type, requests_id_);
245+
write_action_request_nts_(msg, dyn_type, requests_id_, rpc_name, rpc_type);
246246
}
247247

248248
break;
@@ -490,19 +490,21 @@ void Handler::write_service_nts_(
490490
}
491491

492492
void Handler::write_service_reply_nts_(
493-
const Message& msg,
494-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
495-
const uint64_t request_id)
493+
const Message& msg,
494+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
495+
const uint64_t request_id,
496+
const std::string& service_name)
496497
{
497-
writer_->write_service_reply_notification(msg, dyn_type, request_id);
498+
writer_->write_service_reply_notification(msg, dyn_type, request_id, service_name);
498499
}
499500

500501
void Handler::write_service_request_nts_(
501-
const Message& msg,
502-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
503-
const uint64_t request_id)
502+
const Message& msg,
503+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
504+
const uint64_t request_id,
505+
const std::string& service_name)
504506
{
505-
writer_->write_service_request_notification(msg, dyn_type, request_id);
507+
writer_->write_service_request_notification(msg, dyn_type, request_id, service_name);
506508
}
507509

508510
void Handler::write_action_nts_(
@@ -512,49 +514,56 @@ void Handler::write_action_nts_(
512514
}
513515

514516
void Handler::write_action_result_nts_(
515-
const Message& msg,
516-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
517-
const UUID& action_id)
517+
const Message& msg,
518+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
519+
const UUID& action_id,
520+
const std::string& action_name)
518521
{
519-
writer_->write_action_result_notification(msg, dyn_type, action_id);
522+
writer_->write_action_result_notification(msg, dyn_type, action_id, action_name);
520523
}
521524

522525
void Handler::write_action_feedback_nts_(
523-
const Message& msg,
524-
const fastdds::dds::DynamicType::_ref_type& dyn_type)
526+
const Message& msg,
527+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
528+
const std::string& action_name)
525529
{
526-
writer_->write_action_feedback_notification(msg, dyn_type);
530+
writer_->write_action_feedback_notification(msg, dyn_type, action_name);
527531
}
528532

529533
void Handler::write_action_goal_reply_nts_(
530-
const Message& msg,
531-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
532-
const UUID& action_id)
534+
const Message& msg,
535+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
536+
const UUID& action_id,
537+
const std::string& action_name)
533538
{
534-
writer_->write_action_goal_reply_notification(msg, dyn_type, action_id);
539+
writer_->write_action_goal_reply_notification(msg, dyn_type, action_id, action_name);
535540
}
536541

537542
void Handler::write_action_cancel_reply_nts_(
538-
const Message& msg,
539-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
540-
const uint64_t request_id)
543+
const Message& msg,
544+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
545+
const uint64_t request_id,
546+
const std::string& action_name)
541547
{
542-
writer_->write_action_cancel_reply_notification(msg, dyn_type, request_id);
548+
writer_->write_action_cancel_reply_notification(msg, dyn_type, request_id, action_name);
543549
}
544550

545551
void Handler::write_action_status_nts_(
546-
const Message& msg,
547-
const fastdds::dds::DynamicType::_ref_type& dyn_type)
552+
const Message& msg,
553+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
554+
const std::string& action_name)
548555
{
549-
writer_->write_action_status_notification(msg, dyn_type);
556+
writer_->write_action_status_notification(msg, dyn_type, action_name);
550557
}
551558

552559
void Handler::write_action_request_nts_(
553-
const Message& msg,
554-
const fastdds::dds::DynamicType::_ref_type& dyn_type,
555-
const uint64_t request_id)
560+
const Message& msg,
561+
const fastdds::dds::DynamicType::_ref_type& dyn_type,
562+
const uint64_t request_id,
563+
const std::string& action_name,
564+
const RpcUtils::RpcType& rpc_type)
556565
{
557-
writer_->write_action_request_notification(msg, dyn_type, request_id);
566+
writer_->write_action_request_notification(msg, dyn_type, request_id, action_name, rpc_type);
558567
}
559568

560569
bool Handler::register_type_nts_(

0 commit comments

Comments
 (0)