Vuo  2.0.0
Functions | Variables
VuoCompositionLoader.cc File Reference

Description

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. More...
 
void stopComposition (void)
 Sends a control request to the composition telling it to stop. More...
 
bool loadResourceDylib (const string &dylibPath)
 Loads the resource dylib at the given path and adds the resulting handle to the list of resource dylibs. More...
 
bool unloadResourceDylib (const string &dylibPath)
 Unloads the resource dylib at the given path and removes its handle from the list of resource dylibs. More...
 
static bool isStoppedInitially (void)
 Placeholder until vuoIsCurrentCompositionStopped becomes available. More...
 
static void __attribute__ ((constructor)) VuoCompositionLoader_init(void)
 Get a reference to the main thread, so we can perform runtime thread assertions. More...
 
void vuoLoaderControlReplySend (enum VuoLoaderControlReply reply, zmq_msg_t *messages, unsigned int messageCount)
 Sends a control reply message to the process controlling this composition loader. More...
 
void vuoControlRequestSend (enum VuoControlRequest request, zmq_msg_t *messages, unsigned int messageCount)
 Sends a control request message to the running composition. More...
 
void vuoControlReplyReceive (enum VuoControlReply expectedReply)
 Receives a control reply message from the running composition, and checks that it is the expected reply. More...
 

Variables

void * ZMQLoaderControlContext = NULL
 The context for initializing sockets to control the composition loader. More...
 
void * ZMQLoaderControl = NULL
 The socket for controlling the composition loader. More...
 
static void * ZMQLoaderSelfReceive = 0
 Used to break out of a ZMQLoaderControl poll. More...
 
static void * ZMQLoaderSelfSend = 0
 Used to break out of a ZMQLoaderControl poll. More...
 
void * ZMQControlContext = NULL
 The context for initializing sockets to control the composition. More...
 
void * ZMQControl = NULL
 The socket for controlling the composition. More...
 
char * controlURL = NULL
 The URL that the composition will use to initialize its control socket. More...
 
char * telemetryURL = NULL
 The URL that the composition will use to initialize its telemetry socket. More...
 
bool isReplacing = false
 True if the composition is in the process of being replaced. More...
 
void * dylibHandle = NULL
 A handle to the running composition. More...
 
map< string, void * > resourceDylibHandles
 Handles to the running composition's resources. More...
 
vector< string > resourceDylibsToUnload
 Paths of the resources to be unloaded when the composition is replaced. More...
 
vector< string > resourceDylibsToLoad
 Paths of the resources to be loaded (or reloaded) when the composition is replaced. More...
 
pid_t runnerPid = 0
 Process ID of the runner that started the composition. More...
 
int runnerPipe = -1
 The file descriptor for the composition's end of the pipe used to detect if the runner's process ends. More...
 
bool continueIfRunnerDies = false
 If true, the composition continues running if the runner's process ends. More...
 
void * VuoApp_mainThread = NULL
 A reference to the main thread. More...
 
char * VuoApp_dylibPath = NULL
 The path of the most recently loaded composition dylib. More...
 
VuoIsCurrentCompositionStoppedTypeisStopped = isStoppedInitially
 Reference to vuoIsCurrentCompositionStopped() once it becomes available. More...
 

Function Documentation

◆ __attribute__()

static void __attribute__ ( (constructor)  )
static

Get a reference to the main thread, so we can perform runtime thread assertions.

Definition at line 69 of file VuoCompositionLoader.cc.

◆ isStoppedInitially()

static bool isStoppedInitially ( void  )
static

Placeholder until vuoIsCurrentCompositionStopped becomes available.

Definition at line 57 of file VuoCompositionLoader.cc.

◆ loadResourceDylib()

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 447 of file VuoCompositionLoader.cc.

◆ replaceComposition()

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 315 of file VuoCompositionLoader.cc.

◆ stopComposition()

void stopComposition ( void  )

Sends a control request to the composition telling it to stop.

