VuoCompositionLoader implementation.
Definition in file VuoCompositionLoader.cc.
Go to the source code of this file.
Functions | |
bool | replaceComposition (const char *dylibPath, char *compositionDiff) |
Replaces the currently running composition (if any) with the given composition. | |
void | stopComposition (void) |
Sends a control request to the composition telling it to stop. | |
bool | loadResourceDylib (const string &dylibPath) |
Loads the resource dylib at the given path and adds the resulting handle to the list of resource dylibs. | |
bool | unloadResourceDylib (const string &dylibPath) |
Unloads the resource dylib at the given path and removes its handle from the list of resource dylibs. | |
static bool | isStoppedInitially (void) |
Placeholder until vuoIsCurrentCompositionStopped becomes available. | |
void | vuoLoaderControlReplySend (enum VuoLoaderControlReply reply, zmq_msg_t *messages, unsigned int messageCount) |
Sends a control reply message to the process controlling this composition loader. | |
void | vuoControlRequestSend (enum VuoControlRequest request, zmq_msg_t *messages, unsigned int messageCount) |
Sends a control request message to the running composition. | |
void | vuoControlReplyReceive (enum VuoControlReply expectedReply) |
Receives a control reply message from the running composition, and checks that it is the expected reply. | |
Variables | |
void * | ZMQLoaderControlContext = NULL |
The context for initializing sockets to control the composition loader. | |
void * | ZMQLoaderControl = NULL |
The socket for controlling the composition loader. | |
static void * | ZMQLoaderSelfReceive = 0 |
Used to break out of a ZMQLoaderControl poll. | |
static void * | ZMQLoaderSelfSend = 0 |
Used to break out of a ZMQLoaderControl poll. | |
void * | ZMQControlContext = NULL |
The context for initializing sockets to control the composition. | |
void * | ZMQControl = NULL |
The socket for controlling the composition. | |
char * | controlURL = NULL |
The URL that the composition will use to initialize its control socket. | |
char * | telemetryURL = NULL |
The URL that the composition will use to initialize its telemetry socket. | |
bool | isReplacing = false |
True if the composition is in the process of being replaced. | |
bool | replacementFailed = false |
True if the composition loader attmpted to replace the composition and couldn't do it. | |
void * | dylibHandle = NULL |
A handle to the running composition. | |
map< string, void * > | resourceDylibHandles |
Handles to the running composition's resources. | |
vector< string > | resourceDylibsToUnload |
Paths of the resources to be unloaded when the composition is replaced. | |
vector< string > | resourceDylibsToLoad |
Paths of the resources to be loaded (or reloaded) when the composition is replaced. | |
pid_t | runnerPid = 0 |
Process ID of the runner that started the composition. | |
int | runnerPipe = -1 |
The file descriptor for the composition's end of the pipe used to detect if the runner's process ends. | |
bool | continueIfRunnerDies = false |
If true, the composition continues running if the runner's process ends. | |
void * | VuoApp_mainThread = NULL |
A reference to the main thread. | |
char * | VuoApp_dylibPath = NULL |
The path of the most recently loaded composition dylib. | |
VuoIsCurrentCompositionStoppedType * | isStopped = isStoppedInitially |
Reference to vuoIsCurrentCompositionStopped() once it becomes available. | |
|
static |
Placeholder until vuoIsCurrentCompositionStopped
becomes available.
Definition at line 58 of file VuoCompositionLoader.cc.
bool loadResourceDylib | ( | const string & | dylibPath | ) |
Loads the resource dylib at the given path and adds the resulting handle to the list of resource dylibs.
Definition at line 458 of file VuoCompositionLoader.cc.
bool replaceComposition | ( | const char * | dylibPath, |
char * | compositionDiff | ||
) |
Replaces the currently running composition (if any) with the given composition.
The runtime takes ownership of compositionDiff.
Definition at line 327 of file VuoCompositionLoader.cc.
void stopComposition | ( | void | ) |
Sends a control request to the composition telling it to stop.
Definition at line 443 of file VuoCompositionLoader.cc.
bool unloadResourceDylib | ( | const string & | dylibPath | ) |
Unloads the resource dylib at the given path and removes its handle from the list of resource dylibs.
Definition at line 474 of file VuoCompositionLoader.cc.
void vuoControlReplyReceive | ( | enum VuoControlReply | expectedReply | ) |
Receives a control reply message from the running composition, and checks that it is the expected reply.
Definition at line 101 of file VuoCompositionLoader.cc.
void vuoControlRequestSend | ( | enum VuoControlRequest | request, |
zmq_msg_t * | messages, | ||
unsigned int | messageCount | ||
) |
Sends a control request message to the running composition.
Definition at line 93 of file VuoCompositionLoader.cc.
void vuoLoaderControlReplySend | ( | enum VuoLoaderControlReply | reply, |
zmq_msg_t * | messages, | ||
unsigned int | messageCount | ||
) |
Sends a control reply message to the process controlling this composition loader.
Definition at line 85 of file VuoCompositionLoader.cc.
bool continueIfRunnerDies = false |
If true, the composition continues running if the runner's process ends.
Definition at line 45 of file VuoCompositionLoader.cc.
char* controlURL = NULL |
The URL that the composition will use to initialize its control socket.
Definition at line 34 of file VuoCompositionLoader.cc.
void* dylibHandle = NULL |
A handle to the running composition.
Definition at line 39 of file VuoCompositionLoader.cc.
bool isReplacing = false |
True if the composition is in the process of being replaced.
Definition at line 37 of file VuoCompositionLoader.cc.
VuoIsCurrentCompositionStoppedType* isStopped = isStoppedInitially |
Reference to vuoIsCurrentCompositionStopped()
once it becomes available.
Definition at line 63 of file VuoCompositionLoader.cc.
bool replacementFailed = false |
True if the composition loader attmpted to replace the composition and couldn't do it.
Definition at line 38 of file VuoCompositionLoader.cc.
map<string, void *> resourceDylibHandles |
Handles to the running composition's resources.
Definition at line 40 of file VuoCompositionLoader.cc.
vector<string> resourceDylibsToLoad |
Paths of the resources to be loaded (or reloaded) when the composition is replaced.
Definition at line 42 of file VuoCompositionLoader.cc.
vector<string> resourceDylibsToUnload |
Paths of the resources to be unloaded when the composition is replaced.
Definition at line 41 of file VuoCompositionLoader.cc.
pid_t runnerPid = 0 |
Process ID of the runner that started the composition.
Definition at line 43 of file VuoCompositionLoader.cc.
int runnerPipe = -1 |
The file descriptor for the composition's end of the pipe used to detect if the runner's process ends.
Definition at line 44 of file VuoCompositionLoader.cc.
char* telemetryURL = NULL |
The URL that the composition will use to initialize its telemetry socket.
Definition at line 35 of file VuoCompositionLoader.cc.
char* VuoApp_dylibPath = NULL |
The path of the most recently loaded composition dylib.
Definition at line 53 of file VuoCompositionLoader.cc.
void* VuoApp_mainThread = NULL |
A reference to the main thread.
Definition at line 52 of file VuoCompositionLoader.cc.
void* ZMQControl = NULL |
The socket for controlling the composition.
Definition at line 33 of file VuoCompositionLoader.cc.
void* ZMQControlContext = NULL |
The context for initializing sockets to control the composition.
Definition at line 32 of file VuoCompositionLoader.cc.
void* ZMQLoaderControl = NULL |
The socket for controlling the composition loader.
Definition at line 28 of file VuoCompositionLoader.cc.
void* ZMQLoaderControlContext = NULL |
The context for initializing sockets to control the composition loader.
Definition at line 27 of file VuoCompositionLoader.cc.
|
static |
Used to break out of a ZMQLoaderControl poll.
Definition at line 29 of file VuoCompositionLoader.cc.
|
static |
Used to break out of a ZMQLoaderControl poll.
Definition at line 30 of file VuoCompositionLoader.cc.