Skip to content

Commit 7c8a32c

Browse files
committed
Refs #23128: Remove flags
Signed-off-by: Carlosespicur <carlosespicur@proton.me>
1 parent d20853f commit 7c8a32c

File tree

3 files changed

+5
-88
lines changed

3 files changed

+5
-88
lines changed

src/cpp/fastdds/xtypes/dynamic_types/DynamicTypeBuilderImpl.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,6 @@ ReturnCode_t DynamicTypeBuilderImpl::apply_annotation(
597597
return x.equals(descriptor_impl);
598598
}))
599599
{
600-
// __FLAG__
601-
EPROSIMA_LOG_ERROR(DYN_TYPES, "Annotation already exists");
602-
//////////////////
603600
return RETCODE_BAD_PARAMETER;
604601
}
605602

src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlAnnotations.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ class Annotation
410410
return false;
411411
}
412412

413-
return (RETCODE_OK == type_builder->apply_annotation(descriptor));
413+
ReturnCode_t ret = type_builder->apply_annotation(descriptor);
414+
return (RETCODE_OK == ret);
414415
}
415416

416417
/**

src/cpp/fastdds/xtypes/dynamic_types/idl_parser/IdlParser.hpp

Lines changed: 3 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -324,26 +324,6 @@ class Context
324324

325325
}; // class Context
326326

327-
// __FLAG__
328-
template<typename Input>
329-
void debug_action(
330-
const std::string& rule_name,
331-
const Input& in,
332-
const std::map<std::string, std::string>& state)
333-
{
334-
std::cout << "[DEBUG] Rule: " << rule_name << "\n";
335-
std::cout << " Input: \"" << in.string() << "\"\n";
336-
std::cout << " State:\n";
337-
for (std::map<std::string, std::string>::const_iterator it = state.begin(); it != state.end(); ++it)
338-
{
339-
std::cout << " - " << it->first << ": " << it->second << "\n";
340-
}
341-
342-
std::cout << "-----------------------------------\n";
343-
}
344-
345-
/////////////////
346-
347327
// Actions
348328
template<typename Rule>
349329
struct action
@@ -370,9 +350,6 @@ struct action<identifier>
370350
std::map<std::string, std::string>& state,
371351
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
372352
{
373-
// __FLAG__
374-
// debug_action("identifier", in, state);
375-
///////////////
376353
auto module = ctx->modules().current();
377354
const std::string identifier_name = in.string();
378355
const std::string scoped_identifier_name = module->create_scoped_name(identifier_name);
@@ -1689,9 +1666,6 @@ struct action<struct_forward_dcl>
16891666

16901667
if (scoped_struct_name == ctx->target_type_name)
16911668
{
1692-
// __FLAG__
1693-
std::cout << "Found target struct: " << scoped_struct_name << std::endl;
1694-
////////////////
16951669
ctx->builder = builder;
16961670
}
16971671
}
@@ -1941,7 +1915,7 @@ struct action<kw_struct>
19411915
{
19421916
template<typename Input>
19431917
static void apply(
1944-
const Input& in,
1918+
const Input& /*in*/,
19451919
Context* ctx,
19461920
std::map<std::string, std::string>& state,
19471921
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
@@ -1956,10 +1930,6 @@ struct action<kw_struct>
19561930
state["current_array_sizes"] = "";
19571931
state["sequence_sizes"] = "";
19581932

