lib
Kross::Api::Callable Class Reference
#include <callable.h>

Detailed Description
Base class for callable objects.Classes like Event or Class are inherited from this class and implement the Object::call() method to handle the call.
Definition at line 39 of file callable.h.
Public Types | |
typedef KSharedPtr< Callable > | Ptr |
Public Member Functions | |
Callable (const QString &name) | |
virtual | ~Callable () |
const QString | getName () const |
virtual const QString | getClassName () const |
bool | hasChild (const QString &name) const |
Object::Ptr | getChild (const QString &name) const |
QMap< QString, Object::Ptr > | getChildren () const |
bool | addChild (const QString &name, Object *object) |
bool | addChild (Callable *object) |
void | removeChild (const QString &name) |
void | removeAllChildren () |
virtual Object::Ptr | call (const QString &name, List::Ptr arguments) |
Member Typedef Documentation
typedef KSharedPtr<Callable> Kross::Api::Callable::Ptr |
Shared pointer to implement reference-counting.
Reimplemented from Kross::Api::Object.
Reimplemented in Kross::Api::Class< T >, Kross::Api::EventAction, Kross::Api::EventScript, Kross::Api::EventSignal, Kross::Api::EventSlot, Kross::Api::Module, Kross::Api::QtObject, Kross::Api::MainModule, Kross::Api::ScriptAction, Kross::Api::ScriptContainer, Kross::Api::Class< Kross::Api::QtObject >, and Kross::Api::Class< Kross::Api::Module >.
Definition at line 46 of file callable.h.
Constructor & Destructor Documentation
Callable::Callable | ( | const QString & | name | ) |
Constructor.
- Parameters:
-
name The name this callable object has and it is reachable as via getChild() .
Definition at line 28 of file callable.cpp.
Callable::~Callable | ( | ) | [virtual] |
Member Function Documentation
const QString Callable::getName | ( | void | ) | const |
- Returns:
- the name this object has. Each callable object has a name which is used e.g. on addChild to be able to identify the object itself.
Reimplemented in Kross::Api::ScriptContainer.
Definition at line 38 of file callable.cpp.
const QString Callable::getClassName | ( | ) | const [virtual] |
Return the class name.
This could be something like "Kross::Api::Callable" for this object. The value is mainly used for display purposes.
- Returns:
- The name of this class.
Implements Kross::Api::Object.
Reimplemented in Kross::Api::EventAction, Kross::Api::EventScript, Kross::Api::EventSignal, Kross::Api::EventSlot, Kross::Api::QtObject, and Kross::Api::MainModule.
Definition at line 43 of file callable.cpp.
bool Callable::hasChild | ( | const QString & | name | ) | const |
Returns if the defined child is avaible.
- Returns:
- true if child exists else false.
Definition at line 48 of file callable.cpp.
Object::Ptr Callable::getChild | ( | const QString & | name | ) | const |
Return the defined child or NULL if there is no such object with that name avaible.
- Parameters:
-
name The name of the Object to return.
Definition at line 53 of file callable.cpp.
QMap< QString, Object::Ptr > Callable::getChildren | ( | ) | const |
Return all children.
- Returns:
- A ObjectMap of children this Object has.
Definition at line 58 of file callable.cpp.
bool Callable::addChild | ( | const QString & | name, | |
Object * | object | |||
) |
Add a new child.
Replaces a possible already existing child with such a name.
- Parameters:
-
name the name of the child object The Object to add.
- Returns:
- true if the Object was added successfully else false.
Definition at line 63 of file callable.cpp.
bool Callable::addChild | ( | Callable * | object | ) |
Same as the addChild method above but for callable objects which define there own name.
Definition at line 73 of file callable.cpp.
void Callable::removeChild | ( | const QString & | name | ) |
Remove an existing child.
- Parameters:
-
name The name of the Object to remove. If there doesn't exists an Object with such name just nothing will be done.
Definition at line 78 of file callable.cpp.
void Callable::removeAllChildren | ( | ) |
Object::Ptr Callable::call | ( | const QString & | name, | |
List::Ptr | arguments | |||
) | [virtual] |
Call the object.
Reimplemented in Kross::Api::Event< T >, Kross::Api::Event< Kross::Api::EventSignal >, Kross::Api::Event< Kross::Api::EventScript >, Kross::Api::Event< Kross::Api::EventAction >, Kross::Api::Event< Kross::Api::EventSlot >, Kross::Api::Event< Kross::Api::QtObject >, and Kross::Api::Event< Kross::Api::Module >.
Definition at line 94 of file callable.cpp.
The documentation for this class was generated from the following files: