RTI Routing Service Version 7.7.0
routingservice_processor.h
Go to the documentation of this file.
1/*
2 * (c) Copyright, Real-Time Innovations, 2002-2024.
3 * All rights reserved.
4 *
5 * No duplications, whole or partial, manual or electronic, may be made
6 * without express written permission. Any such copies, or
7 * revisions thereof, must display this notice unaltered.
8 * This code contains trade secrets of Real-Time Innovations, Inc.
9 */
10
11#ifndef routingservice_processor_h
12#define routingservice_processor_h
13
15#include "routingservice/routingservice_adapter_new.h"
16
17#ifdef __cplusplus
18 extern "C" {
19#endif
20
21/*e \file
22 @brief RTI Routing Service Processor API
23*/
24
25/*****************************************************************************/
26/* Route */
27/*****************************************************************************/
28
29/*e \defgroup RTI_RoutingServiceProcessorModule RTI Routing Service Processor API
30 *
31 * \ingroup ROUTER
32 *
33 * @brief Entity responsible for administering inputs and outputs
34 *
35 */
36struct RTI_RoutingServiceRouteImpl;
37
38typedef struct RTI_RoutingServiceRouteImpl RTI_RoutingServiceRoute;
39
40/*
41 * --- RTI_RoutingServiceInput ------------------------------------------------
42 */
43
44/*e
45 * \ingroup RTI_RoutingServiceProcessorModule
46 *
47 * @brief A pair of sample and sample info arrays. They are assumed to be of the
48 * same length.
49 *
50 * @see RTI_RoutingServiceSample
51 * @see RTI_RoutingServiceSampleInfo
52 */
54 RTI_RoutingServiceSample *data_array;
56 int length;
57};
58
59#define RTI_RoutingServiceLoanedSamples_INITIALIZER {\
60 NULL,\
61 NULL,\
62 0 \
63}
64
65struct RTI_RoutingServiceInputImpl;
66
67typedef struct RTI_RoutingServiceInputImpl RTI_RoutingServiceInput;
68
69/*e \ingroup RTI_RoutingServiceProcessorModule
70 *
71 * @brief Returns the name of the specified input.
72 *
73 * The input name is given by the attribute of the corresponding XML tag
74 * in the configuration.
75 *
76 * @param self \b In. Input for which the name is returned.
77 *
78 */
79extern ROUTERDllExport
80const char* RTI_RoutingServiceInput_get_name(RTI_RoutingServiceInput *self);
81
82/*e \ingroup RTI_RoutingServiceProcessorModule
83 *
84 * Returns the type information associated with the specified Input.
85 * The TypeInformation refers to the format of the stream that the specified
86 * Input's read operation expects to receive.
87 *
88 * @param self \b In. Input for which the type information is returned.
89 */
90extern ROUTERDllExport
92RTI_RoutingServiceInput_get_stream_info(RTI_RoutingServiceInput *self);
93
94/*e \ingroup RTI_RoutingServiceProcessorModule
95 *
96 * @brief Checks whether an Input is active
97 *
98 * An Input is active when it has data available but not yet read. That is,
99 * the data available notification has been received but a call to read or take the
100 * samples has not been made.
101 *
102 * @param self \b In. Input to be checked. Cannot be null.
103 *
104 * @return \c DDS_BOOLEAN_FALSE if the Input is inactive, otherwise,
105 * \c DDS_BOOLEAN_TRUE.
106 */
107extern ROUTERDllExport
108DDS_Boolean RTI_RoutingServiceInput_is_active(RTI_RoutingServiceInput *self);
109
110/*e \ingroup RTI_RoutingServiceProcessorModule
111 *
112 * @brief Takes all the available samples in this Input into the specified
113 * loaned samples instance.
114 *
115 * @pre Input is enabled
116 *
117 * This operation will call \c take() on the underlying
118 * RTI_RoutingServiceStreamReader, and the samples will be loaned into the
119 * given loaned samples collection. Samples loaned have to be returned by
120 * calling RTI_RoutingServiceInput_return_loan().
121 *
122 * @param self \b In. Input to take the samples from. Cannot be null.
123 * @param loaned_samples \b Out. Samples taken will be stored here. Cannot be
124 * null.
125 *
126 * @return \c DDS_BOOLEAN_FALSE if the samples could not be taken,
127 * \c DDS_BOOLEAN_TRUE otherwise.
128 *
129 * @see RTI_RoutingServiceLoanedSamples
130 */
131extern ROUTERDllExport
133 RTI_RoutingServiceInput *self,
134 struct RTI_RoutingServiceLoanedSamples *loaned_samples);
135
136/*e \ingroup RTI_RoutingServiceProcessorModule
137 *
138 * @brief Takes all the available samples in this Input into the specified
139 * loaned samples instance, filtering samples based on the given
140 * data selector.
141 *
142 * @pre Input is enabled
143 *
144 * This operation will call \c take() on the underlying
145 * RTI_RoutingServiceStreamReader, and the samples will be loaned into the
146 * given loaned samples collection. Samples loaned have to be returned by
147 * calling RTI_RoutingServiceInput_return_loan().
148 *
149 * @param self \b In. Input to take the samples from.
150 * @param loaned_samples \b Out. Samples taken will be stored here.
151 * @param selector \b In. Selection criteria for the samples to be taken.
152 *
153 * @return \c DDS_BOOLEAN_FALSE if the samples could not be taken,
154 * \c DDS_BOOLEAN_TRUE otherwise.
155 *
156 * @see RTI_RoutingServiceLoanedSamples
157 * @see RTI_RoutingServiceSelectorState
158 */
159extern ROUTERDllExport
161 RTI_RoutingServiceInput *self,
162 struct RTI_RoutingServiceLoanedSamples *loaned_samples,
163 const struct RTI_RoutingServiceSelectorState *selector);
164
165/*e \ingroup RTI_RoutingServiceProcessorModule
166 *
167 * @brief Reads all the available samples in this Input into the specified
168 * loaned samples instance.
169 *
170 * @pre Input is enabled
171 *
172 * This operation will call \c read() on the underlying
173 * RTI_RoutingServiceStreamReader, and the samples will be loaned into the
174 * given loaned samples collection. Samples loaned have to be returned by
175 * calling RTI_RoutingServiceInput_return_loan().
176 *
177 * @param self \b In. Input to read the samples from.
178 * @param loaned_samples \b Out. Samples read will be stored here.
179 *
180 * @return \c DDS_BOOLEAN_FALSE) if the samples could not be read,
181 * \c DDS_BOOLEAN_TRUE otherwise.
182 * @see RTI_RoutingServiceLoanedSamples
183 */
184extern ROUTERDllExport
186 RTI_RoutingServiceInput *self,
187 struct RTI_RoutingServiceLoanedSamples *loaned_samples);
188
189/*e \ingroup RTI_RoutingServiceProcessorModule
190 *
191 * @brief Reads all the available samples in this Input into the
192 * specified loaned samples instance, filtering samples based on the
193 * given data selector. Cannot be null.
194 *
195 * @pre Input is enabled
196 *
197 * This operation will call \c read() on the underlying
198 * RTI_RoutingServiceStreamReader, and the samples will be loaned into the
199 * given loaned samples collection. Samples loaned have to be returned by
200 * calling RTI_RoutingServiceInput_return_loan().
201 *
202 * @param self \b In. Input to read the samples from. Cannot be null.
203 * @param loaned_samples \b Out. Samples taken will be stored here. Cannot be
204 * null.
205 * @param selector \b In. Selection criteria for the samples to be taken.
206 *
207 * @return \c DDS_BOOLEAN_FALSE if the samples could not be read,
208 * \c DDS_BOOLEAN_TRUE otherwise.
209 *
210 * @see RTI_RoutingServiceLoanedSamples
211 * @see RTI_RoutingServiceSelectorState
212 * @see RTI_RoutingServiceInput_return_loan
213 */
214extern ROUTERDllExport
216 RTI_RoutingServiceInput *self,
217 struct RTI_RoutingServiceLoanedSamples *loaned_samples,
218 const struct RTI_RoutingServiceSelectorState *selector);
219
220/*e \ingroup RTI_RoutingServiceProcessorModule
221 *
222 * @brief Returns a loan on the read or taken samples.
223 *
224 * Call this method to indicate that you're done accessing
225 * the collection of samples obtained by an earlier
226 * invocation of RTI_RoutingServiceInput_take(),
227 * RTI_RoutingServiceInput_take_w_selector(), RTI_RoutingServiceInput_read() or
228 * RTI_RoutingServiceInput_read_w_selector().
229 *
230 * @param self \b In. Input the samples were taken/read from. Cannot be null.
231 * @param loaned_samples \b Inout. The loaned samples to be returned. Cannot be
232 * null.
233 *
234 * @return \c DDS_BOOLEAN_FALSE if the samples could not be returned successfully,
235 * \c DDS_BOOLEAN_TRUE otherwise.
236 *
237 * @see RTI_RoutingServiceLoanedSamples
238 * */
239extern ROUTERDllExport
241 RTI_RoutingServiceInput *self,
242 struct RTI_RoutingServiceLoanedSamples *loaned_samples);
243
244/*e \ingroup RTI_RoutingServiceProcessorModule
245 *
246 * @brief Creates a query object that selects the data with the specified
247 * filter.
248 *
249 * @pre Input is enabled.
250 *
251 * This operation allows reading data with a SelectorState that contains
252 * a query object returned by this operation.
253 *
254 * A query object type is implementation-dependent and guaranteed to
255 * to be used only within the same StreamReader that created it. Because
256 * a query object may be an expensive resource, this operation allows
257 * receiving a previously created query for a potential reuse and update of
258 * its filter.
259 *
260 * @param self \b In. Input used to create the content query. Cannot be null.
261 * @param old_query_data \b Inout. A previously created query object that
262 * is provided for potential reuse and update of its filter.
263 * @param content \b In. The filter to be applied. Cannot be null.
264 *
265 * @return The new or updated query object.
266 *
267 * @see RTI_RoutingServiceSelectorStateQueryData
268 * @see RTI_RoutingServiceSelectorContent
269 */
270extern ROUTERDllExport
271RTI_RoutingServiceSelectorStateQueryData
273 RTI_RoutingServiceInput *self,
274 RTI_RoutingServiceSelectorStateQueryData old_query_data,
275 const struct RTI_RoutingServiceSelectorContent *content);
276
277/*e \ingroup RTI_RoutingServiceProcessorModule
278 *
279 * @brief Deletes a content query created from this Input.
280 *
281 * @pre Input is enabled
282 *
283 * @param self \b In. Input used to create the content query. Cannot be null.
284 * @param query_data \b In. The query object to be deleted. Cannot be null.
285 *
286 * @return \c DDS_BOOLEAN_FALSE if the operation fails, \c DDS_BOOLEAN_TRUE
287 * otherwise.
288 */
289extern ROUTERDllExport
291 RTI_RoutingServiceInput *self,
292 RTI_RoutingServiceSelectorStateQueryData query_data);
293
294/*
295 * --- RTI_RoutingServiceOutput -----------------------------------------------
296 */
297
298struct RTI_RoutingServiceOutputImpl;
299
300typedef struct RTI_RoutingServiceOutputImpl RTI_RoutingServiceOutput;
301
302/*e \ingroup RTI_RoutingServiceProcessorModule
303 *
304 * @brief Returns the name of the specified output.
305 *
306 * The output name is given by the attribute of the corresponding XML tag
307 * in the configuration.
308 *
309 * @param self \b In. Output for which the name is required.
310 *
311 */
312extern ROUTERDllExport
313const char* RTI_RoutingServiceOutput_get_name(RTI_RoutingServiceOutput *self);
314
315/*e \ingroup RTI_RoutingServiceProcessorModule
316 *
317 * @brief Returns the type information associated with the specified Output.
318 * The type information refers to the format of the stream that this Output's
319 * write operation expects to receive from the processor of the route.
320 *
321 * The TypeInformation may be the one coming from the Transformation if this
322 * Output has one. In this case, the type information is the one corresponding
323 * to the Output side of the Transformation.
324 *
325 * @param self \b In. Output for which the type information is required. Cannot
326 * be null.
327 */
328extern ROUTERDllExport
329const struct RTI_RoutingServiceStreamInfo *
330RTI_RoutingServiceOutput_get_stream_info(RTI_RoutingServiceOutput *self);
331
332/*e \ingroup RTI_RoutingServiceProcessorModule
333 *
334 * @brief Writes a list of data and information samples.
335 *
336 * @pre Output enabled
337 *
338 * @param self \b In. The Output where to write the samples. Cannot be null.
339 * @param sample_array \b In. Array of samples to write. Cannot be null.
340 * @param sample_info_array \b In. Array of information samples to write.
341 * @param array_length \b Inout. The length of the sample and info arrays.
342 * Output is the number of samples written. Cannot be null.
343 *
344 * @return \c DDS_BOOLEAN_FALSE if the write operation was not successful.
345 * \c DDS_BOOLEAN_TRUE otherwise.
346 */
347extern ROUTERDllExport
349 RTI_RoutingServiceOutput *self,
350 const RTI_RoutingServiceSample *sample_array,
351 const RTI_RoutingServiceSampleInfo *sample_info_array,
352 int *array_length);
353
354/*e \ingroup RTI_RoutingServiceProcessorModule
355 *
356 * @brief Writes a single sample, optionally with metatada indicated by an info
357 * sample
358 *
359 * @pre Output enabled
360 *
361 * @param self \b In. The Output where to write the samples. Cannot be null.
362 * @param data \b In. Data sample to be written. Cannot be null.
363 * @param info \b In. Associated information sample.
364 *
365 * @return \c DDS_BOOLEAN_FALSE if the sample could not be written,
366 * \c DDS_BOOLEAN_TRUE otherwise.
367 */
368extern ROUTERDllExport
370 RTI_RoutingServiceOutput *self,
371 const RTI_RoutingServiceSample data,
373
374/*
375 * --- RTI_RoutingServiceRoute ------------------------------------------------
376 */
377
378/*e \ingroup RTI_RoutingServiceProcessorModule
379 *
380 * @brief Returns the number of inputs associated with this Route.
381 *
382 */
383extern ROUTERDllExport
384int RTI_RoutingServiceRoute_get_input_count(RTI_RoutingServiceRoute *self);
385
386/*e \ingroup RTI_RoutingServiceProcessorModule
387 *
388 * @brief Checks whether the Input with the specified index is enabled.
389 *
390 * @pre index >= 0 and index < RTI_RoutingServiceRoute_get_input_count(self)
391 *
392 * Note: This function will return \c DDS_BOOLEAN_FALSE both when all the parameters
393 * are correct and the input is disabled, or when any of the parameters are
394 * incorrect. It's the responsibility of the caller to ensure the parameters are
395 * valid, so that the returned value is, too.
396 *
397 * @param self \b In. The Route for which to check the Input status. Cannot be
398 * null.
399 * @param index \b In. The index, starting at 0, of the Input for which the
400 * status is required.
401 */
402extern ROUTERDllExport
404 RTI_RoutingServiceRoute *self,
405 int index);
406
407/*e \ingroup RTI_RoutingServiceProcessorModule
408 *
409 * @brief Returns the Input at the specified index.
410 *
411 * @pre index >= 0 and index < RTI_RoutingServiceRoute_get_input_count(self)
412 *
413 * Inputs are ordered according to the order of input declarations in the XML
414 * configuration. Then indexes are assigned increasingly starting at zero from
415 * the first declaration.
416 *
417 * @return The Input at the specified index, or \c NULL if the Input is not
418 * enabled or the index is out of bounds.
419 */
420extern ROUTERDllExport
421RTI_RoutingServiceInput * RTI_RoutingServiceRoute_get_input_at(
422 RTI_RoutingServiceRoute *self,
423 int index);
424
425/*e \ingroup RTI_RoutingServiceProcessorModule
426 *
427 * @brief Looks up the specified Input by its configuration name.
428 *
429 * The Input configuration name is the value of the name attribute specified
430 * within the &lt;input&gt; tag in the XML configuration.
431 *
432 * \b NOTE: The condition that the input must be enabled will be removed
433 * in a future version. This is being tracked with issue ID ROUTING-1131.
434 *
435 * @param self \b In. The Route for which to obtain the Input. Cannot be null.
436 * @param input_name \b In. Name of the input configuration. Cannot be null.
437 *
438 * @return The Input corresponding to the specified configuration name or
439 * NULL if it could not be found or if the input is not enabled.
440 */
441extern ROUTERDllExport
443 RTI_RoutingServiceRoute *self,
444 const char *input_name);
445
446/*e \ingroup RTI_RoutingServiceProcessorModule
447 *
448 * @brief Returns the number of outputs associated with this Route.
449 *
450 */
451extern ROUTERDllExport
452int RTI_RoutingServiceRoute_get_output_count(RTI_RoutingServiceRoute *self);
453
454/*e \ingroup RTI_RoutingServiceProcessorModule
455 *
456 * @brief Checks whether the Output at the specified index is enabled.
457 *
458 * @pre index >= 0 and index < RTI_RoutingServiceRoute_get_output_count(self)
459 *
460 * Note: This function will return \c DDS_BOOLEAN_FALSE both when all the parameters
461 * are correct and the output is disabled, or when any of the parameters are
462 * incorrect. It's the responsibility of the caller to ensure the parameters are
463 * valid, so that the returned value is, too.
464 *
465 * @param self \b In. The Route for which to check the Output status. Cannot be
466 * null.
467 * @param index \b In. The index, starting at 0, of the Output for which the
468 * status is required.
469 */
470extern ROUTERDllExport
472 RTI_RoutingServiceRoute *self,
473 int index);
474
475/*e \ingroup RTI_RoutingServiceProcessorModule
476 *
477 * @brief Returns the Output at the specified index.
478 *
479 * @pre index >= 0 and index < RTI_RoutingServiceRoute_get_output_count(self)
480 *
481 * Outputs are ordered according to the order of output declarations in the XML
482 * configuration. Then indexes are assigned increasingly starting at zero from
483 * the first declaration.
484 *
485 * @return The Output at the specified index, or \c NULL if the Output is not
486 * enabled or the index is out of bounds.
487 */
488extern ROUTERDllExport
489RTI_RoutingServiceOutput * RTI_RoutingServiceRoute_get_output_at(
490 RTI_RoutingServiceRoute *self,
491 int index);
492
493/*e \ingroup RTI_RoutingServiceProcessorModule
494 *
495 * @brief Looks up the specified Output by its configuration name.
496 *
497 * The Output configuration name is the value of the name attribute specified
498 * within the &lt;output&gt; tag in the XML configuration.
499 *
500 * \b NOTE: The condition that the input must be enabled will be removed
501 * in a future version. This is being tracked with issue ID ROUTING-1131.
502 *
503 * @param self \b In. The Route for which to obtain the Output. Cannot be null.
504 * @param output_name \b In. Name of the output configuration. Cannot be null.
505 *
506 * @return The Output corresponding to the specified configuration name or
507 * NULL if it could not be found or if the output is not enabled.
508 */
509extern ROUTERDllExport
511 RTI_RoutingServiceRoute *self,
512 const char * output_name);
513
514/*e \ingroup RTI_RoutingServiceProcessorModule
515 *
516 * @brief Sends a wakeup event to the specified Route.
517 * This operation can be safely called from any thread context.
518 */
519extern ROUTERDllExport
520void RTI_RoutingServiceRoute_wakeup_route(RTI_RoutingServiceRoute *route);
521
522/*e \ingroup RTI_RoutingServiceProcessorModule
523 *
524 * @brief Get the current period of the periodic event for this Route.
525 *
526 * @param self \b In. The Route for which to obtain the period. Cannot be null.
527 * @param period \b Out. The current periodic event period.
528 */
529extern ROUTERDllExport
531 RTI_RoutingServiceRoute *self,
532 struct DDS_Duration_t *period);
533
534/*e \ingroup RTI_RoutingServiceProcessorModule
535 *
536 * @brief Changes the periodic event period for this route.
537 *
538 * @pre not DDS_Duration_is_zero(period)
539 * @pre not DDS_Duration_is_infinite(period)
540 *
541 * This operation can be called many times within the same periodic event, in
542 * which only the last call will make effect.
543 *
544 * The operation has no effect if the periodic event is not enabled in the
545 * route.
546 *
547 * @param self \b In. The Route for which to set the period. Cannot be null.
548 * @param period \b In. New session period for periodic events.
549 *
550 */
551extern ROUTERDllExport
553 RTI_RoutingServiceRoute *self,
554 const struct DDS_Duration_t *period);
555
556/*e \ingroup RTI_RoutingServiceProcessorModule
557 *
558 * @brief Returns the first enabled Input in this route.
559 *
560 * This function, along with RTI_RoutingServiceRoute_get_next_input(), provides
561 * iterator-based capabilities to iterate through a Route's enabled Inputs.
562 *
563 */
564extern ROUTERDllExport
566 RTI_RoutingServiceRoute *self);
567
568/*e \ingroup RTI_RoutingServiceProcessorModule
569 *
570 * @brief Returns the next enabled Input sibling to the specified input.
571 *
572 * This function, along with RTI_RoutingServiceRoute_get_first_input(), provides
573 * iterator-based capabilities to iterate through a Route's enabled Inputs.
574 */
575extern ROUTERDllExport
577 RTI_RoutingServiceRoute *self,
578 RTI_RoutingServiceInput *prev_input);
579
580/*e \ingroup RTI_RoutingServiceProcessorModule
581 *
582 * @brief Returns the first enabled output in this route
583 *
584 * This function, along with RTI_RoutingServiceRoute_get_next_output(), provides
585 * iterator-based capabilities to iterate through a Route's enabled Outputs.
586 */
587extern ROUTERDllExport
589 RTI_RoutingServiceRoute *self);
590
591/*e \ingroup RTI_RoutingServiceProcessorModule
592 *
593 * @brief Returns the next enabled Output sibling to the specified output.
594 *
595 * This function, along with RTI_RoutingServiceRoute_get_first_output(), provides
596 * iterator-based capabilities to iterate through a Route's enabled Outputs.
597 */
598extern ROUTERDllExport
600 RTI_RoutingServiceRoute *self,
601 RTI_RoutingServiceOutput *prev_output);
602
603/*e \ingroup RTI_RoutingServiceProcessorModule
604 *
605 * @brief Returns the fully-qualified name of this Route, derived from the
606 * XML configuration.
607 *
608 */
609extern ROUTERDllExport
611 RTI_RoutingServiceRoute *self);
612
613/*****************************************************************************/
614/* RouteEvent */
615/*****************************************************************************/
616
617/*e \ingroup RTI_RoutingServiceProcessorModule
618 *
619 * @brief Representation of the different event kinds triggered for a Route.
620 *
621 */
622typedef enum {
623
624 RTI_ROUTING_SERVICE_ROUTE_EVENT_NONE = 0,
625 RTI_ROUTING_SERVICE_ROUTE_EVENT_INPUT_ENABLED,
626 RTI_ROUTING_SERVICE_ROUTE_EVENT_INPUT_DISABLED,
627 RTI_ROUTING_SERVICE_ROUTE_EVENT_OUTPUT_ENABLED,
628 RTI_ROUTING_SERVICE_ROUTE_EVENT_OUTPUT_DISABLED,
629 RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_STARTED,
630 RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_STOPPED,
631 RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_RUNNING,
632 RTI_ROUTING_SERVICE_ROUTE_EVENT_ROUTE_PAUSED,
633 RTI_ROUTING_SERVICE_ROUTE_EVENT_DATA_ON_INPUTS,
634 RTI_ROUTING_SERVICE_ROUTE_EVENT_PERIODIC_ACTION,
635 RTI_ROUTING_SERVICE_ROUTE_EVENT_OUTPUT_STREAM_REQUEST,
636 RTI_ROUTING_SERVICE_ROUTE_EVENT_WAKEUP,
637 RTI_RoutingServiceRouteEventKind_COUNT,
638 RTI_ROUTING_SERVICE_ROUTE_EVENT_ALL = 0xffffffff,
639
641
642
643/*i \ingroup RTI_RoutingServiceProcessorModule
644 *
645 */
646struct RTI_RoutingServiceRouteEventImpl;
647
648/*i \ingroup RTI_RoutingServiceProcessorModule
649 *
650 * @brief An event which indicates that an action occurred in a Route.
651 *
652 */
653typedef struct RTI_RoutingServiceRouteEventImpl RTI_RoutingServiceRouteEvent;
654
655/*e
656 * \ingroup RTI_RoutingServiceProcessorModule
657 *
658 * @brief Returns the kind of this RouteEvent.
659 *
660 * @return The Route that triggered the event, or
661 * \c RTI_ROUTING_SERVICE_ROUTE_EVENT_NONE if the parameter passed is
662 * \c null.
663 */
664extern ROUTERDllExport
666 RTI_RoutingServiceRouteEvent *self);
667
668/*e
669 * \ingroup RTI_RoutingServiceProcessorModule
670 *
671 * @brief Returns the Route that triggered the event.
672 *
673 * @return The Route that triggered the event, or \c NULL if the parameter
674 * passed is null.
675 */
676extern ROUTERDllExport
678 RTI_RoutingServiceRouteEvent *self);
679
680/*e
681 * \ingroup RTI_RoutingServiceProcessorModule
682 *
683 * @brief Returns the data associated with the event.
684 *
685 * The event data depends on the kind of events. See documentation of individual
686 * events for the type of event data they provide.
687 *
688 * @return The data associated with the event, or \c NULL if the parameter
689 * passed is null.
690 */
691extern ROUTERDllExport
693 RTI_RoutingServiceRouteEvent *self);
694
695/*e
696 * \ingroup RTI_RoutingServiceProcessorModule
697 *
698 * @brief Returns the entity that is directly affected by the event.
699 *
700 * Each kind of event can be affected by different types of entities.
701 * See documentation of individual events for the type of affected entity.
702 *
703 * @return The entity affected by the event, or \c NULL if the parameter
704 * passed is null.
705 */
706extern ROUTERDllExport
708 RTI_RoutingServiceRouteEvent *self);
709
710/*
711-----------------------------------------------------------------------------
712 Processor
713-----------------------------------------------------------------------------
714*/
715
717
718/*e \ingroup RTI_RoutingServiceProcessorModule
719 *
720 * @brief Prototype of the function that processes an event that occurred in the
721 * Route where the Processor is installed.
722 *
723 * @param processor_data \b In. Implementation data of the Processor associated
724 * with the Route that triggered the event.
725 * @param route_event \b In. Event that was triggered within the Route.
726 * @param env \b Out. Environment for error indications.
727 *
728*/
730 void * processor_data,
731 RTI_RoutingServiceRouteEvent * route_event,
733
734
735/*e \ingroup RTI_RoutingServiceProcessorModule
736 *
737 * @brief Prototype of the function that updates a Processor configuration.
738 *
739 * @param processor_data \b In. Implementation data.
740 * @param properties \b In. New configuration properties.
741 * @param env \b Out. Environment for error indications.
742 *
743 */
745 void * processor_data,
748
749
750/*e \ingroup RTI_RoutingServiceProcessorModule
751 *
752 * @brief Main Processor class.
753 *
754 * A Route can notify a Processor about different events related to inputs
755 * and outputs.
756 *
757 * @see RTI_RoutingServiceRouteEvent
758 */
760
761 /*e @brief Handles event processing (\b required). */
763
764 /*e @brief Handles configuration changes in a Processor (\b optional). */
766
767 /*e
768 * @brief Implementation data. Provided by implementors, and passed back
769 * in API calls.
770 */
772};
773
774/*e \ingroup RTI_RoutingServiceProcessorModule
775 *
776 * @brief Entry point for creating and deleting Processor objects.
777 *
778 */
780
781
782/*e \ingroup RTI_RoutingServiceProcessorModule
783 *
784 * @brief Prototype of the function that creates a ProcessorPlugin.
785 *
786 * @param properties \b In. Configuration properties for the ProcessorPlugin.
787 * @param env \b Out. Environment for error indications.
788 *
789 * @return New ProcessorPlugin instance if successful. Otherwise, \c NULL.
790 *
791 * @see RTI_RoutingServiceProcessorPlugin_DeleteFcn
792 */
794(*RTI_RoutingServiceProcessorPlugin_CreateFcn)(
797
798/*e \ingroup RTI_RoutingServiceProcessorModule
799 *
800 * @brief Prototype of the function that deletes a ProcessorPlugin.
801 *
802 * @param plugin \b In. ProcessorPlugin to be deleted.
803 * @param env \b Out. Environment for error indications.
804 *
805 * @see RTI_RoutingServiceProcessorPlugin_CreateFcn
806 */
808 struct RTI_RoutingServiceProcessorPlugin * plugin,
810
811
812/*e \ingroup RTI_RoutingServiceProcessorModule
813 *
814 * @brief Prototype of the function that creates a route Processor.
815 *
816 * This function is called when a Processor is created.
817 *
818 * @param processor_plugin_data implementation data of the plugin from which the
819 * Processor is created
820 * @param route Processor to be deleted.
821 * @param properties Configuration properties for the Processor.
822 * These properties correspond to the properties specified
823 * within the tag &lt;processor&gt;.
824 * @param env Environment for error indications.
825 *
826 * @return New processor if successful. Otherwise, error.
827 *
828 * @see RTI_RoutingServiceProcessorPlugin#DeleteProcessorFcn
829*/
830typedef struct RTI_RoutingServiceProcessor *
831(*RTI_RoutingServiceProcessorPlugin_CreateProcessorFcn)(
832 void * processor_plugin_data,
833 RTI_RoutingServiceRoute * route,
836
837/*i \ingroup RTI_RoutingServiceProcessorModule
838 *
839 * @brief Prototype of the function that deletes a Processor.
840 *
841 * This function is called when a Processor is deleted
842 *
843 * @param processor_plugin_data implementation data of the plugin from which the
844 * Processor is deleted.
845 * @param processor Processor to be deleted.
846 * @param env Environment for error indications.
847 *
848 * @see RTI_RoutingServiceProcessorPlugin_CreateProcessorFcn
849*/
850typedef void (*RTI_RoutingServiceProcessorPlugin_DeleteProcessorFcn)(
851 void * processor_plugin_data,
852 struct RTI_RoutingServiceProcessor * processor,
853 RTI_RoutingServiceRoute * route,
855
856/*e \ingroup RTI_RoutingServiceProcessorModule
857 *
858 * @brief ProcessorPlugin class.
859 *
860 * ProcessorPlugins are the entry points to the Processor API. They provide a
861 * factory for Processors.
862*/
864 int _init;
865 struct RTI_RoutingServiceVersion _rs_version;
866
867 /*e
868 * @brief The version of this ProcessorPlugin.
869 */
871
872 /*e
873 * @brief Handles the deletion of the ProcessorPlugin.
874 */
876
877 /*e
878 * @brief Handles the creation of Processors.
879 */
881
882 /*e
883 * @brief Handles the deletion of Processors.
884 */
885 RTI_RoutingServiceProcessorPlugin_DeleteProcessorFcn delete_processor;
886
887 /*e
888 * @brief A placeholder for Processor implementors to keep a pointer to data
889 * that may be needed by the implementation.
890 */
892};
893
894#define RTI_ROUTING_SERVICE_PROCESSOR_PLUGIN_INIT_NUMBER (8765432)
895
896/*e \ingroup RTI_RoutingServiceProcessorModule
897 *
898 * @brief Utility macro to initialize a ProcessorPlugin object.
899 *
900 * This macro must be called to initialize the value returned by
901 * RTI_RoutingServiceProcessorPlugin_CreateFcn.
902 *
903 * @param plugin Pointer to the ProcessorPlugin object.
904 *
905 * @see RTI_RoutingServiceProcessorPlugin_CreateFcn
906*/
907#define RTI_RoutingServiceProcessorPlugin_initialize(plugin) \
908{ \
909 struct RTI_RoutingServiceVersion rsVersion = RTI_ROUTING_SERVICE_VERSION; \
910 struct RTI_RoutingServiceVersion processorVersion = {0,0,0,0}; \
911 (plugin)->_init = RTI_ROUTING_SERVICE_PROCESSOR_PLUGIN_INIT_NUMBER; \
912 (plugin)->_rs_version = rsVersion; \
913 (plugin)->plugin_version = processorVersion; \
914 (plugin)->plugin_delete = 0; \
915 (plugin)->create_processor = 0; \
916 (plugin)->delete_processor = 0; \
917 (plugin)->processor_plugin_data = 0; \
918}
919
920#ifdef __cplusplus
921} /* extern "C" */
922#endif
923
924#endif /* routingservice_processor_h */
struct RTI_RoutingServiceEnvironmentImpl RTI_RoutingServiceEnvironment
The environment permits the return of error information in the RTI Routing Service API and informatio...
Definition: routingservice_infrastructure.h:183
void * RTI_RoutingServiceSample
Stream sample.
Definition: routingservice_infrastructure.h:482
void * RTI_RoutingServiceSampleInfo
Stream sample info. In DDS, this is a DDS_SampleInfo object.
Definition: routingservice_infrastructure.h:489
void RTI_RoutingServiceRoute_get_period(RTI_RoutingServiceRoute *self, struct DDS_Duration_t *period)
Get the current period of the periodic event for this Route.
DDS_Boolean RTI_RoutingServiceRoute_is_input_enabled(RTI_RoutingServiceRoute *self, int index)
Checks whether the Input with the specified index is enabled.
RTI_RoutingServiceInput * RTI_RoutingServiceRoute_get_input_at(RTI_RoutingServiceRoute *self, int index)
Returns the Input at the specified index.
const char * RTI_RoutingServiceInput_get_name(RTI_RoutingServiceInput *self)
Returns the name of the specified input.
DDS_Boolean RTI_RoutingServiceInput_is_active(RTI_RoutingServiceInput *self)
Checks whether an Input is active.
RTI_RoutingServiceOutput * RTI_RoutingServiceRoute_lookup_output_by_name(RTI_RoutingServiceRoute *self, const char *output_name)
Looks up the specified Output by its configuration name.
RTI_RoutingServiceInput * RTI_RoutingServiceRoute_get_first_input(RTI_RoutingServiceRoute *self)
Returns the first enabled Input in this route.
RTI_RoutingServiceSelectorStateQueryData RTI_RoutingServiceInput_create_content_query(RTI_RoutingServiceInput *self, RTI_RoutingServiceSelectorStateQueryData old_query_data, const struct RTI_RoutingServiceSelectorContent *content)
Creates a query object that selects the data with the specified filter.
RTI_RoutingServiceOutput * RTI_RoutingServiceRoute_get_next_output(RTI_RoutingServiceRoute *self, RTI_RoutingServiceOutput *prev_output)
Returns the next enabled Output sibling to the specified output.
const struct RTI_RoutingServiceStreamInfo * RTI_RoutingServiceInput_get_stream_info(RTI_RoutingServiceInput *self)
RTI_RoutingServiceInput * RTI_RoutingServiceRoute_lookup_input_by_name(RTI_RoutingServiceRoute *self, const char *input_name)
Looks up the specified Input by its configuration name.
void * RTI_RoutingServiceRouteEvent_get_affected_entity(RTI_RoutingServiceRouteEvent *self)
Returns the entity that is directly affected by the event.
RTI_RoutingServiceRoute * RTI_RoutingServiceRouteEvent_get_route(RTI_RoutingServiceRouteEvent *self)
Returns the Route that triggered the event.
RTI_RoutingServiceOutput * RTI_RoutingServiceRoute_get_first_output(RTI_RoutingServiceRoute *self)
Returns the first enabled output in this route.
DDS_Boolean RTI_RoutingServiceInput_read(RTI_RoutingServiceInput *self, struct RTI_RoutingServiceLoanedSamples *loaned_samples)
Reads all the available samples in this Input into the specified loaned samples instance.
RTI_RoutingServiceRouteEventKind RTI_RoutingServiceRouteEvent_get_kind(RTI_RoutingServiceRouteEvent *self)
Returns the kind of this RouteEvent.
void(* RTI_RoutingServiceProcessor_OnRouteEventFcn)(void *processor_data, RTI_RoutingServiceRouteEvent *route_event, RTI_RoutingServiceEnvironment *env)
Prototype of the function that processes an event that occurred in the Route where the Processor is i...
Definition: routingservice_processor.h:729
int RTI_RoutingServiceRoute_get_output_count(RTI_RoutingServiceRoute *self)
Returns the number of outputs associated with this Route.
const char * RTI_RoutingServiceOutput_get_name(RTI_RoutingServiceOutput *self)
Returns the name of the specified output.
DDS_Boolean RTI_RoutingServiceInput_delete_content_query(RTI_RoutingServiceInput *self, RTI_RoutingServiceSelectorStateQueryData query_data)
Deletes a content query created from this Input.
DDS_Boolean RTI_RoutingServiceInput_take_w_selector(RTI_RoutingServiceInput *self, struct RTI_RoutingServiceLoanedSamples *loaned_samples, const struct RTI_RoutingServiceSelectorState *selector)
Takes all the available samples in this Input into the specified loaned samples instance,...
void RTI_RoutingServiceRoute_wakeup_route(RTI_RoutingServiceRoute *route)
Sends a wakeup event to the specified Route. This operation can be safely called from any thread cont...
void * RTI_RoutingServiceRouteEvent_get_event_data(RTI_RoutingServiceRouteEvent *self)
Returns the data associated with the event.
DDS_Boolean RTI_RoutingServiceOutput_write(RTI_RoutingServiceOutput *self, const RTI_RoutingServiceSample *sample_array, const RTI_RoutingServiceSampleInfo *sample_info_array, int *array_length)
Writes a list of data and information samples.
const char * RTI_RoutingServiceRoute_get_full_name(RTI_RoutingServiceRoute *self)
Returns the fully-qualified name of this Route, derived from the XML configuration.
DDS_Boolean RTI_RoutingServiceInput_take(RTI_RoutingServiceInput *self, struct RTI_RoutingServiceLoanedSamples *loaned_samples)
Takes all the available samples in this Input into the specified loaned samples instance.
RTI_RoutingServiceInput * RTI_RoutingServiceRoute_get_next_input(RTI_RoutingServiceRoute *self, RTI_RoutingServiceInput *prev_input)
Returns the next enabled Input sibling to the specified input.
DDS_Boolean RTI_RoutingServiceRoute_is_output_enabled(RTI_RoutingServiceRoute *self, int index)
Checks whether the Output at the specified index is enabled.
void(* RTI_RoutingServiceProcessorPlugin_DeleteFcn)(struct RTI_RoutingServiceProcessorPlugin *plugin, RTI_RoutingServiceEnvironment *env)
Prototype of the function that deletes a ProcessorPlugin.
Definition: routingservice_processor.h:807
DDS_Boolean RTI_RoutingServiceOutput_write_sample(RTI_RoutingServiceOutput *self, const RTI_RoutingServiceSample data, const RTI_RoutingServiceSampleInfo info)
Writes a single sample, optionally with metatada indicated by an info sample.
DDS_Boolean RTI_RoutingServiceInput_read_w_selector(RTI_RoutingServiceInput *self, struct RTI_RoutingServiceLoanedSamples *loaned_samples, const struct RTI_RoutingServiceSelectorState *selector)
Reads all the available samples in this Input into the specified loaned samples instance,...
const struct RTI_RoutingServiceStreamInfo * RTI_RoutingServiceOutput_get_stream_info(RTI_RoutingServiceOutput *self)
Returns the type information associated with the specified Output. The type information refers to the...
DDS_Boolean RTI_RoutingServiceInput_return_loan(RTI_RoutingServiceInput *self, struct RTI_RoutingServiceLoanedSamples *loaned_samples)
Returns a loan on the read or taken samples.
void RTI_RoutingServiceRoute_set_period(RTI_RoutingServiceRoute *self, const struct DDS_Duration_t *period)
Changes the periodic event period for this route.
RTI_RoutingServiceOutput * RTI_RoutingServiceRoute_get_output_at(RTI_RoutingServiceRoute *self, int index)
Returns the Output at the specified index.
void(* RTI_RoutingServiceProcessor_UpdateFcn)(void *processor_data, const struct RTI_RoutingServiceProperties *properties, RTI_RoutingServiceEnvironment *env)
Prototype of the function that updates a Processor configuration.
Definition: routingservice_processor.h:744
struct RTI_RoutingServiceProcessor *(* RTI_RoutingServiceProcessorPlugin_CreateProcessorFcn)(void *processor_plugin_data, RTI_RoutingServiceRoute *route, const struct RTI_RoutingServiceProperties *properties, RTI_RoutingServiceEnvironment *env)
Prototype of the function that creates a route Processor.
Definition: routingservice_processor.h:831
RTI_RoutingServiceRouteEventKind
Representation of the different event kinds triggered for a Route.
Definition: routingservice_processor.h:622
int RTI_RoutingServiceRoute_get_input_count(RTI_RoutingServiceRoute *self)
Returns the number of inputs associated with this Route.
RTI Routing Service Infrastructure.
A pair of sample and sample info arrays. They are assumed to be of the same length.
Definition: routingservice_processor.h:53
ProcessorPlugin class.
Definition: routingservice_processor.h:863
RTI_RoutingServiceProcessorPlugin_DeleteProcessorFcn delete_processor
Handles the deletion of Processors.
Definition: routingservice_processor.h:885
RTI_RoutingServiceProcessorPlugin_CreateProcessorFcn create_processor
Handles the creation of Processors.
Definition: routingservice_processor.h:880
void * processor_plugin_data
A placeholder for Processor implementors to keep a pointer to data that may be needed by the implemen...
Definition: routingservice_processor.h:891
struct RTI_RoutingServiceVersion plugin_version
The version of this ProcessorPlugin.
Definition: routingservice_processor.h:870
RTI_RoutingServiceProcessorPlugin_DeleteFcn plugin_delete
Handles the deletion of the ProcessorPlugin.
Definition: routingservice_processor.h:875
Main Processor class.
Definition: routingservice_processor.h:759
RTI_RoutingServiceProcessor_OnRouteEventFcn on_route_event
Handles event processing (required).
Definition: routingservice_processor.h:762
RTI_RoutingServiceProcessor_UpdateFcn update
Handles configuration changes in a Processor (optional).
Definition: routingservice_processor.h:765
void * processor_data
Implementation data. Provided by implementors, and passed back in API calls.
Definition: routingservice_processor.h:771
Set of configuration properties.
Definition: routingservice_infrastructure.h:77
struct RTI_RoutingServiceNameValue * properties
Array of configuration properties.
Definition: routingservice_infrastructure.h:79
Stream information.
Definition: routingservice_infrastructure.h:521
Represents the version of a plugin or RTI Routing Service itself.
Definition: routingservice_infrastructure.h:190