lib

Kross::Api::Callable Class Reference

#include <callable.h>

Inheritance diagram for Kross::Api::Callable:
Kross::Api::Object Kross::Api::Event< EventAction > Kross::Api::Event< EventScript > Kross::Api::Event< EventSignal > Kross::Api::Event< EventSlot > Kross::Api::Event< Module > Kross::Api::Event< QtObject > Kross::Api::Event< T > Kross::Api::EventAction Kross::Api::EventScript Kross::Api::EventSignal Kross::Api::EventSlot Kross::Api::Class< Module > Kross::Api::Class< QtObject > Kross::Api::Class< T > Kross::Api::Module Kross::Api::QtObject Kross::Api::MainModule Kross::Api::Manager Kross::Api::ScriptContainer Kross::Api::ScriptAction

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 39 of file callable.h.

Member Typedef Documentation

◆ Ptr

typedef TDESharedPtr<Callable> Kross::Api::Callable::Ptr

Shared pointer to implement reference-counting.

Definition at line 46 of file callable.h.

Constructor & Destructor Documentation

◆ Callable()

Callable::Callable ( const TQString & name)

Constructor.

Parameters
nameThe name this callable object has and it is reachable as via getChild() .

Definition at line 28 of file callable.cpp.

◆ ~Callable()

Callable::~Callable ( )
virtual

Destructor.

Definition at line 34 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 73 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
namethe name of the child
objectThe Object to add.
Returns
true if the Object was added successfully else false.

Definition at line 63 of file callable.cpp.

◆ call()

◆ 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
nameThe name of the Object to return.
Returns
The Object matching to the defined name or NULL if there is no such Object.

Definition at line 53 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 58 of file callable.cpp.

◆ getClassName()

const TQString 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::MainModule, and Kross::Api::QtObject.

Definition at line 43 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 38 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 48 of file callable.cpp.

◆ removeAllChildren()

void Callable::removeAllChildren ( )

Remove all children.

Definition at line 86 of file callable.cpp.

◆ removeChild()

void Callable::removeChild ( const TQString & name)

Remove an existing child.

Parameters
nameThe 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.


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