lib
object.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "object.h"
00021 #include "list.h"
00022 #include "variant.h"
00023
00024 #include "event.h"
00025 #include "exception.h"
00026
00027 using namespace Kross::Api;
00028
00029 Object::Object()
00030 : KShared()
00031 {
00032 #ifdef KROSS_API_OBJECT_CTOR_DEBUG
00033 krossdebug( QString("Kross::Api::Object::Constructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
00034 #endif
00035 }
00036
00037 Object::~Object()
00038 {
00039 #ifdef KROSS_API_OBJECT_DTOR_DEBUG
00040 krossdebug( QString("Kross::Api::Object::Destructor() name='%1' refcount='%2'").arg(m_name).arg(_KShared_count()) );
00041 #endif
00042
00043 }
00044
00045 const QString Object::toString()
00046 {
00047 return QString("%1").arg(getClassName());
00048 }
00049
00050 Object::Ptr Object::call(const QString& name, List::Ptr arguments)
00051 {
00052 Q_UNUSED(arguments);
00053
00054 #ifdef KROSS_API_OBJECT_CALL_DEBUG
00055 krossdebug( QString("Kross::Api::Object::call(%1) name=%2 class=%3").arg(name).arg(getName()).arg(getClassName()) );
00056 #endif
00057
00058 if(name.isEmpty())
00059 return this;
00060
00061 throw Exception::Ptr( new Exception(QString("No callable object named '%2'").arg(name)) );
00062 }
00063
|