CommandDataInterface Class Reference

#include <commandbase.h>

Inheritance diagram for CommandDataInterface:

Detailed Description

Base command data interface as a simple data dictionary. It contains all the data and necessary functions to executed and interact with commands.

Classes

class  SetFunctor
 

Public Types

using SetParameters = Delegate< Result< void >(CommandDataRef &data)>
 

Public Member Functions

MAXON_FUNCTION Result< COMMANDRESULTInvoke (const Id &command, Bool interactive)
 
MAXON_FUNCTION Result< COMMANDRESULTInvoke (const CommandClass &command, Bool interactive)
 
MAXON_FUNCTION Result< COMMANDRESULTInvoke (const Id &command, Bool interactive, const SetParameters &setParameters)
 
MAXON_FUNCTION Result< COMMANDRESULTInvoke (const CommandClass &command, Bool interactive, const SetParameters &setParameters)
 
MAXON_FUNCTION Result< COMMANDRESULTInteract (INTERACTIONTYPE interactionType)
 
template<typename ... ARGS>
MAXON_FUNCTION Result< COMMANDRESULTInvoke (const CommandClass &command, Bool interactive, ARGS &&...args)
 

Private Member Functions

 MAXON_INTERFACE (CommandDataInterface, MAXON_REFERENCE_NORMAL, "net.maxon.command.interface.commanddata")
 

Member Typedef Documentation

◆ SetParameters

using SetParameters = Delegate<Result<void>(CommandDataRef& data)>

Member Function Documentation

◆ MAXON_INTERFACE()

MAXON_INTERFACE ( CommandDataInterface  ,
MAXON_REFERENCE_NORMAL  ,
"net.maxon.command.interface.commanddata"   
)
private

◆ Invoke() [1/5]

MAXON_FUNCTION Result<COMMANDRESULT> Invoke ( const Id command,
Bool  interactive 
)

Invokes a command on this data.

Parameters
[in]commandThe command ID.
[in]interactiveIf true the command execution will be prepared for interactivity. The executed command must implement CommandInteractionClassInterface.
Returns
The command result or an error.

◆ Invoke() [2/5]

MAXON_FUNCTION Result<COMMANDRESULT> Invoke ( const CommandClass &  command,
Bool  interactive 
)

Invokes a command on this data.

Parameters
[in]commandThe command class.
[in]interactiveIf true the command execution will be prepared for interactivity. The executed command must implement CommandInteractionClassInterface.
Returns
The command result or an error.

◆ Invoke() [3/5]

MAXON_FUNCTION Result<COMMANDRESULT> Invoke ( const Id command,
Bool  interactive,
const SetParameters setParameters 
)

Invokes a command on this data.

Parameters
[in]commandThe command ID.
[in]interactiveIf true, the command execution will be prepared for interactivity. The executed command must implement CommandInteractionClassInterface.
[in]setParametersA delegate to fill the CommandData with command parameters.
Returns
The command result, or an error.

◆ Invoke() [4/5]

MAXON_FUNCTION Result<COMMANDRESULT> Invoke ( const CommandClass &  command,
Bool  interactive,
const SetParameters setParameters 
)

Invokes a command on this data.

Parameters
[in]commandThe command class.
[in]interactiveIf true, the command execution will be prepared for interactivity. The executed command must implement CommandInteractionClassInterface.
[in]setParametersA delegate to fill the CommandData with command parameters.
Returns
The command result, or an error.

◆ Interact()

MAXON_FUNCTION Result<COMMANDRESULT> Interact ( INTERACTIONTYPE  interactionType)

Interact with the command result on this data. An interactive command must be called before this method is used.

Parameters
[in]interactionTypeDefine the kind of interaction, see INTERACTIONTYPE.
Returns
The command result or an error.

◆ Invoke() [5/5]

MAXON_FUNCTION Result<COMMANDRESULT> Invoke ( const CommandClass &  command,
Bool  interactive,
ARGS &&...  args 
)