Fawkes API
Fawkes Development Version
|
Player Fawkes mapper factory. More...
#include "mapper_factory.h"
Public Member Functions | |
template<class FawkesInterfaceType , class PlayerProxyType , class MapperType > | |
PlayerProxyFawkesInterfaceMapper * | try_create (std::string varname, fawkes::Interface *interface, PlayerCc::ClientProxy *proxy) |
Try to create a mapper instance. More... | |
Static Public Member Functions | |
static PlayerProxyFawkesInterfaceMapper * | create_mapper (std::string varname, fawkes::Interface *interface, PlayerCc::ClientProxy *proxy) |
Create a mapp instance. More... | |
Player Fawkes mapper factory.
Factory class to create mappers from Fawkes interfaces to Player proxies.
Definition at line 38 of file mapper_factory.h.
|
static |
Create a mapp instance.
Tries to figure out the type of the interface and proxy and if a known matching exists will return an appropriate mapper.
varname | variable name |
interface | Fawkes interface instance |
proxy | Player proxy instance |
Exception | thrown if no known mapping exists for the given interfaces. |
Definition at line 53 of file mapper_factory.cpp.
References fawkes::Interface::type().
PlayerProxyFawkesInterfaceMapper* PlayerMapperFactory::try_create | ( | std::string | varname, |
fawkes::Interface * | interface, | ||
PlayerCc::ClientProxy * | proxy | ||
) |
Try to create a mapper instance.
Tries to dynamically cast the Fawkes interface and Player proxy to the desired types, and if that succeeds instantiates a new mapper of the given type giving the casted instances as parameters.
varname | variable name |
interface | Fawkes interface instance |
proxy | Player proxy instance |
Definition at line 67 of file mapper_factory.h.