Pyrogenesis  13997
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | Static Protected Attributes | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
CJSObject< T, ReadOnly > Class Template Reference

#include <ScriptableObject.h>

Inheritance diagram for CJSObject< T, ReadOnly >:
IJSObject

Public Types

typedef jsval(T::* TGetFn )(JSContext *)
 
typedef void(T::* TSetFn )(JSContext *, jsval value)
 
- Public Types inherited from IJSObject
typedef boost::unordered_map
< CStrW, IJSProperty * > 
PropertyTable
 
typedef jsval(IJSObject::* GetFn )(JSContext *cx)
 
typedef void(IJSObject::* SetFn )(JSContext *cx, jsval value)
 

Public Member Functions

bool GetProperty (JSContext *cx, const CStrW &PropertyName, jsval *vp)
 
void SetProperty (JSContext *cx, const CStrW &PropertyName, jsval *vp)
 
IJSPropertyHasProperty (const CStrW &PropertyName)
 
void AddProperty (const CStrW &PropertyName, jsval Value)
 
template<typename PropType >
void AddLocalProperty (const CStrW &PropertyName, PropType *Native, bool PropReadOnly=ReadOnly)
 
JSObject * GetScript ()
 
void CreateScriptObject ()
 
void ReleaseScriptObject ()
 
 CJSObject ()
 
virtual ~CJSObject ()
 
void Shutdown ()
 
- Public Member Functions inherited from IJSObject
 IJSObject ()
 
virtual ~IJSObject ()
 

Static Public Member Functions

static void ScriptingInit (const char *ClassName, JSNative Constructor=NULL, uintN ConstructorMinArgs=0)
 
static void ScriptingShutdown ()
 
static void AddProperty (const CStrW &PropertyName, TGetFn Getter, TSetFn Setter=NULL)
 
template<typename ReturnType , ReturnType(T::*)(JSContext *cx, uintN argc, jsval *argv) NativeFunction>
static void AddMethod (const char *Name, uintN MinArgs)
 
template<typename PropType >
static void AddProperty (const CStrW &PropertyName, PropType T::*Native, bool PropReadOnly=ReadOnly)
 

Static Public Attributes

static JSClass JSI_class
 

Protected Attributes

PropertyTable m_NonsharedProperties
 
PropertyTable m_ScriptProperties
 
bool m_EngineOwned
 

Static Protected Attributes

static PropertyTable m_NativeProperties
 

Static Private Member Functions

static JSBool JSGetProperty (JSContext *cx, JSObject *obj, jsid id, jsval *vp)
 
static JSBool JSSetProperty (JSContext *cx, JSObject *obj, jsid id, JSBool strict, jsval *vp)
 
static void DefaultFinalize (JSContext *cx, JSObject *obj)
 

Private Attributes

JSObject * m_JS
 

Static Private Attributes

static JSPropertySpec JSI_props []
 
static std::vector
< JSFunctionSpec > 
m_Methods
 

Detailed Description

template<typename T, bool ReadOnly = false>
class CJSObject< T, ReadOnly >

Definition at line 66 of file ScriptableObject.h.

Member Typedef Documentation

template<typename T , bool ReadOnly = false>
typedef jsval(T::* CJSObject< T, ReadOnly >::TGetFn)(JSContext *)

Definition at line 234 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
typedef void(T::* CJSObject< T, ReadOnly >::TSetFn)(JSContext *, jsval value)

Definition at line 235 of file ScriptableObject.h.

Constructor & Destructor Documentation

template<typename T , bool ReadOnly = false>
CJSObject< T, ReadOnly >::CJSObject ( )
inline

Definition at line 442 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
virtual CJSObject< T, ReadOnly >::~CJSObject ( )
inlinevirtual

Definition at line 447 of file ScriptableObject.h.

Member Function Documentation

template<typename T , bool ReadOnly = false>
template<typename PropType >
void CJSObject< T, ReadOnly >::AddLocalProperty ( const CStrW &  PropertyName,
PropType *  Native,
bool  PropReadOnly = ReadOnly 
)
inline

Definition at line 345 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
template<typename ReturnType , ReturnType(T::*)(JSContext *cx, uintN argc, jsval *argv) NativeFunction>
static void CJSObject< T, ReadOnly >::AddMethod ( const char *  Name,
uintN  MinArgs 
)
inlinestatic

