UGDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Types | Public Member Functions | Protected Member Functions
ugdk::script::VirtualData Class Reference

Abstract class representing virtual script data. More...

#include <virtualdata.h>

Inheritance diagram for ugdk::script::VirtualData:
Inheritance graph
[legend]

List of all members.

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< PtrVector
typedef std::list< PtrList
typedef std::map< Ptr, PtrMap

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 LangWrapperwrapper () 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 ()

Detailed Description

Abstract class representing virtual script data.


Member Typedef Documentation

typedef std::tr1::shared_ptr<const VirtualData> ugdk::script::VirtualData::ConstPtr
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

Constructor & Destructor Documentation

virtual ugdk::script::VirtualData::~VirtualData ( ) [inline, virtual]
ugdk::script::VirtualData::VirtualData ( ) [inline, protected]

Member Function Documentation

virtual void ugdk::script::VirtualData::AddToBuffer ( ) [inline, virtual]

Reimplemented in ugdk::script::lua::LuaData.

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]
virtual void* ugdk::script::VirtualData::unsafe_data ( ) const [pure virtual]
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]
virtual int ugdk::script::VirtualData::UnwrapInteger ( ) const [pure virtual]
virtual List ugdk::script::VirtualData::UnwrapList ( ) const [pure virtual]
virtual Map ugdk::script::VirtualData::UnwrapMap ( ) const [pure virtual]
virtual double ugdk::script::VirtualData::UnwrapNumber ( ) const [pure virtual]
virtual const char* ugdk::script::VirtualData::UnwrapString ( ) const [pure virtual]
virtual Vector ugdk::script::VirtualData::UnwrapVector ( ) const [pure virtual]
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(...);

Parameters:
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.
Returns:
A shared pointer to the wrapped data.
See also:
ugdk::script::TypeRegistry

Implemented in ugdk::script::python::PythonData, and ugdk::script::lua::LuaData.

virtual void ugdk::script::VirtualData::WrapBoolean ( bool  boolean) [pure virtual]
virtual void ugdk::script::VirtualData::WrapInteger ( int  number) [pure virtual]
virtual void ugdk::script::VirtualData::WrapNumber ( double  number) [pure virtual]
virtual LangWrapper* ugdk::script::VirtualData::wrapper ( ) const [pure virtual]
virtual void ugdk::script::VirtualData::WrapString ( const char *  str) [pure virtual]

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines