Skip to content

Commit 7d9011d

Browse files
Generate code for interfaces and support @nested (#470)
* Add builtin `@feed` annotation (#435) * Refs #22761. Add builtin `@feed` annotation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22761. Add auxiliary STG utilities to Operation class. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22761. Add auxiliary STG utilities to Param class. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate type definitions for exceptions (#436) * Refs #22768. Added test file for exceptions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Add new flag to context. In order to know that at least one exception is to be generated. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Generate exceptions on main header file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Generate serialization code for exceptions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Serialization of exception message. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Update IDL parser. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Mark exceptions as DLL API. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Apply suggestion. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22768. Update submodules. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate code for interfaces in header files (#447) * Refs #22909. Add file to test interfaces generation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Add generation of interfaces to TypesHeader template. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Fail for output feed parameters. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Add include directives for input feed. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Add include directives for output feed. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Add include directives for futures. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Address review comment. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Fix namespace. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22909. Update test submodule. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate request / reply data structures (#451) * Refs #22917. Add check method in Context. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22917. Set scope when creating interfaces. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22917. Generate basic details file. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22917. Generate Reply struct. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22917. Generate Request struct. * Refs #22917. Generate operation details. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22917. Include interface details in `TypesCdrAuxHeader`. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate ServiceTypeSupport for interfaces (#459) * Refs #22996. Skeleton for TypesCdrAuxHeaderImpl. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Added code to get reply type. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Added Operation `getOutTypeCode` and `getResultTypeCode` Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Added typecode for Exception. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Generate serialization code for replies. * Refs #22996. Generate serialization code for operation inputs. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Generate serialization code for input feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Generate serialization code for requests. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Generate code in PubSubTypeHeader. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Skeleton for code generation in PubSubTypeSource. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #22996. Code generation in PubSubTypeSource. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate code for interface clients (#464) * Refs #23017. Add virtual destructor to interface abstract class. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Skeleton for client creation code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Skeleton for client class. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Generate processing thread code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Add `process_reply` implementation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Code for basic requests. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Improve linters. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Code for basic replies. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Add support for operation exceptions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Skeleton for output feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Generate code for input feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Add cancellation logic to output feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Validation and exceptions in output feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Initial implementation for `read` methods. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Linters. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Improve cancel method. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Process values in output feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Return values before exception. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Exceptions finish the feed instead of cancelling it. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Process incoming exceptions in output feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Fail when reply is for a different operation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Add feed cancellation to request type. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Implement feed cancellation on client reader. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Fix atomic initialization. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23017. Make generated code compatible with C++11. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Generate code for interface servers (#465) * Refs #23069. Skeleton for server creation code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Skeleton for server class. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Initial implementation for run and stop. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Request validation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Initial processing code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Prepare method per operation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Thread pool implementation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate operation prototypes. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate operation empty implementations. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate skeleton for calling operations. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Code for calling basic operations. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Code for handling user exceptions. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Code for output feed writers. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Code for handling output feed operations. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Refactor to improve readability. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate code to handle output feed cancellation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Fix client code for output feed cancellation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Infrastructure for input feed processing. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate code for input feed readers. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Improve readability. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Code for operations with input feeds. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate declatation of implementation interface. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. ServerLogic depends on implementation interface. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Generate empty implementation interface. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Fix linters. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Avoid processing `feed_cancel_` when not generated. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Log error when trying to cancel a non-feed request. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23069. Cancel requests before terminating thread pool. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23079. Change dll export macro. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23079. Remove unnecessary namespace aliasing. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23079. Remove detail namespace in server implementation. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23079. Avoid nested structures (not supported by Swig). Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Fix build after rebase. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Update dds-types-test submodule. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Add created interfaces to context. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Fix generation of interfaces with inheritance. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Avoid generation of code for nested interfaces. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Fix build with non-namespaced interfaces. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Do not generate type support for nested. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Add IDL from review. * Refs #23153. Filter replies from different writers. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Always generate PubSubTypes. This fixes link issues when we have an IDL that includes another IDL where all the structures are declared as nested. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Fix generation of `using namespace ...` Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Fix generation of test code. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> * Refs #23153. Update submodules. Signed-off-by: Miguel Company <miguelcompany@eprosima.com> --------- Signed-off-by: Miguel Company <miguelcompany@eprosima.com>
1 parent 93e08c0 commit 7d9011d

27 files changed

+3480
-55
lines changed

src/main/java/com/eprosima/fastcdr/idl/templates/FastCdrCommon.stg

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,38 @@
1414

1515
group FastCdrCommon;
1616

17+
paramRetType(typecode) ::= <%
18+
$if(typecode)$
19+
$typecode.cppTypename$
20+
$else$
21+
void
22+
$endif$
23+
%>
24+
25+
paramTypeByRef(typecode) ::= <%
26+
$typecode.cppTypename$&
27+
%>
28+
29+
paramTypeByValue(typecode, feed, is_server) ::= <%
30+
$if(feed)$
31+
$if(is_server)$
32+
eprosima::fastdds::dds::rpc::RpcServerReader<$typecode.cppTypename$>&
33+
$else$
34+
std::shared_ptr<eprosima::fastdds::dds::rpc::RpcClientWriter<$typecode.cppTypename$>>&
35+
$endif$
36+
$else$
37+
$if(typecode.primitive)$
38+
$typecode.cppTypename$
39+
$else$
40+
const $typecode.cppTypename$&
41+
$endif$
42+
$endif$
43+
%>
44+
45+
paramDeclarations(params, initialSeparator="") ::= <<
46+
$if(params)$$initialSeparator$$endif$$params : {param | /*$param.comment$*/ $if(param.output)$$paramTypeByRef(typecode=param.typecode)$$else$$paramTypeByValue(typecode=param.typecode, feed=param.annotationFeed, is_server=false)$$endif$ $param.name$}; anchor, separator=",\n"$
47+
>>
48+
1749
object_serialization(ctx, object) ::= <<
1850
scdr << eprosima::fastcdr::MemberId($object.id$) << $object.name$();
1951
>>

src/main/java/com/eprosima/fastcdr/idl/templates/TypesHeader.stg

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ $endif$
3333
$if(ctx.thereIsMap)$
3434
#include <map>
3535
$endif$
36+
$if(ctx.thereIsInputFeed || ctx.thereIsOutputFeed)$
37+
#include <memory>
38+
$endif$
3639
$if(ctx.thereIsString)$
3740
#include <string>
3841
$endif$
@@ -54,6 +57,19 @@ $if(ctx.thereIsUnion)$
5457
#include <fastcdr/exceptions/BadParamException.h>
5558
$endif$
5659

60+
$if(ctx.thereIsException)$
61+
#include <fastdds/dds/rpc/exceptions/RpcOperationError.hpp>
62+
$endif$
63+
$if(ctx.thereIsOutputFeed)$
64+
#include <fastdds/dds/rpc/interfaces/RpcClientReader.hpp>
65+
$endif$
66+
$if(ctx.thereIsInputFeed)$
67+
#include <fastdds/dds/rpc/interfaces/RpcClientWriter.hpp>
68+
$endif$
69+
$if(ctx.thereIsNonFeedOperation)$
70+
#include <fastdds/dds/rpc/interfaces/RpcFuture.hpp>
71+
$endif$
72+
5773
$ctx.directIncludeDependencies : {include | #include "$include$.hpp"}; separator="\n"$
5874

5975
#if defined(_WIN32)
@@ -108,19 +124,90 @@ namespace $annotation.name$ {
108124
$endif$
109125
>>
110126

127+
exception(ctx, parent, exception, extensions) ::= <<
128+
/*!
129+
* @brief This class implements the user exception $exception.scopedname$
130+
* @ingroup $ctx.trimfilename$
131+
*/
132+
class eProsima_user_DllExport $exception.name$ : public eprosima::fastdds::dds::rpc::RpcOperationError
133+
{
134+
public:
135+
136+
/**
137+
* Default constructor.
138+
*/
139+
$exception.name$()
140+
: $exception.name$("$exception.name$")
141+
{
142+
}
143+
144+
/**
145+
* Constructor.
146+
*/
147+
$exception.name$(
148+
const std::string& message)
149+
: eprosima::fastdds::dds::rpc::RpcOperationError(message)
150+
{
151+
}
152+
153+
/**
154+
* Constructor.
155+
*/
156+
$exception.name$(
157+
const char* message)
158+
: eprosima::fastdds::dds::rpc::RpcOperationError(message)
159+
{
160+
}
161+
162+
/**
163+
* Copy constructor.
164+
*/
165+
$exception.name$(
166+
const $exception.name$& other) noexcept = default;
167+
168+
/**
169+
* Copy assignment.
170+
*/
171+
$exception.name$& operator =(
172+
const $exception.name$& other) noexcept = default;
173+
174+
/**
175+
* Destructor.
176+
*/
177+
virtual ~$exception.name$() noexcept = default;
178+
179+
$exception.members:{ member | $public_member_declaration(member)$}; separator="\n"$
180+
181+
$extensions : { extension | $extension$}; separator="\n"$
182+
183+
private:
184+
185+
$exception.members:{ member | $private_member_declaration(member=member)$}; separator="\n"$
186+
187+
};
188+
189+
>>
190+
111191
interface(ctx, parent, interface, export_list) ::= <<
112192
/*!
113193
* @brief This class represents the interface $interface.name$ defined by the user in the IDL file.
114194
* @ingroup $ctx.trimfilename$
115195
*/
116-
class $ctx.fileNameUpper$_DllAPI $interface.name$ $if(interface.bases)$: $interface.bases : {base |public $base.scopedname$}; separator=", "$$endif$
196+
class eProsima_user_DllExport $interface.name$ $if(interface.bases)$: $interface.bases : {base |public $base.scopedname$}; separator=", "$$endif$
117197
{
118198
public:
199+
virtual ~$interface.name$() = default;
119200

120201
$export_list$
121202
};
122203
>>
123204

205+
operation(ctx, parent, operation, param_list, operation_type) ::= <<
206+
virtual $operationRetType(operation)$ $operation.name$(
207+
$paramDeclarations(params=operation.parameters)$) = 0;
208+
209+
>>
210+
124211
const_decl(ctx, parent, const, const_type) ::= <<
125212
$const_type$
126213
const $const.typeCode.cppTypename$ $const.name$ = $const.value$$const_value_prefix(const)$;
@@ -849,6 +936,14 @@ new(&m_$member.name$) $member_type_declaration(member)$();
849936
$endif$
850937
>>
851938

939+
operationRetType(operation) ::= <%
940+
$if(operation.annotationFeed)$
941+
std::shared_ptr<eprosima::fastdds::dds::rpc::RpcClientReader<$paramRetType(operation.rettype)$> >
942+
$else$
943+
eprosima::fastdds::dds::rpc::RpcFuture<$paramRetType(operation.rettype)$>
944+
$endif$
945+
%>
946+
852947
//{ Fast DDS-Gen extensions
853948
module_conversion(ctx, parent, modules, definition_list) ::= <<
854949
$modules : { module |

src/main/java/com/eprosima/fastdds/fastddsgen.java

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -802,10 +802,16 @@ private Project parseIDL(
802802
// Load Types common templates
803803
if (generate_typesupport_)
804804
{
805+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/InterfaceDetails.stg");
805806
tmanager.addGroup("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeader.stg");
806807
tmanager.addGroup("com/eprosima/fastdds/idl/templates/TypesCdrAuxHeaderImpl.stg");
807808
tmanager.addGroup("com/eprosima/fastdds/idl/templates/DDSPubSubTypeHeader.stg");
808809
tmanager.addGroup("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg");
810+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/ClientHeader.stg");
811+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/ClientSource.stg");
812+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/ServerHeader.stg");
813+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/ServerSource.stg");
814+
tmanager.addGroup("com/eprosima/fastdds/idl/templates/ServerImplementation.stg");
809815

810816
if (generate_typeobjectsupport_)
811817
{
@@ -1014,7 +1020,15 @@ private Project parseIDL(
10141020
}
10151021
}
10161022

1017-
if (ctx.isThereIsStructOrUnion())
1023+
if (ctx.isThereIsInterface())
1024+
{
1025+
// Generate Interface details
1026+
returnedValue &=
1027+
Utils.writeFile(output_dir + ctx.getFilename() + "_details.hpp",
1028+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/InterfaceDetails.stg"), m_replace);
1029+
}
1030+
1031+
if (ctx.isThereIsStructOrUnion() || ctx.isThereIsException())
10181032
{
10191033
if (returnedValue &=
10201034
Utils.writeFile(output_dir + ctx.getFilename() + "CdrAux.hpp",
@@ -1030,16 +1044,13 @@ private Project parseIDL(
10301044
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.hpp",
10311045
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeHeader.stg"), m_replace);
10321046
project.addCommonIncludeFile(relative_dir + ctx.getFilename() + "PubSubTypes.hpp");
1033-
if (ctx.existsLastStructure())
1047+
if (returnedValue &=
1048+
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.cxx",
1049+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg"), m_replace))
10341050
{
1035-
m_atLeastOneStructure = true;
1036-
project.setHasStruct(true);
1037-
1038-
if (returnedValue &=
1039-
Utils.writeFile(output_dir + ctx.getFilename() + "PubSubTypes.cxx",
1040-
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSource.stg"), m_replace))
1051+
project.addCommonSrcFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");
1052+
if (ctx.existsLastStructure() || ctx.isThereIsInterface())
10411053
{
1042-
project.addCommonSrcFile(relative_dir + ctx.getFilename() + "PubSubTypes.cxx");
10431054
if (m_python)
10441055
{
10451056
System.out.println("Generating Swig interface files...");
@@ -1048,6 +1059,44 @@ private Project parseIDL(
10481059
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/DDSPubSubTypeSwigInterface.stg"), m_replace);
10491060
}
10501061
}
1062+
}
1063+
1064+
// Generate client code for interfaces
1065+
if (ctx.isThereIsInterface())
1066+
{
1067+
if (returnedValue &=
1068+
Utils.writeFile(output_dir + ctx.getFilename() + "Client.hpp",
1069+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/ClientHeader.stg"), m_replace))
1070+
{
1071+
project.addCommonIncludeFile(relative_dir + ctx.getFilename() + "Client.hpp");
1072+
}
1073+
if (returnedValue &=
1074+
Utils.writeFile(output_dir + ctx.getFilename() + "Client.cxx",
1075+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/ClientSource.stg"), m_replace))
1076+
{
1077+
project.addCommonSrcFile(relative_dir + ctx.getFilename() + "Client.cxx");
1078+
}
1079+
if (returnedValue &=
1080+
Utils.writeFile(output_dir + ctx.getFilename() + "Server.hpp",
1081+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/ServerHeader.stg"), m_replace))
1082+
{
1083+
project.addCommonIncludeFile(relative_dir + ctx.getFilename() + "Server.hpp");
1084+
}
1085+
if (returnedValue &=
1086+
Utils.writeFile(output_dir + ctx.getFilename() + "Server.cxx",
1087+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/ServerSource.stg"), m_replace))
1088+
{
1089+
project.addCommonSrcFile(relative_dir + ctx.getFilename() + "Server.cxx");
1090+
}
1091+
returnedValue &=
1092+
Utils.writeFile(output_dir + ctx.getFilename() + "ServerImpl.hpp",
1093+
maintemplates.getTemplate("com/eprosima/fastdds/idl/templates/ServerImplementation.stg"), m_replace);
1094+
}
1095+
1096+
if (ctx.existsLastStructure())
1097+
{
1098+
m_atLeastOneStructure = true;
1099+
project.setHasStruct(true);
10511100

10521101
if (m_exampleOption != null)
10531102
{
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2025 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
package com.eprosima.fastdds.idl.grammar;
16+
17+
import com.eprosima.idl.parser.tree.AnnotationDeclaration;
18+
19+
public class Annotation extends com.eprosima.idl.parser.tree.Annotation
20+
{
21+
public static final String rpc_feed_str = "feed";
22+
23+
public Annotation(AnnotationDeclaration declaration)
24+
{
25+
super(declaration);
26+
}
27+
}

0 commit comments

Comments
 (0)