1959-
// __FLAG__
1960-
static_cast<void>(in);
1961-
// debug_action("kw_struct", in, state);
1962-
/////////////////////
19631933
// Add pending struct annotations if were processed
19641934
if (state.count("annotation_names") && !state["annotation_names"].empty())
19651935
{
@@ -2118,13 +2088,6 @@ struct action<struct_def>
21182088

21192089
// Annotate the member descriptor with the annotations collected during parsing
21202090
const auto& member_annotations = ctx->annotations().pending_member_annotations();
2121-
// // __FLAG__
2122-
// for (const auto& info : ctx->annotations().pending_member_annotations())
2123-
// {
2124-
// std::cout << "Pending member annotations size: " << info.second.size() << " for member: "
2125-
// << info.first << std::endl;
2126-
// }
2127-
// //////////////////
21282091
if (member_annotations.count(names[i]))
21292092
{
21302093
for (const auto& info : member_annotations.at(names[i]))
@@ -2163,7 +2126,7 @@ struct action<kw_union>
21632126
{
21642127
template<typename Input>
21652128
static void apply(
2166-
const Input& in,
2129+
const Input& /*in*/,
21672130
Context* ctx,
21682131
std::map<std::string, std::string>& state,
21692132
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
@@ -2178,9 +2141,6 @@ struct action<kw_union>
21782141
state["sequence_sizes"] = "";
21792142
state["type"] = "";
21802143

2181-
// __FLAG__
2182-
debug_action("kw_union", in, state);
2183-
/////////////////////
21842144
// Add pending union annotations if were processed
21852145
if (state.count("annotation_names") && !state["annotation_names"].empty())
21862146
{
@@ -2374,7 +2334,7 @@ struct action<union_def>
23742334

23752335
template<typename Input>
23762336
static void apply(
2377-
const Input& in,
2337+
const Input& /*in*/,
23782338
Context* ctx,
23792339
std::map<std::string, std::string>& state,
23802340
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
@@ -2392,10 +2352,6 @@ struct action<union_def>
23922352
}
23932353
cleanup_guard{state, ctx};
23942354

2395-
// __FLAG__
2396-
static_cast<void>(in);
2397-
// debug_action("union_def", in, state);
2398-
////////////////////////
23992355
auto module = ctx->modules().current();
24002356
const std::string scoped_union_name = module->create_scoped_name(state["union_name"]);
24012357

@@ -2738,42 +2694,16 @@ struct action<annotation_appl_params>
27382694
std::map<std::string, std::string>& state,
27392695
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
27402696
{
2741-
// __FLAG__
2742-
// debug_action("annotation_appl_params", in, state);
2743-
////////////////
2744-
27452697
const std::string& last_ann_params = in.string();
27462698
std::string& current_ann_params = state["annotation_params"];
27472699

27482700
// Last parsed annotation has parameters, update the state
27492701
std::vector<std::string> tokens = ctx->split_string(current_ann_params, ';');
2750-
// __FLAG__
2751-
if (tokens.empty())
2752-
{
2753-
EPROSIMA_LOG_ERROR(IDLPARSER, "Invalid annotation parameters: " << current_ann_params);
2754-
throw std::runtime_error("Invalid annotation parameters: " + current_ann_params);
2755-
}
2756-
////////////////
27572702
tokens.back() = last_ann_params;
27582703
current_ann_params = ctx->join_strings(tokens, ';');
27592704
}
27602705
};
27612706

2762-
// template<>
2763-
// struct action<annotation_appl>
2764-
// {
2765-
// template<typename Input>
2766-
// static void apply(
2767-
// const Input& in,
2768-
// Context* /*ctx*/,
2769-
// std::map<std::string, std::string>& state,
2770-
// std::vector<traits<DynamicData>::ref_type>& /*operands*/)
2771-
// {
2772-
// EPROSIMA_LOG_INFO(IDLPARSER, "[TODO] annotation_appl parsing not supported: " << state["type"]);
2773-
// }
2774-
2775-
// };
2776-
27772707
template<>
27782708
struct action<bitmask_dcl>
27792709
{
@@ -2784,9 +2714,6 @@ struct action<bitmask_dcl>
27842714
std::map<std::string, std::string>& state,
27852715
std::vector<traits<DynamicData>::ref_type>& /*operands*/)
27862716
{
2787-
// __FLAG__
2788-
// debug_action("bitmask_dcl", in, state);
2789-
/////////////////////
27902717
state["type"] = in.string();
27912718
EPROSIMA_LOG_INFO(IDLPARSER, "[TODO] bitmask_dcl parsing not supported: " << state["type"]);
27922719
// Ignore bitmask annotations (Unsupported type)
@@ -3108,14 +3035,6 @@ traits<DynamicType>::ref_type Context::get_type(
31083035
bool AnnotationsManager::update_pending_annotations(
31093036
std::map<std::string, std::string>& state)
31103037
{
3111-
// // __FLAG__
3112-
// std::cout << "UPDATING PENDING ANNOTATIONS\n";
3113-
// std::cout << "Current state:\n";
3114-
// for (std::map<std::string, std::string>::const_iterator it = state.begin(); it != state.end(); ++it)
3115-
// {
3116-
// std::cout << " - " << it->first << ": " << it->second << "\n";
3117-
// }
3118-
// ///////////////////////
31193038
if (!state.count("annotation_names") || !state.count("annotation_params") || !state.count("annotation_target"))
31203039
{
31213040
EPROSIMA_LOG_ERROR(IDLPARSER, "Unable to update pending annotations: missing required state keys.");

0 commit comments

Comments
 (0)