50 #ifndef reda_circularlist_h
51 #include "reda/reda_circularlist.h"
55 #include "db/db_api.h"
67 #define NULL ((void*)0)
73 #define RT_MKINTERFACEID(class_,instance_) \
74 ((((class_)<<16)&0xffff0000) | (instance_))
76 #define RT_INTERFACE_CLASS(id_) ((id_) >> 16)
77 #define RT_INTERFACE_INSTANCE(id_) ((id_) & 0xffff)
80 #define RT_COMPONENT_CLASS_UNKNOWN (0x0000)
81 #define RT_COMPONENT_CLASS_DISCOVERY (0x0001)
82 #define RT_COMPONENT_CLASS_WHISTORY (0x0002)
83 #define RT_COMPONENT_CLASS_RHISTORY (0x0003)
84 #define RT_COMPONENT_CLASS_NETIO (0x0004)
87 #define RT_COMPONENT_INSTANCE_DISCOVERY_DPDE (1)
88 #define RT_COMPONENT_INSTANCE_DISCOVERY_DPSE (2)
89 #define RT_COMPONENT_INSTANCE_DISCOVERY_GROUP (3)
92 #define RT_COMPONENT_INSTANCE_WHISTORY_SM (1)
95 #define RT_COMPONENT_INSTANCE_RHISTORY_SM (1)
98 #define RT_COMPONENT_INSTANCE_UDP (1)
99 #define RT_COMPONENT_INSTANCE_RTPS (2)
100 #define RT_COMPONENT_INSTANCE_INTRA (3)
101 #define RT_COMPONENT_INSTANCE_DDSWI (4)
102 #define RT_COMPONENT_INSTANCE_DDSRI (5)
111 typedef RTI_UINT32 RT_ComponentInterfaceId_t;
121 typedef struct RT_Component RT_Component_T;
130 struct RT_ComponentListener
141 #define RT_ComponentListener_INITIALIZER \
149 struct RT_ComponentProperty
162 #define RT_ComponentProperty_INITIALIZER \
188 REDA_CircularListNode_T _node;
193 struct RT_ComponentI *_intf;
208 struct RT_ComponentListener _listener;
213 struct RT_ComponentProperty _property;
234 RT_Component_initialize(RT_Component_T *c,
235 struct RT_ComponentI *intf,
237 const struct RT_ComponentProperty *
const property,
238 const struct RT_ComponentListener *
const listener);
253 RT_Component_finalize(RT_Component_T *c);
255 #define RT_COMPONENTI_BASE {0}
260 struct RT_ComponentFactory;
265 struct RT_ComponentFactoryProperty
273 #define RT_ComponentFactoryProperty_INITIALIZER \
282 struct RT_ComponentFactoryListener
290 #define RT_ComponentFactoryListener_INITIALIZER \
295 FUNCTION_MUST_TYPEDEF(
296 struct RT_ComponentFactory*
297 (*RT_ComponentFactory_initializeFactoryFunc)(
298 struct RT_ComponentFactoryProperty *property,
299 struct RT_ComponentFactoryListener *listener)
303 (*RT_ComponentFactory_finalizeFactoryFunc)(
struct RT_ComponentFactory *factory,
304 struct RT_ComponentFactoryProperty **property,
305 struct RT_ComponentFactoryListener **listener);
307 FUNCTION_MUST_TYPEDEF(
309 (*RT_ComponentFactory_createFunc)(
struct RT_ComponentFactory *factory,
310 struct RT_ComponentProperty *property,
311 struct RT_ComponentListener *listener)
315 (*RT_ComponentFactory_deleteFunc)(
struct RT_ComponentFactory *factory,
316 RT_Component_T* component);
318 FUNCTION_MUST_TYPEDEF(
319 struct RT_ComponentI*
320 (*RT_ComponentFactory_get_ifFunc)(
struct RT_ComponentFactory *factory)
323 #define RT_COMPONENT_FACTORY_ID_DEFAULT (0)
328 struct RT_ComponentFactoryI
338 RT_ComponentFactory_initializeFactoryFunc initialize;
343 RT_ComponentFactory_finalizeFactoryFunc finalize;
348 RT_ComponentFactory_createFunc create_component;
353 RT_ComponentFactory_deleteFunc delete_component;
358 RT_ComponentFactory_get_ifFunc get_if;
361 #define RT_ComponentFactory_create_component(f_) ((f_)->intf)->create_component
363 #define RT_ComponentFactory_delete_component(f_) ((f_)->intf)->delete_component
365 #define RT_ComponentFactory_get_if(f_) ((f_)->intf)->get_if
371 #define RT_MAX_FACTORY_NAME 7
377 union RT_ComponentFactoryId
381 char _name[RT_MAX_FACTORY_NAME+1];
393 typedef union RT_ComponentFactoryId RT_ComponentFactoryId_T;
400 #define RT_ComponentFactoryId_clear(id_) \
401 { (id_)->_value._high = 0; (id_)->_value._low = 0; }
407 struct RT_ComponentFactory
409 struct RT_ComponentFactoryI *intf;
410 struct RT_ComponentFactory *_factory;
411 union RT_ComponentFactoryId _id;
417 #define RT_ComponentFactory_INITIALIZER \
424 typedef struct RT_ComponentFactory RT_ComponentFactory_T;
429 struct RT_RegistryProperty
434 RTI_SIZE_T max_factories;
445 #define RT_RegistryProperty_INITIALIZER \
454 extern RTDllVariable
struct RT_RegistryProperty
455 RTCOMPONENTFACTORY_REGISTRY_PROPERTY_DEFAULT;
462 typedef struct RT_Registry RT_Registry_T;
475 SHOULD_CHECK_RETURN RTDllExport RT_Registry_T*
476 RT_Registry_get_instance(
void);
492 SHOULD_CHECK_RETURN RTDllExport
RTI_BOOL
493 RT_Registry_finalize(RT_Registry_T*);
516 MUST_CHECK_RETURN RTDllExport RTI_INT32
517 RT_Registry_register(RT_Registry_T *registry,
519 struct RT_ComponentFactoryI *intf,
520 struct RT_ComponentFactoryProperty *property,
521 struct RT_ComponentFactoryListener *listener);
541 SHOULD_CHECK_RETURN RTDllExport
RTI_BOOL
542 RT_Registry_unregister(RT_Registry_T *registry,
544 struct RT_ComponentFactoryProperty **property,
545 struct RT_ComponentFactoryListener **listener);
561 MUST_CHECK_RETURN RTDllExport
struct RT_ComponentFactory*
562 RT_Registry_lookup(RT_Registry_T *registry,
const char *name);
581 MUST_CHECK_RETURN RTDllExport
struct RT_ComponentFactory*
582 RT_Registry_lookup_cid(RT_Registry_T *registry,
const char *name,RTI_INT32 cid);
598 MUST_CHECK_RETURN RTDllExport
RTI_BOOL
599 RT_Registry_get_property(RT_Registry_T *registry,
600 struct RT_RegistryProperty *property);
617 MUST_CHECK_RETURN RTDllExport
RTI_BOOL
618 RT_Registry_set_property(RT_Registry_T *registry,
619 struct RT_RegistryProperty *property);
632 RTDllExport RTI_INT32
633 RT_ComponentFactory_get_id(
struct RT_ComponentFactory *factory);
647 MUST_CHECK_RETURN RTDllExport
RTI_BOOL
648 RT_ComponentFactoryId_set_name(RT_ComponentFactoryId_T *
id,
649 const char *
const name);
662 MUST_CHECK_RETURN RTDllExport
const char*
663 RT_ComponentFactoryId_get_name(RT_ComponentFactoryId_T *
id);
677 MUST_CHECK_RETURN RTDllExport
RTI_BOOL
678 RT_ComponentFactoryId_equals(RT_ComponentFactoryId_T *
id,
679 const char *
const name);
693 MUST_CHECK_RETURN RTDllExport RTI_INT32
694 RT_ComponentFactoryId_compare(
const RT_ComponentFactoryId_T *id1,
695 const RT_ComponentFactoryId_T *id2);