Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Static Public Member Functions | Friends | List of all members
CommandRegistrar Class Reference

Static Public Member Functions

template<typename CommandType , typename... Args>
static OfCommandCallerregister_command (const char *name, const char *doc, const Args &...args)
 
template<typename CommandType >
static OfCommandCallerregister_command (const char *name, const char *doc)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, const OfCommandArgument::Type &t11, const CoreString &n11, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, const OfCommandArgument::Type &t11, const CoreString &n11, const OfCommandArgument::Type &t12, const CoreString &n12, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, const OfCommandArgument::Type &t11, const CoreString &n11, const OfCommandArgument::Type &t12, const CoreString &n12, const OfCommandArgument::Type &t13, const CoreString &n13, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, const OfCommandArgument::Type &t11, const CoreString &n11, const OfCommandArgument::Type &t12, const CoreString &n12, const OfCommandArgument::Type &t13, const CoreString &n13, const OfCommandArgument::Type &t14, const CoreString &n14, void *data=0, const bool &script_visible=true)
 
static OfCommandCallerregister_command (const CoreString &command_id, OfCommand::Create create, const OfCommandArgument::Type &t1, const CoreString &n1, const OfCommandArgument::Type &t2, const CoreString &n2, const OfCommandArgument::Type &t3, const CoreString &n3, const OfCommandArgument::Type &t4, const CoreString &n4, const OfCommandArgument::Type &t5, const CoreString &n5, const OfCommandArgument::Type &t6, const CoreString &n6, const OfCommandArgument::Type &t7, const CoreString &n7, const OfCommandArgument::Type &t8, const CoreString &n8, const OfCommandArgument::Type &t9, const CoreString &n9, const OfCommandArgument::Type &t10, const CoreString &n10, const OfCommandArgument::Type &t11, const CoreString &n11, const OfCommandArgument::Type &t12, const CoreString &n12, const OfCommandArgument::Type &t13, const CoreString &n13, const OfCommandArgument::Type &t14, const CoreString &n14, const OfCommandArgument::Type &t15, const CoreString &n15, void *data=0, const bool &script_visible=true)
 
static bool register_custom_set_value (const CoreString &command_name, const CoreString &class_name, const CoreString &attr_name)
 
static bool register_custom_remove_value (const CoreString &command_name, const CoreString &class_name, const CoreString &attr_name)
 
static bool has_custom_set_value_cmd (const CoreString &class_name, const CoreString &attr_name, CoreString &cmd_name)
 
static bool has_custom_set_value_cmd (const CoreString &class_name, const CoreString &attr_name)
 
static bool has_custom_remove_value_cmd (const CoreString &class_name, const CoreString &attr_name, CoreString &cmd_name)
 
static void call_custom_set_value_cmd (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args, const OfCommandOptions &options)
 
static void call_custom_remove_value_cmd (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args, const OfCommandOptions &options)
 
static int call (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args={})
 
static int call (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args, OfCommandArgument &return_value)
 
static int call (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args, const OfCommandOptions &options)
 
static int call (const CoreString &cmd_name, const CoreBasicArray< OfCommandArgument > &args, OfCommandArgument &return_value, const OfCommandOptions &options)
 
static OfCommandCallerget_command (const CoreString &cmd_id)
 
static unsigned int get_commands_count ()
 
static OfCommandCallerget_command (const unsigned int &index)
 
static void add_command_doc (const CommandSignatureDoc &doc)
 
static const CoreHashTable
< OfCommandSignature
*, CommandSignatureDoc > & 
get_commands_docs ()
 

Friends

class OfCommandManager
 
class OfApp
 
class AppObject
 

Detailed Description

Monostate used to register new commands.

Member Function Documentation

void CommandRegistrar::call_custom_remove_value_cmd ( const CoreString cmd_name,
const CoreBasicArray< OfCommandArgument > &  args,
const OfCommandOptions options 
)
static

Call the custom "remove value" command.

Parameters
cmd_nameCommand name.
argsCommand arguments.
Returns
true if the command succeeded, false otherwise.
void CommandRegistrar::call_custom_set_value_cmd ( const CoreString cmd_name,
const CoreBasicArray< OfCommandArgument > &  args,
const OfCommandOptions options 
)
static