Definition at line 431 of file VuoCompositionLoader.cc.

◆ unloadResourceDylib()

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 463 of file VuoCompositionLoader.cc.

◆ vuoControlReplyReceive()

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 100 of file VuoCompositionLoader.cc.

◆ vuoControlRequestSend()

void vuoControlRequestSend ( enum VuoControlRequest  request,
zmq_msg_t *  messages,
unsigned int  messageCount 
)

Sends a control request message to the running composition.

Definition at line 92 of file VuoCompositionLoader.cc.

◆ vuoLoaderControlReplySend()

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 84 of file VuoCompositionLoader.cc.

Variable Documentation

◆ continueIfRunnerDies

bool continueIfRunnerDies = false

If true, the composition continues running if the runner's process ends.

Definition at line 44 of file VuoCompositionLoader.cc.

◆ controlURL

char* controlURL = NULL

The URL that the composition will use to initialize its control socket.

Definition at line 34 of file VuoCompositionLoader.cc.

◆ dylibHandle

void* dylibHandle = NULL

A handle to the running composition.

Definition at line 38 of file VuoCompositionLoader.cc.

◆ isReplacing

bool isReplacing = false

True if the composition is in the process of being replaced.

Definition at line 37 of file VuoCompositionLoader.cc.

◆ isStopped

Reference to vuoIsCurrentCompositionStopped() once it becomes available.

Definition at line 62 of file VuoCompositionLoader.cc.

◆ resourceDylibHandles

map<string, void *> resourceDylibHandles

Handles to the running composition's resources.

Definition at line 39 of file VuoCompositionLoader.cc.

◆ resourceDylibsToLoad

vector<string> resourceDylibsToLoad

Paths of the resources to be loaded (or reloaded) when the composition is replaced.

Definition at line 41 of file VuoCompositionLoader.cc.

◆ resourceDylibsToUnload

vector<string> resourceDylibsToUnload

Paths of the resources to be unloaded when the composition is replaced.

Definition at line 40 of file VuoCompositionLoader.cc.

◆ runnerPid

pid_t runnerPid = 0

Process ID of the runner that started the composition.

Definition at line 42 of file VuoCompositionLoader.cc.

◆ runnerPipe

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 43 of file VuoCompositionLoader.cc.

◆ telemetryURL

char* telemetryURL = NULL

The URL that the composition will use to initialize its telemetry socket.

Definition at line 35 of file VuoCompositionLoader.cc.

◆ VuoApp_dylibPath

char* VuoApp_dylibPath = NULL

The path of the most recently loaded composition dylib.

Definition at line 52 of file VuoCompositionLoader.cc.

◆ VuoApp_mainThread

void* VuoApp_mainThread = NULL

A reference to the main thread.

Definition at line 51 of file VuoCompositionLoader.cc.

◆ ZMQControl

void* ZMQControl = NULL

The socket for controlling the composition.

Definition at line 33 of file VuoCompositionLoader.cc.

◆ ZMQControlContext

void* ZMQControlContext = NULL

The context for initializing sockets to control the composition.

Definition at line 32 of file VuoCompositionLoader.cc.

◆ ZMQLoaderControl

void* ZMQLoaderControl = NULL

The socket for controlling the composition loader.

Definition at line 28 of file VuoCompositionLoader.cc.

◆ ZMQLoaderControlContext

void* ZMQLoaderControlContext = NULL

The context for initializing sockets to control the composition loader.

Definition at line 27 of file VuoCompositionLoader.cc.

◆ ZMQLoaderSelfReceive

void* ZMQLoaderSelfReceive = 0
static

Used to break out of a ZMQLoaderControl poll.

Definition at line 29 of file VuoCompositionLoader.cc.

◆ ZMQLoaderSelfSend

void* ZMQLoaderSelfSend = 0
static

Used to break out of a ZMQLoaderControl poll.

Definition at line 30 of file VuoCompositionLoader.cc.