MachineInterface Class Reference

#include <machine.h>

Inheritance diagram for MachineInterface:

Detailed Description

This class is the entry point to access machine interfaces. So there is no difference if the machine is running local or remote via rpc.

Public Member Functions

MAXON_METHOD String GetUniqueId () const
 
MAXON_METHOD Result< DataDictionary > GetMachineInfo () const
 
MAXON_METHOD Result< ObjectRef > GetInterface (const Id &interfaceName)
 
template<typename INTERFACE >
MAXON_FUNCTION Result< INTERFACE > GetInterface ()
 
MAXON_METHOD MACHINESTATE GetState () const
 
MAXON_METHOD Bool SetState (MACHINESTATE stateMask, MACHINESTATE stateFlags)
 
MAXON_METHOD String ToString (const FormatStatement *formatStatement=nullptr) const
 
 MAXON_OBSERVABLE (void, ObservableMessageReceived,(const MachineRef &machine, const DataDictionary &data), ObservableCombinerRunAllComponent)
 

Private Member Functions

 MAXON_INTERFACE (MachineInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.machine")
 

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( MachineInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.interface.machine"   
)
private

◆ GetUniqueId()

MAXON_METHOD String GetUniqueId ( ) const

Returns the service name of the local machine. This name is a unique name which allows to identify the machine.

◆ GetMachineInfo()

MAXON_METHOD Result<DataDictionary> GetMachineInfo ( ) const

Returns information about the system and processor. See maxon::MACHINEINFO for DataDictionary properties.

◆ GetInterface() [1/2]

MAXON_METHOD Result<ObjectRef> GetInterface ( const Id interfaceName)

Returns a interface of this machine. E.g. write OSClipboardRef clipboard = machine.GetInterface<OSClipboardRef>(); to get the clipboard interface handle. Don't use the Interface function but the overloaded NetworkRPCMachine::GetInterface<>() template instead. THREADSAFE. It automatically detects the interfaceName and casts the type.

Parameters
[in]interfaceNameINTERFACE::_interface.GetId().
Returns
If successful the handle to the interface is returned.

◆ GetInterface() [2/2]

MAXON_FUNCTION Result<INTERFACE> GetInterface ( )

Returns a interface of a machine. e.g. write OSClipboardRef clipboard = machine.GetInterface<OSClipboardRef>(); to get the clipboard interface handle. At the moment supported are: OSGuiRef, OSClipboardRef, GameServerRef, CaptureDeviceListRef, UpdaterRef.

Returns
If the function is successful the handle to the interface is returned.

◆ GetState()

MAXON_METHOD MACHINESTATE GetState ( ) const

Returns the machine state of the given machine. See MACHINEINFO for details.

◆ SetState()

MAXON_METHOD Bool SetState ( MACHINESTATE  stateMask,
MACHINESTATE  stateFlags 
)

** private ** Sets the machine state of the given machine. This function should not be called by users. It's private for internal functions.

Parameters
[in]stateMaskMask of flags that should be changed.
[in]stateFlagsValues of flags that be set.
Returns
True if the function succeeded.

◆ ToString()

MAXON_METHOD String ToString ( const FormatStatement formatStatement = nullptr) const

Returns a readable string of the content.

Parameters
[in]formatStatementNullptr or additional formatting instruction. Use "{N}" for nive formatting of the name only. Otherwise the unique id is printed together with the name.
Returns
The converted result.

◆ MAXON_OBSERVABLE()

MAXON_OBSERVABLE ( void  ,
ObservableMessageReceived  ,
(const MachineRef &machine, const DataDictionary &data)  ,
ObservableCombinerRunAllComponent   
)