cello
JUCE ValueTrees for Humans
Loading...
Searching...
No Matches
cello::IpcClient Class Reference
Inheritance diagram for cello::IpcClient:
cello::UpdateQueue

Public Types

enum  UpdateType { send = 0x01 , receive = 0x02 , fullUpdateOnConnect = 0x04 }
 
enum  ConnectOptions { noOptions , createOrFail , mustExist , createIfNeeded }
 

Public Member Functions

 IpcClient (Object &objectToWatch, const juce::String &hostName, int portNum, int msTimeout, UpdateType updateType, Object *state=nullptr)
 Construct a new Ipc Client object that connects using sockets.
 
 IpcClient (Object &objectToWatch, const juce::String &pipeName, int msTimeout, UpdateType updateType, Object *state=nullptr)
 Construct a new Ipc Client object using a named pipe.
 
bool connect (ConnectOptions option=ConnectOptions::noOptions)
 Attempt to make a connection to another IpcClient running in another process.
 
- Public Member Functions inherited from cello::UpdateQueue
 UpdateQueue (Object &consumer, juce::Thread *thread)
 
 UpdateQueue (const UpdateQueue &)=delete
 
UpdateQueueoperator= (const UpdateQueue &)=delete
 
 UpdateQueue (UpdateQueue &&)=delete
 
UpdateQueueoperator= (UpdateQueue &&)=delete
 
int getPendingUpdateCount () const
 
void performAllUpdates ()
 Execute each of the updates that are ready.
 
void performNextUpdate ()
 Pop the next event from the queue and apply the change to the destination value tree.
 

Friends

class IpcServer
 

Additional Inherited Members

- Protected Member Functions inherited from cello::UpdateQueue
void pushUpdate (juce::MemoryBlock &&update)
 

Member Enumeration Documentation

◆ ConnectOptions

Enumerator
noOptions 

default, used for sockets, which have no options.

createOrFail 

create the pipe, fail if we couldn't

mustExist 

pipe must already exist, fail if it doesn't

createIfNeeded 

If pipe exists, use it, otherwise create.

Constructor & Destructor Documentation

◆ IpcClient() [1/2]

cello::IpcClient::IpcClient ( Object & objectToWatch,
const juce::String & hostName,
int portNum,
int msTimeout,
UpdateType updateType,
Object * state = nullptr )

Construct a new Ipc Client object that connects using sockets.

Parameters
objectToWatchLocal object to connect over IPC
hostNamehostname of the machine running an IpcServer
portNumport number on the host
msTimeout
updateTypesee UpdateType
stateparent object to contain our IpcClientProperties object.

◆ IpcClient() [2/2]

cello::IpcClient::IpcClient ( Object & objectToWatch,
const juce::String & pipeName,
int msTimeout,
UpdateType updateType,
Object * state = nullptr )

Construct a new Ipc Client object using a named pipe.

Parameters
objectToWatchLocal object to connect over IPC
pipeNamename of the pipe to use
msTimeouttimeout, -1 == wait forever.
updateTypesee UpdateType
stateparent object to contain our IpcClientProperties object.

Member Function Documentation

◆ connect()

bool cello::IpcClient::connect ( ConnectOptions option = ConnectOptions::noOptions)

Attempt to make a connection to another IpcClient running in another process.

Parameters
optionOnly meaningful when connecting to a named pipe.
Returns
bool True if we connected successfully.

The documentation for this class was generated from the following files: