|
charon-core
0.3.1
|
Commom properties of slot objects. More...
#include <charon-core/Slots.h>

Classes | |
| class | DataManager |
| interface of data management classes More... | |
| class | DataManagerFactory |
| interface of data management factories More... | |
Public Types | |
| enum | CacheType { CACHE_INVALID, CACHE_MEM, CACHE_MANAGED } |
| slot data cache type More... | |
Public Member Functions | |
| Slot () | |
| default constructor | |
| bool | connect (Slot &target) |
| Connect with given slot. More... | |
| bool | connected () const |
| Check if slot is connected. | |
| bool | connected (Slot &target) const |
| Check if slot is connected to given slot. More... | |
| bool | disconnect () |
| Remove all slot targets. | |
| bool | disconnect (Slot &target) |
| Remove all slot targets. | |
| virtual void | finalize ()=0 |
| finalize slot More... | |
| virtual std::string | getDisplayName () const |
| Get slot display name. | |
| bool | getMulti () const |
| return value of _multiSlot; | |
| virtual std::string | getName () const |
| Get slot name. | |
| bool | getOptional () const |
| return value of _optional; | |
| ParameteredObject & | getParent () |
| get parent object | |
| const ParameteredObject & | getParent () const |
| get parent object (const version) | |
| virtual std::set< Slot * > | getTargets () const =0 |
| Get pointers to the connected targets. | |
| virtual std::string | getType () const =0 |
| Get slot type. More... | |
| virtual std::string | guessType () const =0 |
| Try to guess slot type. | |
| void | init (ParameteredObject *parent, std::string name, std::string type) |
| initialize parent and name More... | |
| void | init (ParameteredObject *parent, std::string name, std::string displayname, std::string type) |
| initialize parent and name and displayname More... | |
| virtual void | load (const ParameterFile &pf, const PluginManagerInterface *man)=0 |
| Load slot connections. More... | |
| virtual void | prepare ()=0 |
| prepare slot More... | |
| void | printError (const std::string &msg) const |
| print error with slot name and type info to sout | |
| void | printInfo (const std::string &msg) const |
| print info message with slot name to sout | |
| void | printWarning (const std::string &msg) const |
| print warning message with slot name to sout | |
| void | raise (const std::string &msg) const |
| throw runtime error with slot name and type info | |
| virtual void | save (ParameterFile &pf) const |
| Save slot connections This function disconnects already established connections in the parameterFile and stores the current one. More... | |
Protected Member Functions | |
| virtual bool | _addTarget (Slot *target)=0 |
| Add slot target. More... | |
| virtual bool | _removeTarget (Slot *target)=0 |
| Remove slot target. More... | |
Protected Attributes | |
| std::string | _displayName |
| Slot display name. | |
| bool | _multiSlot |
| flag to mark this slot as a multislot, that can have multiple sources/targets. More... | |
| std::string | _name |
| Slot name. | |
| bool | _optional |
| flag to mark this slot as optional | |
| ParameteredObject * | _parent |
| Pointer to parent object. | |
| std::string | _type |
| Slot type. | |
Private Member Functions | |
| Slot (const Slot &) | |
| forbid copying | |
| enum Slot::CacheType |
|
protectedpure virtual |
This does not touch the target slot itself.
| target | Target slot to add. |
| true | Target sucessfully connected. |
| false | Target was not connected. |
Implemented in VirtualSlot, AbstractSlot< T >, AbstractSlot< double >, AbstractSlot< int >, and AbstractSlot< bool >.
|
protectedpure virtual |
This does not touch the target slot itself.
| target | Target slot to remove. |
| true | Target sucessfully disconnected. |
| false | Target was not connected. |
Implemented in VirtualSlot, AbstractSlot< T >, AbstractSlot< double >, AbstractSlot< int >, and AbstractSlot< bool >.
| bool Slot::connect | ( | Slot & | target | ) |
| target | Target slot to connect to. |
| true | operation successful |
Definition at line 94 of file Slots.cpp.
References _addTarget().
| bool Slot::connected | ( | Slot & | target | ) | const |
| target | Target slot to check. |
| true | Given slots are connected. |
Definition at line 89 of file Slots.cpp.
References getTargets().
|
pure virtual |
this may be used on input/output slots to save/free data memory
Implemented in VirtualSlot, OutputSlot< T >, OutputSlot< int >, InputSlot< T >, InputSlot< double >, InputSlot< int >, and InputSlot< bool >.
|
pure virtual |
If "<T>" is found inside the type string, this will be replaced through the template type of the parent ParameteredObject.
Implemented in VirtualInputSlot, VirtualOutputSlot, VirtualSlot, OutputSlot< T >, OutputSlot< int >, InputSlot< T >, InputSlot< double >, InputSlot< int >, InputSlot< bool >, AbstractSlot< T >, AbstractSlot< double >, AbstractSlot< int >, and AbstractSlot< bool >.
| void Slot::init | ( | ParameteredObject * | parent, |
| std::string | name, | ||
| std::string | type | ||
| ) |
| parent | parent object |
| name | slot name |
| type | slot type |
| std::string | Error message if invalid parent set. |
Definition at line 35 of file Slots.cpp.
References _displayName, _name, _parent, _type, and StringTool::toLowerCase().
| void Slot::init | ( | ParameteredObject * | parent, |
| std::string | name, | ||
| std::string | displayname, | ||
| std::string | type | ||
| ) |
| parent | parent object |
| name | slot name |
| displayname | slot display name |
| type | slot type |
| std::string | Error message if invalid parent set. |
Definition at line 56 of file Slots.cpp.
References _displayName, and init().
|
pure virtual |
Input slots set up the connection between slots calling _addTargets() on the partners to be connected via connect(). Output slots load their slot configuration, i.e. set up e.g. their cache type if specified in the parameter file.
| pf | ParameterFile to load from |
| man | PluginManager to get the instances from |
Implemented in VirtualSlot, OutputSlot< T >, OutputSlot< int >, InputSlot< T >, InputSlot< double >, InputSlot< int >, and InputSlot< bool >.
|
pure virtual |
this may be used on input/output slots to allocate memory
Implemented in VirtualSlot, OutputSlot< T >, OutputSlot< int >, InputSlot< T >, InputSlot< double >, InputSlot< int >, and InputSlot< bool >.
|
virtual |
| pf | ParameterFile to save to |
Reimplemented in VirtualSlot, AbstractSlot< T >, AbstractSlot< double >, AbstractSlot< int >, and AbstractSlot< bool >.