Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Attributes | List of all members
orxonox::ConsoleCommand::ConsoleCommandManipulator Struct Reference

Helper class that is used to manipulate console commands. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/command/ConsoleCommand.h>

Public Member Functions

 ConsoleCommandManipulator (ConsoleCommand *command)
 Constructor: Creates a manipulator for a given ConsoleCommand. More...
 
ConsoleCommandManipulatoraccessLevel (AccessLevel level)
 Changes the access level of the command. More...
 
ConsoleCommandManipulatoractivate ()
 Activates the command. More...
 
ConsoleCommandManipulatorargumentCompleter (unsigned int index, ArgumentCompleter *completer)
 Changes the argument completer for the given parameter. More...
 
ConsoleCommandManipulatordeactivate ()
 Deactivates the command. More...
 
ConsoleCommandManipulatordefaultValue (unsigned int index, const MultiType &arg)
 Changes the default value of the argument with given index of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatordefaultValues (const MultiType &arg1)
 Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatordefaultValues (const MultiType &arg1, const MultiType &arg2)
 Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatordefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3)
 Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatordefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4)
 Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatordefaultValues (const MultiType &arg1, const MultiType &arg2, const MultiType &arg3, const MultiType &arg4, const MultiType &arg5)
 Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack). More...
 
ConsoleCommandManipulatorhide ()
 Hides the command (can still be executed, but is not visible in the list of available commands). More...
 
ConsoleCommandManipulatorinputConfiguredParam (int index)
 Sets the input configured param to the given index. More...
 
ConsoleCommandManipulatorkeybindMode (KeybindMode::Value mode)
 Changes the keybind mode of the command. More...
 
ConsoleCommandManipulatorpopFunction ()
 Removes the current function from the stack and restores the old state. If there's no other function on the stack, the command is deactivated. More...
 
