binding/v8/jsi/dataaccess/Property.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file Property.cpp
22 
23  \brief Utility functions to register the Property class into the Google JavaScript V8 engine.
24  */
25 
26 // TerraLib
27 #include "../../../../dataaccess/property/Property.h"
28 #include "../../common/Utils.h"
29 #include "DataAccess.h"
30 
31 // Boost
32 #include <boost/cstdint.hpp>
33 
34 ::v8::Handle<::v8::Value> Property_GetId(const ::v8::Arguments& args)
35 {
36  return ::v8::Undefined();
37 }
38 
39 ::v8::Handle<::v8::Value> Property_SetId(const ::v8::Arguments& args)
40 {
41  return ::v8::Undefined();
42 }
43 
44 ::v8::Handle<::v8::Value> Property_GetName(const ::v8::Arguments& args)
45 {
46  return ::v8::Undefined();
47 }
48 
49 ::v8::Handle<::v8::Value> Property_SetName(const ::v8::Arguments& args)
50 {
51  return ::v8::Undefined();
52 }
53 
54 ::v8::Handle<::v8::Value> Property_GetType(const ::v8::Arguments& args)
55 {
56  return ::v8::Undefined();
57 }
58 
59 ::v8::Handle<::v8::Value> Property_GetParent(const ::v8::Arguments& args)
60 {
61  return ::v8::Undefined();
62 }
63 
64 ::v8::Handle<::v8::Value> Property_SetParent(const ::v8::Arguments& args)
65 {
66  return ::v8::Undefined();
67 }
68 
69 ::v8::Handle<::v8::Value> Property_Has(const ::v8::Arguments& args)
70 {
71  return ::v8::Undefined();
72 }
73 
74 ::v8::Handle<::v8::Value> Property_Clone(const ::v8::Arguments& args)
75 {
76  return ::v8::Undefined();
77 }
78 
79 ::v8::Handle<::v8::Value> Property_Constructor(const ::v8::Arguments& args)
80 {
81  return ::v8::Undefined();
82 }
83 
84 void te::v8::jsi::RegisterProperty(::v8::Local<::v8::Object>& global)
85 {
86  ::v8::Local<::v8::FunctionTemplate> jproperty = ::v8::FunctionTemplate::New(Property_Constructor);
87 
88  global->Set(::v8::String::New("TeProperty"), jproperty->GetFunction());
89 }
90 
91 static ::v8::Persistent<::v8::FunctionTemplate> sproperty_property_template;
92 
93 ::v8::Persistent<::v8::FunctionTemplate>& te::v8::jsi::GetPropertyTemplate()
94 {
95  if(sproperty_property_template.IsEmpty())
96  {
97  ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
98  ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
99 
100  prototype->Set(::v8::String::NewSymbol("getId"), ::v8::FunctionTemplate::New(Property_GetId));
101  prototype->Set(::v8::String::NewSymbol("setId"), ::v8::FunctionTemplate::New(Property_SetId));
102  prototype->Set(::v8::String::NewSymbol("getName"), ::v8::FunctionTemplate::New(Property_GetName));
103  prototype->Set(::v8::String::NewSymbol("setName"), ::v8::FunctionTemplate::New(Property_SetName));
104  prototype->Set(::v8::String::NewSymbol("getType"), ::v8::FunctionTemplate::New(Property_GetType));
105  prototype->Set(::v8::String::NewSymbol("getParent"), ::v8::FunctionTemplate::New(Property_GetParent));
106  prototype->Set(::v8::String::NewSymbol("setParent"), ::v8::FunctionTemplate::New(Property_SetParent));
107  prototype->Set(::v8::String::NewSymbol("has"), ::v8::FunctionTemplate::New(Property_Has));
108  prototype->Set(::v8::String::NewSymbol("clone"), ::v8::FunctionTemplate::New(Property_Clone));
109 
110  sproperty_property_template = ::v8::Persistent<::v8::FunctionTemplate>::New(result);
111  }
112 
114 }
::v8::Handle<::v8::Value > Property_GetType(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > Property_SetId(const ::v8::Arguments &args)
void RegisterProperty(::v8::Local<::v8::Object > &global)
It registers the Property class.
::v8::Handle<::v8::Value > Property_Has(const ::v8::Arguments &args)
JavaScript exporting routine for the TerraLib Data Access module.
::v8::Handle<::v8::Value > Property_SetParent(const ::v8::Arguments &args)
static::v8::Persistent<::v8::FunctionTemplate > sproperty_property_template
::v8::Handle<::v8::Value > Property_Clone(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > Property_GetId(const ::v8::Arguments &args)
::v8::Persistent<::v8::FunctionTemplate > & GetPropertyTemplate()
It returns a reference to the persistent template of a Property object.
::v8::Handle<::v8::Value > Property_GetName(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > Property_SetName(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > Property_Constructor(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > Property_GetParent(const ::v8::Arguments &args)