Classes | |
| class | JsContext |
| A class for keeping reference to a persistent context. More... | |
| class | JsContextManager |
| A singleton for managing JavaScript contexts. More... | |
| struct | JsObject |
| An auxiliary data structure for helping to control the garbage collection of wrapped C++ objects associated to JavaScript objects in Google's V8 engine. More... | |
| class | Module |
| This singleton defines the TerraLib's Google JavaScript V8 Common Runtime module entry. More... | |
Functions | |
| TEV8COMMONEXPORT void | Cache (::v8::Local<::v8::Object > &obj, const std::string &methodName,::v8::Persistent<::v8::Function > &outFtor) |
| It caches the object method into the persistent output functor. More... | |
| void | Convert2Cpp (const ::v8::Local<::v8::Object > &jsmap, std::map< std::string, std::string > &cppmap) |
| It converts the input map to an object representing the associative conteiner. More... | |
| inline::v8::Local<::v8::Object > | Convert2Js (const std::map< std::string, std::string > &m) |
| It converts the input map to an object representing the associative conteiner. More... | |
| template<class T > | |
| void | JsObjectRelease (::v8::Persistent<::v8::Value > obj, void *parameter) |
| The call-back function for releasing objects. More... | |
| template<class T > | |
| void | LooseOwnership (::v8::Handle<::v8::Object > obj) |
| An utility function that extracts the C++ object from a wrapped object. More... | |
| template<class T , class TF > | |
| ::v8::Local<::v8::Object > | Make (T *obj, TF tfunc, const bool isOwner) |
| It creates a new JavaScript object from a C++ object (obj). More... | |
| TEV8COMMONEXPORT::v8::Handle<::v8::Value > | Print (const ::v8::Arguments &args) |
| This function will print all the arguments to the standard output. More... | |
| TEV8COMMONEXPORT::v8::Handle<::v8::String > | ReadFile (const std::string &fileName) |
| It reads a file into a v8 string. More... | |
| template<class T > | |
| T * | Unwrap (::v8::Handle<::v8::Object > obj) |
| An utility function that extracts the C++ object from a wrapped object. More... | |
| template<class T > | |
| T * | UnwrapAndLooseOwnership (::v8::Handle<::v8::Object > obj) |
| An utility function that extracts the C++ object from a wrapped object. More... | |
| void te::v8::common::Cache | ( | ::v8::Local<::v8::Object > & | obj, |
| const std::string & | methodName, | ||
| ::v8::Persistent<::v8::Function > & | outFtor | ||
| ) |
It caches the object method into the persistent output functor.
| obj | The object that must have a method called methodName. |
| methodName | The name of a method belonging to obj. |
| outFtor | A persistent function where the reference to the method will me cached. |
| Exception | It throws an exception if it can not find the method or something goes wrong. |
Definition at line 67 of file src/terralib/binding/v8/common/Utils.cpp.
References TR_V8COMMON.
Referenced by te::v8::plugin::PluginEngine::load().
|
inline |
It converts the input map to an object representing the associative conteiner.
| m | An input map to be converted to a JavsScript object. |
Definition at line 238 of file src/terralib/binding/v8/common/Utils.h.
Referenced by DataSource_Open(), DataSource_SetConnectionInfo(), and DataSourceManager_Open().
| inline ::v8::Local<::v8::Object> te::v8::common::Convert2Js | ( | const std::map< std::string, std::string > & | m | ) |
It converts the input map to an object representing the associative conteiner.
| m | An input map to be converted to a JavsScript object. |
Definition at line 209 of file src/terralib/binding/v8/common/Utils.h.
Referenced by DataSource_GetConnectionInfo().
| void te::v8::common::JsObjectRelease | ( | ::v8::Persistent<::v8::Value > | obj, |
| void * | parameter | ||
| ) |
The call-back function for releasing objects.
| obj | The object to be disposed. |
| parameter | The C++ pointer to be released. |
Definition at line 145 of file src/terralib/binding/v8/common/Utils.h.
References p.
|
inline |
An utility function that extracts the C++ object from a wrapped object.
| obj | The object holding the C++ pointer. |
Definition at line 128 of file src/terralib/binding/v8/common/Utils.h.
References te::v8::common::JsObject< T >::m_isOwner, and p.
|
inline |
It creates a new JavaScript object from a C++ object (obj).
The new object will have tfunc as its object template. If isOwner is true the JavaScript object will be the owner of the given C++ object pointer.
| obj | A valid pointer to a C++ object. |
| tfunc | A function with no arguments that returns the object template to be applied. |
| isOwner | If true when the JavaSript object goes out if the scope it automatically release the C++ object, otherwise, it doesn't. |
Definition at line 176 of file src/terralib/binding/v8/common/Utils.h.
Referenced by Coord2D_Constructor(), Curve_GetEndPoint(), Curve_GetStartPoint(), DataSet_GetType(), DataSource_GetCatalog(), DataSource_GetTransactor(), DataSourceCatalog_Clone(), DataSourceCatalog_Constructor(), DataSourceCatalog_GetDataSource(), DataSourceFactory_Make(), DataSourceManager_Find(), DataSourceManager_Make(), DataSourceManager_Open(), DataSourceTransactor_GetDataSet(), Envelope_Constructor(), ForeignKey_Clone(), Geometry_GetMBR(), te::v8::jsi::Geometry_Make(), GeometryCollection_Constructor(), LinearRing_Constructor(), LineString_Constructor(), LineString_GetCoordinates(), LineString_GetPointN(), MultiLineString_Constructor(), MultiPoint_Constructor(), MultiPolygon_Constructor(), MultiSurface_GetCentroid(), MultiSurface_GetCentroidCoord(), MultiSurface_GetCoordOnSurface(), MultiSurface_GetPointOnSurface(), Point_Constructor(), PointM_Constructor(), PointZ_Constructor(), PointZM_Constructor(), Polygon_Constructor(), Polygon_GetExteriorRing(), Polygon_GetInteriorRingN(), Polygon_GetRingN(), Polygon_GetRings(), PrimaryKey_Clone(), Surface_GetCentroid(), Surface_GetCentroidCoord(), Surface_GetCoordOnSurface(), Surface_GetPointOnSurface(), and UniqueKey_Clone().
| v8::Handle<::v8::Value > te::v8::common::Print | ( | const ::v8::Arguments & | args | ) |
This function will print all the arguments to the standard output.
| args | The arguments to be printed. |
Definition at line 84 of file src/terralib/binding/v8/common/Utils.cpp.
Referenced by te::v8::plugin::PluginEngine::load().
| v8::Handle<::v8::String > te::v8::common::ReadFile | ( | const std::string & | fileName | ) |
It reads a file into a v8 string.
| fileName | The name of the file to be read. |
| Exception | It throws an exception if it can not read the file. |
Definition at line 36 of file src/terralib/binding/v8/common/Utils.cpp.
References file(), te::core::CharEncoding::fromUTF8(), and TR_V8COMMON.
Referenced by te::v8::plugin::PluginEngine::load().
|
inline |
An utility function that extracts the C++ object from a wrapped object.
| obj | The object holding the C++ pointer. |
Definition at line 93 of file src/terralib/binding/v8/common/Utils.h.
References te::v8::common::JsObject< T >::m_handle, and p.
|
inline |
An utility function that extracts the C++ object from a wrapped object.
| obj | The object holding the C++ pointer. |
Definition at line 110 of file src/terralib/binding/v8/common/Utils.h.
References te::v8::common::JsObject< T >::m_handle, te::v8::common::JsObject< T >::m_isOwner, and p.