#include <callable.h>
Public Types | |
| typedef TDESharedPtr< Callable > | Ptr |
| Public Types inherited from Kross::Api::Object | |
| typedef TDESharedPtr< Object > | Ptr |
Public Member Functions | |
| Callable (const TQString &name) | |
| virtual | ~Callable () |
| const TQString | getName () const |
| virtual const TQString | getClassName () const |
| bool | hasChild (const TQString &name) const |
| Object::Ptr | getChild (const TQString &name) const |
| TQMap< TQString, Object::Ptr > | getChildren () const |
| bool | addChild (const TQString &name, Object *object) |
| bool | addChild (Callable *object) |
| void | removeChild (const TQString &name) |
| void | removeAllChildren () |
| virtual Object::Ptr | call (const TQString &name, List::Ptr arguments) |
| Public Member Functions inherited from Kross::Api::Object | |
| Object () | |
| virtual | ~Object () |
| virtual const TQString | toString () |
| virtual Object::Ptr | call (const TQString &name, TDESharedPtr< List > arguments) |
| virtual TQStringList | getCalls () |
Additional Inherited Members | |
| Static Public Member Functions inherited from Kross::Api::Object | |
| template<class T> | |
| static T * | fromObject (Object::Ptr object) |
| template<typename TYPE> | |
| static Object::Ptr | toObject (TYPE t) |
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 41 of file callable.h.
Member Typedef Documentation
◆ Ptr
| typedef TDESharedPtr<Callable> Kross::Api::Callable::Ptr |
Shared pointer to implement reference-counting.
Definition at line 48 of file callable.h.
Constructor & Destructor Documentation
◆ Callable()
| Callable::Callable | ( | const TQString & | name | ) |
Constructor.
- Parameters
-
name The name this callable object has and it is reachable as via getChild() .
Definition at line 27 of file callable.cpp.
◆ ~Callable()
|
virtual |
Destructor.
Definition at line 33 of file callable.cpp.
Member Function Documentation
◆ addChild() [1/2]
| bool Callable::addChild | ( | Callable * | object | ) |
Same as the addChild method above but for callable objects which define there own name.
Definition at line 72 of file callable.cpp.
◆ addChild() [2/2]
| bool Callable::addChild | ( | const TQString & | 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 62 of file callable.cpp.
◆ call()
|
virtual |
Call the object.
Reimplemented in Kross::Api::Event< T >, Kross::Api::Event< EventAction >, Kross::Api::Event< EventScript >, Kross::Api::Event< EventSignal >, Kross::Api::Event< EventSlot >, Kross::Api::Event< Module >, and Kross::Api::Event< QtObject >.
Definition at line 93 of file callable.cpp.
◆ getChild()
| Object::Ptr Callable::getChild | ( | const TQString & | 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 52 of file callable.cpp.
◆ getChildren()
| TQMap< TQString, Object::Ptr > Callable::getChildren | ( | ) | const |
Return all children.
- Returns
- A ObjectMap of children this Object has.
Definition at line 57 of file callable.cpp.
◆ getClassName()
|
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::MainModule, and Kross::Api::QtObject.
Definition at line 42 of file callable.cpp.
◆ getName()
| const TQString Callable::getName | ( | ) | 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.
Definition at line 37 of file callable.cpp.
◆ hasChild()
| bool Callable::hasChild | ( | const TQString & | name | ) | const |
Returns if the defined child is avaible.
- Returns
- true if child exists else false.
Definition at line 47 of file callable.cpp.
◆ removeAllChildren()
| void Callable::removeAllChildren | ( | ) |
Remove all children.
Definition at line 85 of file callable.cpp.
◆ removeChild()
| void Callable::removeChild | ( | const TQString & | 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 77 of file callable.cpp.
The documentation for this class was generated from the following files:
