Machines Manual

About

A maxon::MachineInterface interface represents either the local machine (running Cinema 4D) or a machine connected via RPC. Typically one accesses the local machine to obtain specific interfaces.

MachinesInterface

maxon::MachinesInterface gives access to the local or connected machines:

// This example lists all connected machines including the local machine.
for (auto machine : machines)
{
const maxon::DataDictionary machineInfo = machine.GetMachineInfo() iferr_return;
const maxon::String computerName = machineInfo.Get(maxon::MACHINEINFO::COMPUTERNAME) iferr_return;
DiagnosticOutput("Machine @", computerName);
}

MachineInterface

A maxon::MachineInterface represents the local machine or a connected machine.

The connection state is stored as maxon::MACHINESTATE.

General information on the machine can be obtained with:

// This example prints various infos on the local machine to the console.
const maxon::MachineRef localMachine = maxon::MachinesInterface::GetLocal();
const maxon::DataDictionary machineInfo = localMachine.GetMachineInfo() iferr_return;
const maxon::String computerName = machineInfo.Get(maxon::MACHINEINFO::COMPUTERNAME) iferr_return;
const maxon::String osVersion = machineInfo.Get(maxon::MACHINEINFO::OSVERSION) iferr_return;
const maxon::String uid = localMachine.GetUniqueId();
DiagnosticOutput("Machine @ (@) running @", computerName, uid, osVersion);

A maxon::MachineInterface gives access to various interfaces:

The maxon::MachineInterface provides this observable:

  • ObservableMessageReceived: Called when the machine receives a message.

Further Reading

maxon::String
Definition: string.h:1197
maxon::MachinesInterface::GetLocal
static MAXON_METHOD MachineRef GetLocal()
iferr_return
#define iferr_return
Definition: resultbase.h:1434
maxon::BaseArray
Definition: basearray.h:366
DiagnosticOutput
#define DiagnosticOutput(formatString,...)
Definition: debugdiagnostics.h:168
maxon::MachinesInterface::GetRPCMachines
static MAXON_METHOD Result< void > GetRPCMachines(WritableArrayInterface< MachineRef > &machines)