UGDK
|
Abstract class representing virtual script data. More...
#include <virtualdata.h>
Public Types | |
typedef std::tr1::shared_ptr < VirtualData > | Ptr |
typedef std::tr1::shared_ptr < const VirtualData > | ConstPtr |
typedef std::tr1::weak_ptr < VirtualData > | WeakPtr |
typedef std::vector< Ptr > | Vector |
typedef std::list< Ptr > | List |
typedef std::map< Ptr, Ptr > | Map |
Public Member Functions | |
virtual | ~VirtualData () |
Ptr | Copy () |
virtual void * | Unwrap (const VirtualType &type, bool disown) const =0 |
Tries to unwrap the data contained in this object using the given type. | |
virtual const char * | UnwrapString () const =0 |
virtual bool | UnwrapBoolean () const =0 |
virtual int | UnwrapInteger () const =0 |
virtual double | UnwrapNumber () const =0 |
virtual Vector | UnwrapVector () const =0 |
virtual List | UnwrapList () const =0 |
virtual Map | UnwrapMap () const =0 |
virtual void | Wrap (void *data, const VirtualType &type)=0 |
Tries to wrap the given data with the given type. | |
virtual void | WrapString (const char *str)=0 |
virtual void | WrapBoolean (bool boolean)=0 |
virtual void | WrapInteger (int number)=0 |
virtual void | WrapNumber (double number)=0 |
virtual LangWrapper * | wrapper () const =0 |
virtual Ptr | Execute (const Vector &args)=0 |
passing the given arguments and returning the result. | |
virtual Ptr | GetAttribute (Ptr key)=0 |
Tries to get a attribute with the given name from this object. | |
virtual Ptr | SetAttribute (Ptr key, Ptr value)=0 |
virtual void * | unsafe_data () const =0 |
virtual void | AddToBuffer () |
virtual void | RemoveFromBuffer () |
Protected Member Functions | |
VirtualData () |
Abstract class representing virtual script data.
typedef std::tr1::shared_ptr<const VirtualData> ugdk::script::VirtualData::ConstPtr |
typedef std::list<Ptr> ugdk::script::VirtualData::List |
typedef std::map<Ptr, Ptr> ugdk::script::VirtualData::Map |
typedef std::tr1::shared_ptr<VirtualData> ugdk::script::VirtualData::Ptr |
typedef std::vector<Ptr> ugdk::script::VirtualData::Vector |
typedef std::tr1::weak_ptr<VirtualData> ugdk::script::VirtualData::WeakPtr |
virtual ugdk::script::VirtualData::~VirtualData | ( | ) | [inline, virtual] |
ugdk::script::VirtualData::VirtualData | ( | ) | [inline, protected] |
virtual void ugdk::script::VirtualData::AddToBuffer | ( | ) | [inline, virtual] |
Reimplemented in ugdk::script::lua::LuaData.
Ptr ugdk::script::VirtualData::Copy | ( | ) | [inline] |
virtual Ptr ugdk::script::VirtualData::Execute | ( | const Vector & | args | ) | [pure virtual] |
passing the given arguments and returning the result.
Tries to execute ourselves as a function in a script language,
virtual Ptr ugdk::script::VirtualData::GetAttribute | ( | Ptr | key | ) | [pure virtual] |
Tries to get a attribute with the given name from this object.
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::RemoveFromBuffer | ( | ) | [inline, virtual] |
Reimplemented in ugdk::script::lua::LuaData.
virtual Ptr ugdk::script::VirtualData::SetAttribute | ( | Ptr | key, |
Ptr | value | ||
) | [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void* ugdk::script::VirtualData::unsafe_data | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void* ugdk::script::VirtualData::Unwrap | ( | const VirtualType & | type, |
bool | disown | ||
) | const [pure virtual] |
Tries to unwrap the data contained in this object using the given type.
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual bool ugdk::script::VirtualData::UnwrapBoolean | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual int ugdk::script::VirtualData::UnwrapInteger | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual List ugdk::script::VirtualData::UnwrapList | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual Map ugdk::script::VirtualData::UnwrapMap | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual double ugdk::script::VirtualData::UnwrapNumber | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual const char* ugdk::script::VirtualData::UnwrapString | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual Vector ugdk::script::VirtualData::UnwrapVector | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::Wrap | ( | void * | data, |
const VirtualType & | type | ||
) | [pure virtual] |
Tries to wrap the given data with the given type.
Returns a new VirtualData::Ptr with the data wrapped upon success.
The VirtualData object returned by this method is NOT NECESSARILY the same as the one that called it. Thus a safe way to use this is like this:
VirtualData::Ptr vdata;
// ...
vdata = vdata->Wrap(...);
data | - a void pointer to the data being wrapped. |
type | - a virtual type got from TypeRegistry<T>::type(), where T is the original declarated type of the data. |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::WrapBoolean | ( | bool | boolean | ) | [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::WrapInteger | ( | int | number | ) | [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::WrapNumber | ( | double | number | ) | [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual LangWrapper* ugdk::script::VirtualData::wrapper | ( | ) | const [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.
virtual void ugdk::script::VirtualData::WrapString | ( | const char * | str | ) | [pure virtual] |
Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.