Definition at line 326 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
void CJSObject< T, ReadOnly >::AddProperty ( const CStrW &  PropertyName,
jsval  Value 
)
inlinevirtual

Implements IJSObject.

Definition at line 315 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static void CJSObject< T, ReadOnly >::AddProperty ( const CStrW &  PropertyName,
TGetFn  Getter,
TSetFn  Setter = NULL 
)
inlinestatic

Definition at line 321 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
template<typename PropType >
static void CJSObject< T, ReadOnly >::AddProperty ( const CStrW &  PropertyName,
PropType T::*  Native,
bool  PropReadOnly = ReadOnly 
)
inlinestatic

Definition at line 331 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
void CJSObject< T, ReadOnly >::CreateScriptObject ( )
inline

Definition at line 367 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static void CJSObject< T, ReadOnly >::DefaultFinalize ( JSContext *  cx,
JSObject *  obj 
)
inlinestaticprivate

Definition at line 426 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
bool CJSObject< T, ReadOnly >::GetProperty ( JSContext *  cx,
const CStrW &  PropertyName,
jsval *  vp 
)
inlinevirtual

Implements IJSObject.

Definition at line 264 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
JSObject* CJSObject< T, ReadOnly >::GetScript ( )
inline

Definition at line 359 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
IJSProperty* CJSObject< T, ReadOnly >::HasProperty ( const CStrW &  PropertyName)
inlinevirtual

Implements IJSObject.

Definition at line 291 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static JSBool CJSObject< T, ReadOnly >::JSGetProperty ( JSContext *  cx,
JSObject *  obj,
jsid  id,
jsval *  vp 
)
inlinestaticprivate

Definition at line 393 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static JSBool CJSObject< T, ReadOnly >::JSSetProperty ( JSContext *  cx,
JSObject *  obj,
jsid  id,
JSBool  strict,
jsval *  vp 
)
inlinestaticprivate

Definition at line 410 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
void CJSObject< T, ReadOnly >::ReleaseScriptObject ( )
inline

Definition at line 378 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static void CJSObject< T, ReadOnly >::ScriptingInit ( const char *  ClassName,
JSNative  Constructor = NULL,
uintN  ConstructorMinArgs = 0 
)
inlinestatic

Definition at line 239 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
static void CJSObject< T, ReadOnly >::ScriptingShutdown ( )
inlinestatic

Definition at line 255 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
void CJSObject< T, ReadOnly >::SetProperty ( JSContext *  cx,
const CStrW &  PropertyName,
jsval *  vp 
)
inline

Definition at line 272 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
void CJSObject< T, ReadOnly >::Shutdown ( void  )
inline

Definition at line 451 of file ScriptableObject.h.

Member Data Documentation

template<typename T , bool ReadOnly = false>
JSClass CJSObject< T, ReadOnly >::JSI_class
static
Initial value:
= {
NULL, JSCLASS_HAS_PRIVATE,
JS_PropertyStub, JS_PropertyStub,
JS_EnumerateStub, JS_ResolveStub,
JS_ConvertStub, DefaultFinalize,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL
}

Definition at line 237 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
JSPropertySpec CJSObject< T, ReadOnly >::JSI_props
staticprivate
Initial value:
= {
{ NULL, 0, 0, NULL, NULL },
}

Definition at line 437 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
bool CJSObject< T, ReadOnly >::m_EngineOwned
protected

Definition at line 230 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
JSObject* CJSObject< T, ReadOnly >::m_JS
private

Definition at line 215 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
std::vector< JSFunctionSpec > CJSObject< T, ReadOnly >::m_Methods
staticprivate

Definition at line 438 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
CJSObject< T, ReadOnly >::PropertyTable CJSObject< T, ReadOnly >::m_NativeProperties
staticprotected

Definition at line 219 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
PropertyTable CJSObject< T, ReadOnly >::m_NonsharedProperties
protected

Definition at line 221 of file ScriptableObject.h.

template<typename T , bool ReadOnly = false>
PropertyTable CJSObject< T, ReadOnly >::m_ScriptProperties
protected

Definition at line 224 of file ScriptableObject.h.


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