Call the custom "set value" command.

Parameters
cmd_nameCommand name.
argsCommand arguments.
Returns
true if the command succeeded, false otherwise.
bool CommandRegistrar::has_custom_remove_value_cmd ( const CoreString class_name,
const CoreString attr_name,
CoreString cmd_name 
)
static

Query if the attribute has a custom "remove value" command registered, and get the command name if found.

Parameters
class_nameClass name.
attr_nameAttribute name.
cmd_nameOutput string containing the command name if found. Empty otherwise.
Returns
true if a custom command is registered, false otherwise.
bool CommandRegistrar::has_custom_set_value_cmd ( const CoreString class_name,
const CoreString attr_name,
CoreString cmd_name 
)
static

Query if the attribute has a custom "set value" command registered, and get the command name if found.

Parameters
class_nameClass name.
attr_nameAttribute name.
cmd_nameOutput string containing the command name if found. Empty otherwise.
Returns
true if a custom command is registered, false otherwise.
bool CommandRegistrar::has_custom_set_value_cmd ( const CoreString class_name,
const CoreString attr_name 
)
static

Query if the attribute has a custom "set value" command registered.

Parameters
class_nameClass name.
attr_nameAttribute name.
Returns
true if a custom command is registered, false otherwise.
template<typename CommandType , typename... Args>
OfCommandCaller * CommandRegistrar::register_command ( const char *  name,
const char *  doc,
const Args &...  args 
)
inlinestatic

Generic command used to register a new command (or a new signature for an existing command) and its associated signature + documentation.

Here is an example use:

``` OfCommandCaller *caller = CommandRegistrar::register_command<AwesomeCommandType>( "AwesomeCommand.", "Does some awesome stuff", OfCommandArgument::TYPE_DOUBLE, "awesomeness", "Awesomeness level of the command.", OfCommandArgument::TYPE_BOOL, "stuff", "Some other argument." ); ```

This will register the command, setup the signature and the documentation.

Template Parameters
CommandTypeThe command class name.
Parameters
nameThe name of the command.
docThe documentation of the command.
argsThe list of signature arguments. For each argument of the command, you must add 3 parameters to the function: the type of the arg, its name, and its documentation.
template<typename CommandType >
OfCommandCaller * CommandRegistrar::register_command ( const char *  name,
const char *  doc 
)
inlinestatic

Simplified version of register_command(const char *name, const char *doc, const Args& ... args) for commands with no arguments.

bool CommandRegistrar::register_custom_remove_value ( const CoreString command_name,
const CoreString class_name,
const CoreString attr_name 
)
static

Register a custom "remove value" command for the specified attribute and class.

Parameters
command_nameCommand name. Can't be empty.
class_nameClass name. Must exist.
attr_nameAttribute name. Must exist in the specified class.
Returns
true on registration success, false otherwise.

The custom "remove value" command will be used in place of the built-in commands RemoveValue and RemoveAllValues.

The registration will fail if:

  • the class doesn't exist;
  • the attribute doesn't exist in the class;
  • the command name is empty.

The command signature must be as follows:

  • args[0]: TYPE_ARRAY_STRING: attribute full paths.
  • args[1]: TYPE_ARRAY_UINT: indices of values to remove, formatted as [count_i, i0, ..., count_j, j0, ...].

If the attribute already has a registered "set value" command, it will be replaced by the new one.

bool CommandRegistrar::register_custom_set_value ( const CoreString command_name,
const CoreString class_name,
const CoreString attr_name 
)
static

Register a custom "set value" command for the specified attribute and class.

Parameters
command_nameCommand name. Can't be empty.
class_nameClass name. Must exist.
attr_nameAttribute name. Must exist in the specified class.
Returns
true on registration success, false otherwise.

The custom "set value" command will be used in place of the following built-in commands:

  • SetValue and SetValues;
  • RemoveValue and RemoveAllValues, only if no custom "remove value" command is registered for the same attribute.

The custom command signature must be as follows:

  • args[0]: TYPE_ARRAY_STRING: attribute full paths.
  • args[1]: TYPE_ARRAY_STRING: values to be set.
  • args[2]: TYPE_ARRAY_UINT: indices of the values to be set.

If the attribute already has a registered "set value" command, it will be replaced by the new one.