ConsoleCommandManipulatorpopObject ()
 Removes the current object from the object-stack and restores the old object (or nullptr if there's no object left on the stack). More...
 
ConsoleCommandManipulatorpushFunction ()
 Pushes a copy of the current Executor on the command-stack, that can be altered without changing the old Executor. More...
 
template<class F >
ConsoleCommandManipulatorpushFunction (F function, bool bForce=false)
 Pushes a new function on the command-stack. More...
 
template<class F , class O >
ConsoleCommandManipulatorpushFunction (F function, O *object, bool bForce=false)
 Pushes a new function on the command-stack. More...
 
ConsoleCommandManipulatorpushFunction (const FunctorPtr &functor, bool bForce=false)
 Pushes a new Functor on the command-stack. More...
 
ConsoleCommandManipulatorpushFunction (const ExecutorPtr &executor, bool bForce=false)
 Pushes a new Executor on the command-stack. More...
 
ConsoleCommandManipulatorpushObject (void *object)
 Pushes a new object on the object-stack. More...
 
ConsoleCommandManipulatorresetFunction ()
 Sets the current function-pointer to nullptr, which also deactivates the command. More...
 
ConsoleCommandManipulatorsetActive (bool bActive)
 Changes the activity of the command. More...
 
ConsoleCommandManipulatorsetAsInputCommand ()
 Defines the command to be an input command. More...
 
template<class F >
ConsoleCommandManipulatorsetFunction (F function, bool bForce=false)
 Changes the current function of the command. More...
 
template<class F , class O >
ConsoleCommandManipulatorsetFunction (F function, O *object, bool bForce=false)
 Changes the current function of the command. More...
 
ConsoleCommandManipulatorsetFunction (const FunctorPtr &functor, bool bForce=false)
 Changes the current Functor of the command. More...
 
ConsoleCommandManipulatorsetFunction (const ExecutorPtr &executor, bool bForce=false)
 Changes the current Executor of the command. More...
 
ConsoleCommandManipulatorsetHidden (bool bHidden)
 Changes the visibility of the command. More...
 
ConsoleCommandManipulatorsetObject (void *object)
 Changes the current object (used for member-functions). More...
 
ConsoleCommandManipulatorshow ()
 Makes the command visible. More...
 

Private Attributes

ConsoleCommandcommand_
 The command which is being manipulated by this object. More...
 

Detailed Description

Helper class that is used to manipulate console commands.

An instance of this class is returned if you call the ModifyConsoleCommand macro. This class provides an interface which wraps some functions of ConsoleCommand. It allows access to some private functions like setFunction() (that can't be called right after SetConsoleCommand()) but it also hides some functions that shouln't be called after the static declaration like addShortcut() or description().

See also
See ConsoleCommand.h for more information and examples.

Constructor & Destructor Documentation

orxonox::ConsoleCommand::ConsoleCommandManipulator::ConsoleCommandManipulator ( ConsoleCommand command)
inline

Constructor: Creates a manipulator for a given ConsoleCommand.

Member Function Documentation

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::accessLevel ( AccessLevel  level)
inline

Changes the access level of the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::activate ( )
inline

Activates the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::argumentCompleter ( unsigned int  index,
ArgumentCompleter completer 
)
inline

Changes the argument completer for the given parameter.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::deactivate ( )
inline

Deactivates the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValue ( unsigned int  index,
const MultiType arg 
)
inline

Changes the default value of the argument with given index of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValues ( const MultiType arg1)
inline

Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValues ( const MultiType arg1,
const MultiType arg2 
)
inline

Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValues ( const MultiType arg1,
const MultiType arg2,
const MultiType arg3 
)
inline

Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValues ( const MultiType arg1,
const MultiType arg2,
const MultiType arg3,
const MultiType arg4 
)
inline

Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::defaultValues ( const MultiType arg1,
const MultiType arg2,
const MultiType arg3,
const MultiType arg4,
const MultiType arg5 
)
inline

Changes the default values of the current executor (doesn't modify executors on deeper levels of the command-stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::hide ( )
inline

Hides the command (can still be executed, but is not visible in the list of available commands).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::inputConfiguredParam ( int  index)
inline

Sets the input configured param to the given index.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::keybindMode ( KeybindMode::Value  mode)
inline

Changes the keybind mode of the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::popFunction ( )
inline

Removes the current function from the stack and restores the old state. If there's no other function on the stack, the command is deactivated.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::popObject ( )
inline

Removes the current object from the object-stack and restores the old object (or nullptr if there's no object left on the stack).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushFunction ( )
inline

Pushes a copy of the current Executor on the command-stack, that can be altered without changing the old Executor.

This function is especially useful if you don't wan't to change the function, but only the default values of the executor.

template<class F >
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushFunction ( function,
bool  bForce = false 
)
inline

Pushes a new function on the command-stack.

Parameters
functionThe new function-pointer
bForceIf true, the new function-pointer is always assigned, even if the headers don't match
template<class F , class O >
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushFunction ( function,
O *  object,
bool  bForce = false 
)
inline

Pushes a new function on the command-stack.

Parameters
functionThe new function-pointer
objectThe new object-pointer (for member-functions)
bForceIf true, the new function-pointer is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushFunction ( const FunctorPtr functor,
bool  bForce = false 
)
inline

Pushes a new Functor on the command-stack.

Parameters
functorThe new Functor
bForceIf true, the new Functor is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushFunction ( const ExecutorPtr executor,
bool  bForce = false 
)
inline

Pushes a new Executor on the command-stack.

Parameters
executorThe new Executor
bForceIf true, the new Executor is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::pushObject ( void object)
inline

Pushes a new object on the object-stack.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::resetFunction ( )
inline

Sets the current function-pointer to nullptr, which also deactivates the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setActive ( bool  bActive)
inline

Changes the activity of the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setAsInputCommand ( )
inline

Defines the command to be an input command.

template<class F >
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setFunction ( function,
bool  bForce = false 
)
inline

Changes the current function of the command.

Parameters
functionThe new function-pointer
bForceIf true, the new function-pointer is always assigned, even if the headers don't match
template<class F , class O >
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setFunction ( function,
O *  object,
bool  bForce = false 
)
inline

Changes the current function of the command.

Parameters
functionThe new function-pointer
objectThe new object-pointer (for member-functions)
bForceIf true, the new function-pointer is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setFunction ( const FunctorPtr functor,
bool  bForce = false 
)
inline

Changes the current Functor of the command.

Parameters
functorThe new Functor
bForceIf true, the new Functor is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setFunction ( const ExecutorPtr executor,
bool  bForce = false 
)
inline

Changes the current Executor of the command.

Parameters
executorThe new Executor
bForceIf true, the new Executor is always assigned, even if the headers don't match
ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setHidden ( bool  bHidden)
inline

Changes the visibility of the command.

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::setObject ( void object)
inline

Changes the current object (used for member-functions).

ConsoleCommandManipulator& orxonox::ConsoleCommand::ConsoleCommandManipulator::show ( )
inline

Makes the command visible.

Member Data Documentation

ConsoleCommand* orxonox::ConsoleCommand::ConsoleCommandManipulator::command_
private

The command which is being manipulated by this object.


The documentation for this struct was generated from the following file: