Files
torstenandCopilot 342ffd3e5c Update submodule to latest BUILD_RTI fixes
- HandlerMinelayerData: BUILD_RTI Guards für RTI-Abhängigkeiten
- svcTabCommon: Export-Header-Fix via Fallback-Target
- TrainingAreaBase: Stub-Header für BUILD_RTI=OFF
- ddsfts: Include-Pfad und Dependency-Fixes
- BUILD_RTI=OFF Compilation vollständig unterstützt

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Entire-Checkpoint: 01M0JNZA586SACX1PRZ2DJAE5S
2026-08-21 19:30:20 +02:00

167 lines
4.9 KiB
C

/*
* (c) Copyright, Real-Time Innovations, 2002-2024.
* All rights reserved.
*
* No duplications, whole or partial, manual or electronic, may be made
* without express written permission. Any such copies, or
* revisions thereof, must display this notice unaltered.
* This code contains trade secrets of Real-Time Innovations, Inc.
*/
#ifndef event_activeObject_h
#define event_activeObject_h
struct REDAWorker;
#ifndef osapi_thread_h
#include "osapi/osapi_thread.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
struct RTIEventActiveObject;
/*e \file
\brief ActiveObject related definitions.
*/
/*e \defgroup RTIEventActiveObjectClass RTIEventActiveObject
\ingroup RTIEventModule
\brief An active object is an object that has its own thread(s) and can
actively invoke methods on other objects.
Active objects are tricky to startup correctly, and even trickier to
shutdown correctly, especially when it interacts with other active
objects. Ideally, this kind of complexity should be avoided by
decoupling the interaction with message queues, but high performance
consideration bars such luxury for NDDS.
*/
/*e \defgroup RTIEventActiveObjectStateClass RTIEventActiveObjectState
\ingroup RTIEventActiveObjectClass
\brief An object object may be in only 1 state at a time.
Children of RTIEventActiveObject may specialize and introduce new
states, but these base states must be handled.
*/
/*e \ingroup RTIEventActiveObjectStateClass
\brief The object has been created, but is not yet fully operational.
For example, internal thread(s) are not yet running.
*/
#define RTI_EVENT_ACTIVE_OBJECT_STATE_STARTING (0x0)
/*e \ingroup RTIEventActiveObjectStateClass
\brief The object is fully operational.
An active object should spend most of its life in this state.
*/
#define RTI_EVENT_ACTIVE_OBJECT_STATE_RUNNING (0x1)
/*e \ingroup RTIEventActiveObjectStateClass
\brief preShutdownWakeup has been invoked on the object, but
there may still be threads waiting to terminate.
*/
#define RTI_EVENT_ACTIVE_OBJECT_STATE_PRE_SHUTDOWN (0x2)
/*e \ingroup RTIEventActiveObjectStateClass
\brief shutdown has been invoked on the object. all threads
have been terminated by now.
*/
#define RTI_EVENT_ACTIVE_OBJECT_STATE_SHUTDOWN (0x4)
/*e \ingroup RTIEventActiveObjectStateClass
\brief All threads reclaimed, and the shutdown callback called.
The object is ready for deletion.
*/
#define RTI_EVENT_ACTIVE_OBJECT_STATE_STOPPED (0x8)
/*e \defgroup RTIEventActiveObjectPropertyClass RTIEventActiveObjectProperty
\ingroup RTIEventActiveObjectClass
\brief Property common to all active objects in NDDS
*/
/*e \ingroup RTIEventActiveObjectPropertyClass
\brief public member fields
*/
struct RTIEventActiveObjectProperty {
/*e An active object has its own thread(s) */
int priority, stackSize, options;
struct RTIOsapiCpuBitmap bitmap;
};
/*e \ingroup RTIEventActiveObjectPropertyClass
\brief Use this to initialize variable
*/
#define RTI_EVENT_ACTIVE_OBJECT_PROPERTY_DEFAULT { \
RTI_OSAPI_THREAD_PRIORITY_DEFAULT, \
RTI_OSAPI_THREAD_STACK_SIZE_DEFAULT, \
(RTI_OSAPI_THREAD_OPTION_PRIORITY_ENFORCE | RTI_OSAPI_THREAD_OPTION_STDIO), \
RTI_OSAPI_CPU_BITMAP_DEFAULT \
}
/*e \ingroup RTIEventActiveObjectClass
\brief Begin shutdown of an active object.
@pre Object in RTI_EVENT_ACTIVE_OBJECT_STATE_RUNNING
@post Object in RTI_EVENT_ACTIVE_OBJECT_STATE_SHUTDOWN, and is unusable.
The only event that can happen is for thread(s) already in the object
to wake up (eventually) and leave gracefully.
In particular, no new thread must be created in the object!
@return RTI_TRUE on success
*/
typedef RTIBool (*RTIEventActiveObjectShutdownFunction)(
struct RTIEventActiveObject *me,
struct REDAWorker *worker);
/*e \defgroup RTIEventActiveObjectListenerClass RTIEventActiveObjectListener
\ingroup RTIEventActiveObjectClass
\brief Implement this interface to be notified of active object state change
*/
/*e \ingroup RTIEventActiveObjectListenerClass
@pre Object in RTI_EVENT_ACTIVE_OBJECT_STATE_SHUTDOWN, and
all workers left the active object.
@post Object in RTI_EVENT_ACTIVE_OBJECT_STATE_STOPPED and is
ready for deletion.
@mtsafety <<singleThread>>
*/
typedef void (*RTIEventActiveObjectListenerOnStoppedCallback)(
struct RTIEventActiveObject *me, void *onStoppedParam,
struct REDAWorker *worker);
/*e \ingroup RTIEventActiveObjectListenerClass
\brief Parent class of all active object listeners.
Add your own methods, such as onStarted (when it makes sense)
by deriving from this class
*/
struct RTIEventActiveObjectListener {
/*e */
RTIEventActiveObjectListenerOnStoppedCallback onStopped;
/*e pointer associated with onStopped method */
void *onStoppedParam;
};
#define RTI_EVENT_ACTIVE_OBJECT_LISTENER_DEFAULT {NULL, NULL}
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* event_activeObject_h */