Script Class Reference

#include <script.h>

Inheritance diagram for Script:
zmm::Object DVDImportScript ImportScript PlaylistParserScript

Public Member Functions

 Script (zmm::Ref< Runtime > runtime)
virtual ~Script ()
zmm::String getProperty (JSObject *obj, zmm::String name)
int getBoolProperty (JSObject *obj, zmm::String name)
int getIntProperty (JSObject *obj, zmm::String name, int def)
JSObject * getObjectProperty (JSObject *obj, zmm::String name)
void setProperty (JSObject *obj, zmm::String name, zmm::String value)
void setIntProperty (JSObject *obj, zmm::String name, int value)
void setObjectProperty (JSObject *parent, zmm::String name, JSObject *obj)
void deleteProperty (JSObject *obj, zmm::String name)
JSObject * getGlobalObject ()
void setGlobalObject (JSObject *glob)
JSContext * getContext ()
void defineFunction (zmm::String name, JSNative function, int numParams)
void defineFunctions (JSFunctionSpec *functions)
void load (zmm::String scriptPath)
void load (zmm::String scriptText, zmm::String scriptPath)
zmm::Ref< CdsObjectjsObject2cdsObject (JSObject *js, zmm::Ref< CdsObject > pcd)
void cdsObject2jsObject (zmm::Ref< CdsObject > obj, JSObject *js)
virtual script_class_t whoami ()=0
zmm::Ref< CdsObjectgetProcessedObject ()
zmm::String convertToCharset (zmm::String str, charset_convert_t chr)
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Data Fields

zmm::Ref< Runtimeruntime
JSRuntime * rt
JSContext * cx
JSObject * glob
JSScript * script
JSScript * common_script

Protected Member Functions

void execute ()

Protected Attributes

int gc_counter
zmm::Ref< CdsObjectprocessed
mt_atomic_t _ref_count
pthread_mutex_t mutex

Private Member Functions

void initGlobalObject ()
JSScript * _load (zmm::String scriptPath)
void _execute (JSScript *scr)

Private Attributes

JSObject * common_root
zmm::Ref< StringConverter_p2i
zmm::Ref< StringConverter_j2i
zmm::Ref< StringConverter_f2i
zmm::Ref< StringConverter_m2i
zmm::Ref< StringConverter_i2i

Detailed Description

Definition at line 62 of file script.h.


Constructor & Destructor Documentation

Script::Script ( zmm::Ref< Runtime runtime  ) 
virtual Script::~Script (  )  [virtual]

Member Function Documentation

void Script::_execute ( JSScript *  scr  )  [private]
JSScript* Script::_load ( zmm::String  scriptPath  )  [private]
void Script::cdsObject2jsObject ( zmm::Ref< CdsObject obj,
JSObject *  js 
)
zmm::String Script::convertToCharset ( zmm::String  str,
charset_convert_t  chr 
)
void Script::defineFunction ( zmm::String  name,
JSNative  function,
int  numParams 
)
void Script::defineFunctions ( JSFunctionSpec *  functions  ) 
void Script::deleteProperty ( JSObject *  obj,
zmm::String  name 
)
void Script::execute (  )  [protected]
int Script::getBoolProperty ( JSObject *  obj,
zmm::String  name 
)
JSContext* Script::getContext (  ) 
JSObject* Script::getGlobalObject (  ) 
int Script::getIntProperty ( JSObject *  obj,
zmm::String  name,
int  def 
)
JSObject* Script::getObjectProperty ( JSObject *  obj,
zmm::String  name 
)
zmm::Ref<CdsObject> Script::getProcessedObject (  ) 
zmm::String Script::getProperty ( JSObject *  obj,
zmm::String  name 
)
int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

void Script::initGlobalObject (  )  [private]
zmm::Ref<CdsObject> Script::jsObject2cdsObject ( JSObject *  js,
zmm::Ref< CdsObject pcd 
)
void Script::load ( zmm::String  scriptText,
zmm::String  scriptPath 
)
void Script::load ( zmm::String  scriptPath  ) 
void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
void Script::setGlobalObject ( JSObject *  glob  ) 
void Script::setIntProperty ( JSObject *  obj,
zmm::String  name,
int  value 
)
void Script::setObjectProperty ( JSObject *  parent,
zmm::String  name,
JSObject *  obj 
)
void Script::setProperty ( JSObject *  obj,
zmm::String  name,
zmm::String  value 
)
virtual script_class_t Script::whoami (  )  [pure virtual]

Field Documentation

Definition at line 122 of file script.h.

Definition at line 124 of file script.h.

Definition at line 121 of file script.h.

Definition at line 123 of file script.h.

Definition at line 120 of file script.h.

mt_atomic_t zmm::Object::_ref_count [protected, inherited]
JSObject* Script::common_root [private]

Definition at line 115 of file script.h.

Definition at line 70 of file script.h.

JSContext* Script::cx

Definition at line 67 of file script.h.

int Script::gc_counter [protected]

Definition at line 108 of file script.h.

JSObject* Script::glob

Definition at line 68 of file script.h.

pthread_mutex_t zmm::Object::mutex [protected, inherited]

Definition at line 112 of file script.h.

JSRuntime* Script::rt

Definition at line 66 of file script.h.

Definition at line 65 of file script.h.

JSScript* Script::script

Definition at line 69 of file script.h.


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

Generated on Fri Mar 26 20:16:57 2010 for MediaTomb by  doxygen 1.6.1