@@ -51,104 +51,15 @@ $definition_list$
51
51
52
52
interface(ctx, parent, interface, export_list) ::= <<
53
53
$if(!interface.annotatedAsNested)$
54
- /**
55
- * @brief Context for a client request.
56
- */
57
- struct $interface.name$Server_ClientContext
58
- {
59
- virtual ~$interface.name$Server_ClientContext() = default;
60
-
61
- /**
62
- * @brief Get the GUID of the client that made the request.
63
- *
64
- * @return The GUID of the client that made the request.
65
- */
66
- virtual const eprosima::fastdds::rtps::GUID_t& get_client_id() const = 0;
67
-
68
- /**
69
- * @brief Get the locators of the client that made the request.
70
- *
71
- * @return The locators of the client that made the request.
72
- */
73
- virtual const eprosima::fastdds::rtps::RemoteLocatorList& get_client_locators() const = 0;
74
- };
75
-
76
54
struct $interface.name$Server_IServerImplementation
77
55
{
78
56
virtual ~$interface.name$Server_IServerImplementation() = default;
79
57
80
58
$interface.all_operations:{op | $operation_prototype(op)$}; separator="\n\n"$
81
59
};
82
60
83
- struct $interface.name$Server
84
- {
85
- virtual ~$interface.name$Server() = default;
86
-
87
- /**
88
- * @brief Run the server.
89
- *
90
- * This method starts the server and begins processing requests.
91
- * The method will block until the server is stopped.
92
- */
93
- virtual void run() = 0;
94
-
95
- /**
96
- * @brief Stop the server.
97
- *
98
- * This method stops the server and releases all resources.
99
- * It will cancel all pending requests, and then @c call server_stopped on the request scheduler to let
100
- * it release any resources associated to this server.
101
- *
102
- * When the server has been created with the factory method that receives a @c thread_pool_size argument,
103
- * it will wait for all threads in the pool to finish before returning.
104
- */
105
- virtual void stop() = 0;
106
-
107
- /**
108
- * @brief Perform execution of a client request.
109
- *
110
- * @param request The client request to execute.
111
- */
112
- virtual void execute_request(
113
- const std::shared_ptr<$interface.name$Server_ClientContext>& request) = 0;
114
-
115
- };
116
-
117
- struct $interface.name$ServerSchedulingStrategy
118
- {
119
- virtual ~$interface.name$ServerSchedulingStrategy() = default;
120
-
121
- /**
122
- * @brief Schedule a request for processing.
123
- *
124
- * This method is called when a request is received and should be processed by the server.
125
- * The implementation should decide how to handle the request, whether to process it immediately,
126
- * or to queue it for later processing.
127
- *
128
- * A call to server->execute_request(request) should eventually be made to process the request.
129
- *
130
- * @note This method is called from the thread that takes requests and input feed values, so it
131
- * should not directly execute the request for operations that have input feed parameters.
132
- *
133
- * @param request The request to schedule.
134
- * @param server The server instance that should process the request.
135
- */
136
- virtual void schedule_request(
137
- const std::shared_ptr<$interface.name$Server_ClientContext>& request,
138
- const std::shared_ptr<$interface.name$Server>& server) = 0;
139
-
140
- /**
141
- * @brief Informs that a server has been stopped and all its requests have been cancelled.
142
- *
143
- * @param server The server instance that has been stopped.
144
- */
145
- virtual void server_stopped(
146
- const std::shared_ptr<$interface.name$Server>& server) = 0;
147
-
148
- };
149
-
150
61
/**
151
- * @brief Create a $interface.name$Server instance.
62
+ * @brief Create a $interface.name$ server instance.
152
63
*
153
64
* @param part The DomainParticipant to use for the server.
154
65
* @param service_name The name of the service.
@@ -157,35 +68,35 @@ struct $interface.name$ServerSchedulingStrategy
157
68
* When set to 0, a pool with a single thread will be created.
158
69
* @param implementation The implementation of the server interface.
159
70
*/
160
- extern eProsima_user_DllExport std::shared_ptr<$interface.name$Server > create_$interface.name$Server(
71
+ extern eProsima_user_DllExport std::shared_ptr<eprosima::fastdds::dds::rpc::RpcServer > create_$interface.name$Server(
161
72
eprosima::fastdds::dds::DomainParticipant& part,
162
73
const char* service_name,
163
74
const eprosima::fastdds::dds::ReplierQos& qos,
164
75
size_t thread_pool_size,
165
76
std::shared_ptr<$interface.name$Server_IServerImplementation> implementation);
166
77
167
78
/**
168
- * @brief Create a $interface.name$Server instance.
79
+ * @brief Create a $interface.name$ server instance.
169
80
*
170
81
* @param part The DomainParticipant to use for the server.
171
82
* @param service_name The name of the service.
172
83
* @param qos The QoS settings for the server.
173
84
* @param scheduler The request scheduling strategy to use for the server.
174
85
* @param implementation The implementation of the server interface.
175
86
*/
176
- extern eProsima_user_DllExport std::shared_ptr<$interface.name$Server > create_$interface.name$Server(
87
+ extern eProsima_user_DllExport std::shared_ptr<eprosima::fastdds::dds::rpc::RpcServer > create_$interface.name$Server(
177
88
eprosima::fastdds::dds::DomainParticipant& part,
178
89
const char* service_name,
179
90
const eprosima::fastdds::dds::ReplierQos& qos,
180
- std::shared_ptr<$interface.name$ServerSchedulingStrategy > scheduler,
91
+ std::shared_ptr<eprosima::fastdds::dds::rpc::RpcServerSchedulingStrategy > scheduler,
181
92
std::shared_ptr<$interface.name$Server_IServerImplementation> implementation);
182
93
$endif$
183
94
>>
184
95
185
96
operation_prototype(op) ::= <<
186
97
$if(op.annotationFeed)$
187
98
virtual void $op.name$(
188
- const $interface.name$Server_ClientContext & info,
99
+ const eprosima::fastdds::dds::rpc::RpcRequest & info,
189
100
$if(op.parameters)$
190
101
$operation_parameters(op.parameters)$,
191
102
$endif$
@@ -194,18 +105,18 @@ $else$
194
105
$if(op.outputparam)$
195
106
virtual $paramRetType(op.outTypeCode)$ $op.name$(
196
107
$if(op.inputparam)$
197
- const $interface.name$Server_ClientContext & info,
108
+ const eprosima::fastdds::dds::rpc::RpcRequest & info,
198
109
$operation_parameters(op.inputparam)$) = 0;
199
110
$else$
200
- const $interface.name$Server_ClientContext & info) = 0;
111
+ const eprosima::fastdds::dds::rpc::RpcRequest & info) = 0;
201
112
$endif$
202
113
$elseif(op.inputparam)$
203
114
virtual $paramRetType(op.rettype)$ $op.name$(
204
- const $interface.name$Server_ClientContext & info,
115
+ const eprosima::fastdds::dds::rpc::RpcRequest & info,
205
116
$operation_parameters(op.inputparam)$) = 0;
206
117
$else$
207
118
virtual $paramRetType(op.rettype)$ $op.name$(
208
- const $interface.name$Server_ClientContext & info) = 0;
119
+ const eprosima::fastdds::dds::rpc::RpcRequest & info) = 0;
209
120
$endif$
210
121
$endif$
211
122
>>
0 commit comments