Server
API Reference Guide
Product Documentation:

Visualization Server
Documentation Home
List of all members | Static Public Member Functions
IlsTcpLoopback Class Reference

This class provides a way to execute application code in the main thread in order to synchronize all the critical code such as access to the model. More...

#include <ilserver/mvtcp/loopback.h>

Static Public Member Functions

static void Initialize ()
 Before you can call any of the methods InvokeNow() or InvokeLater(), you must initialize your IlsTcpLoopback instance using this static member function.
 
static void InvokeLater (IlsRunnable &runnable)
 This static member function posts the invokation of the run() method of the runnable argument to the main thread and does not wait for the end of execution. More...
 
static void InvokeNow (IlsRunnable &runnable)
 This static member function invokes the run() member function of the runnable argument in the main thread and waits for the end of execution. More...
 
static IlsBoolean InvokeNow (IlsRunnable &runnable, IlsTime to)
 This static member function invokes the run() method member of the runnable argument in the main thread and waits for the end of execution with a timeout. More...
 

Detailed Description

This class provides a way to execute application code in the main thread in order to synchronize all the critical code such as access to the model.

Library: mvtcp

The different ways (synchronous or asynchronous) to communicate with the main thread are explained below.

Member Function Documentation

◆ InvokeLater()

static void IlsTcpLoopback::InvokeLater ( IlsRunnable &  runnable)
static

This static member function posts the invokation of the run() method of the runnable argument to the main thread and does not wait for the end of execution.

Parameters
runnablerunnable to execute

◆ InvokeNow() [1/2]

static void IlsTcpLoopback::InvokeNow ( IlsRunnable &  runnable)
static

This static member function invokes the run() member function of the runnable argument in the main thread and waits for the end of execution.

Parameters
runnablerunnable to execute

◆ InvokeNow() [2/2]

static IlsBoolean IlsTcpLoopback::InvokeNow ( IlsRunnable &  runnable,
IlsTime  to 
)
static

This static member function invokes the run() method member of the runnable argument in the main thread and waits for the end of execution with a timeout.

If the main thread executes the run() method before the end of timeout, the function returns IlsTrue. When the timeout is elapsed, the run method can no longer be called and the method returns IlsFalse. The runnable parameter is the runnable to execute. The parameter to is the timeout.

Parameters
runnablerunnable to execute
totimeout
Returns
IlsTrue if run before timeout, IlsFalse otherwise.