Skip to content

Commit 1bb59cb

Browse files
committed
Refs #23153. Avoid generation of code for nested interfaces.
Signed-off-by: Miguel Company <[email protected]>
1 parent 9fa832d commit 1bb59cb

File tree

11 files changed

+20
-5
lines changed

11 files changed

+20
-5
lines changed

src/main/java/com/eprosima/fastdds/idl/templates/ClientHeader.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,10 @@ $definition_list$
4545
>>
4646

4747
interface(ctx, parent, interface, export_list) ::= <<
48+
$if(!interface.annotatedAsNested)$
4849
extern eProsima_user_DllExport std::shared_ptr<$interface.name$> create_$interface.name$Client(
4950
eprosima::fastdds::dds::DomainParticipant& part,
5051
const char* service_name,
5152
const eprosima::fastdds::dds::RequesterQos& qos);
53+
$endif$
5254
>>

src/main/java/com/eprosima/fastdds/idl/templates/ClientSource.stg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ $definition_list$
6262
>>
6363

6464
interface(ctx, parent, interface, export_list) ::= <<
65+
$if(!interface.annotatedAsNested)$
6566
//{ interface $interface.name$
6667

6768
namespace detail {
@@ -352,7 +353,7 @@ std::shared_ptr<$interface.name$> create_$interface.name$Client(
352353
}
353354

354355
//} interface $interface.name$Client
355-
356+
$endif$
356357
>>
357358

358359
operation_details(parent, operation) ::= <<

src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeHeader.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,9 @@ $endif$
235235
>>
236236

237237
interface(ctx, parent, interface, export_list) ::= <<
238+
$if(!interface.annotatedAsNested)$
238239
eProsima_user_DllExport eprosima::fastdds::dds::rpc::ServiceTypeSupport create_$interface.name$_service_type_support();
240+
$endif$
239241
>>
240242

241243
//{ Fast DDS-Gen extensions

src/main/java/com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ void $struct.name$PubSubType::register_type_object_representation()
241241
>>
242242

243243
interface(ctx, parent, interface, export_list) ::= <<
244+
$if(!interface.annotatedAsNested)$
244245
// { $interface.name$ interface
245246

246247
$interface_generic_ser_code(ctx, parent, interface, "Request")$
@@ -258,6 +259,7 @@ eprosima::fastdds::dds::rpc::ServiceTypeSupport create_$interface.name$_service_
258259
}
259260

260261
// } // $interface.name$ interface
262+
$endif$
261263
>>
262264

263265
interface_generic_ser_code(ctx, parent, interface, suffix) ::= <<

src/main/java/com/eprosima/fastdds/idl/templates/InterfaceDetails.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ namespace detail {
5454

5555
$interface.operations : { operation | $operation_details(interface, operation)$ }; separator="\n"$
5656

57+
$if(!interface.annotatedAsNested)$
5758
//{ top level
5859

5960
struct $interface.name$_Request
@@ -69,6 +70,7 @@ struct $interface.name$_Reply
6970
};
7071

7172
//} // top level
73+
$endif$
7274

7375
//} // $interface.name$ interface
7476

src/main/java/com/eprosima/fastdds/idl/templates/ServerHeader.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ $definition_list$
5050
>>
5151

5252
interface(ctx, parent, interface, export_list) ::= <<
53+
$if(!interface.annotatedAsNested)$
5354
/**
5455
* @brief Context for a client request.
5556
*/
@@ -117,6 +118,7 @@ extern eProsima_user_DllExport std::shared_ptr<$interface.name$Server> create_$i
117118
const eprosima::fastdds::dds::ReplierQos& qos,
118119
size_t thread_pool_size,
119120
std::shared_ptr<$interface.name$Server_IServerImplementation> implementation);
121+
$endif$
120122
>>
121123

122124
operation_prototype(op) ::= <<

src/main/java/com/eprosima/fastdds/idl/templates/ServerImplementation.stg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ $definition_list$
4242
>>
4343

4444
interface(ctx, parent, interface, export_list) ::= <<
45+
$if(!interface.annotatedAsNested)$
4546
//{ interface $interface.name$
4647

4748
struct $interface.name$ServerImplementation :
@@ -53,7 +54,7 @@ struct $interface.name$ServerImplementation :
5354
};
5455

5556
//} interface $interface.name$
56-
57+
$endif$
5758
>>
5859

5960
operation_implementation(interface, op) ::= <<

src/main/java/com/eprosima/fastdds/idl/templates/ServerSource.stg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ $definition_list$
6767
>>
6868

6969
interface(ctx, parent, interface, export_list) ::= <<
70+
$if(!interface.annotatedAsNested)$
7071
//{ interface $interface.name$
7172

7273
namespace detail {
@@ -507,7 +508,7 @@ std::shared_ptr<$interface.name$Server> create_$interface.name$Server(
507508
}
508509

509510
//} interface $interface.name$
510-
511+
$endif$
511512
>>
512513

513514
operation_prepare_call(op) ::= <<

src/main/java/com/eprosima/fastdds/idl/templates/TypesCdrAuxHeaderImpl.stg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ interface(ctx, parent, interface, export_list) ::= <<
525525

526526
$interface.operations : { operation | $operation_details(interface, operation)$ }; separator="\n"$
527527

528+
$if(!interface.annotatedAsNested)$
528529
//{ top level
529530

530531
// Serialization methods for $detail_scoped_name(interface)$_Request
@@ -547,6 +548,7 @@ struct $interface.name$_Reply
547548
$rpc_struct_serialization(interface.replyTypeCode)$
548549

549550
//} // top level
551+
$endif$
550552

551553
//} // $interface.scopedname$ interface
552554

thirdparty/dds-types-test

0 commit comments

Comments
 (0)