Jopnal Engine  alpha 0.4
Simple Component Based 2D/3D Game Engine
Public Member Functions | List of all members
jop::CommandHandler Class Referencefinal

#include <CommandHandler.hpp>

Public Member Functions

template<typename Func , typename Parser >
void bind (const std::string &command, const Func &func, const Parser &parser, const Message::Result result)
 Bind a new free function using a custom parser. More...
 
template<typename Ret , typename... FuncArgs>
void bind (const std::string &command, const std::function< Ret(FuncArgs...)> &func, const Message::Result result)
 Bind a new free function. More...
 
template<typename Ret , typename... FuncArgs>
void bind (const std::string &command, Ret(*func)(FuncArgs...), const Message::Result result)
 Bind a new free function. More...
 
template<typename Func , typename Parser >
void bindMember (const std::string &command, const Func &func, const Parser &parser, const Message::Result result)
 Bind a new member function. More...
 
template<typename Ret , typename Class , typename... FuncArgs>
void bindMember (const std::string &command, const std::function< Ret(Class &, FuncArgs...)> &func, const Message::Result result)
 Bind a new member function. More...
 
template<typename Ret , typename Class , typename... FuncArgs>
void bindMember (const std::string &command, Ret(Class::*func)(FuncArgs...), const Message::Result result)
 Bind a new member function. More...
 
template<typename Ret , typename Class , typename... FuncArgs>
void bindMember (const std::string &command, Ret(Class::*func)(FuncArgs...) const, const Message::Result result)
 Bind a new const member function. More...
 
Message::Result execute (const std::string &command, void *instance)
 Execute a command. More...
 

Detailed Description

Definition at line 47 of file CommandHandler.hpp.

Member Function Documentation

template<typename Func , typename Parser >
void jop::CommandHandler::bind ( const std::string &  command,
const Func &  func,
const Parser &  parser,
const Message::Result  result 
)

Bind a new free function using a custom parser.

Parameters
commandThe command name
funcThe function to bind
parserThe parser to use
resultThe message result this function should return
template<typename Ret , typename... FuncArgs>
void jop::CommandHandler::bind ( const std::string &  command,
const std::function< Ret(FuncArgs...)> &  func,
const Message::Result  result 
)

Bind a new free function.

Parameters
commandThe command name
funcThe function object to bind
resultThe message result this function should return
template<typename Ret , typename... FuncArgs>
void jop::CommandHandler::bind ( const std::string &  command,
Ret(*)(FuncArgs...)  func,
const Message::Result  result 
)

Bind a new free function.

Parameters
commandThe command name
funcThe function pointer to bind
resultThe message result this function should return
template<typename Func , typename Parser >
void jop::CommandHandler::bindMember ( const std::string &  command,
const Func &  func,
const Parser &  parser,
const Message::Result  result 
)

Bind a new member function.

Parameters
commandThe command name
funcThe function to bind
parserThe parser to use
resultThe message result this function should return
template<typename Ret , typename Class , typename... FuncArgs>
void jop::CommandHandler::bindMember ( const std::string &  command,
const std::function< Ret(Class &, FuncArgs...)> &  func,
const Message::Result  result 
)

Bind a new member function.

Parameters
commandThe command name
funcThe function object to bind
resultThe message result this function should return
template<typename Ret , typename Class , typename... FuncArgs>
void jop::CommandHandler::bindMember ( const std::string &  command,
Ret(Class::*)(FuncArgs...)  func,
const Message::Result  result 
)

Bind a new member function.

Parameters
commandThe command name
funcThe function pointer to bind
resultThe message result this function should return
template<typename Ret , typename Class , typename... FuncArgs>
void jop::CommandHandler::bindMember ( const std::string &  command,
Ret(Class::*)(FuncArgs...) const  func,
const Message::Result  result 
)

Bind a new const member function.

Parameters
commandThe command name
funcThe function pointer to bind
resultThe message result this function should return
Message::Result jop::CommandHandler::execute ( const std::string &  command,
void *  instance 
)

Execute a command.

Parameters
commandThe command name
instanceThe class instance to call the command on. Can be nullptr to only consider free functions
Returns
The message result

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