binding/v8/jsi/dataaccess/CompositeProperty.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 CompositeProperty.cpp
22 
23  \brief Utility functions to register the CompositeProperty class into the Google JavaScript V8 engine.
24  */
25 
26 // TerraLib
27 #include "../../../../dataaccess/property/CompositeProperty.h"
28 #include "../../common/Utils.h"
29 #include "DataAccess.h"
30 
31 // Boost
32 #include <boost/cstdint.hpp>
33 
34 ::v8::Handle<::v8::Value> CompositeProperty_GetCompositeName(const ::v8::Arguments& /*args*/)
35 {
36  return ::v8::Undefined();
37 }
38 
39 ::v8::Handle<::v8::Value> CompositeProperty_SetCompositeName(const ::v8::Arguments& /*args*/)
40 {
41  return ::v8::Undefined();
42 }
43 
44 ::v8::Handle<::v8::Value> CompositeProperty_Add(const ::v8::Arguments& /*args*/)
45 {
46  return ::v8::Undefined();
47 }
48 
49 ::v8::Handle<::v8::Value> CompositeProperty_Remove(const ::v8::Arguments& /*args*/)
50 {
51  return ::v8::Undefined();
52 }
53 
54 ::v8::Handle<::v8::Value> CompositeProperty_GetProperties(const ::v8::Arguments& /*args*/)
55 {
56  return ::v8::Undefined();
57 }
58 
59 ::v8::Handle<::v8::Value> CompositeProperty_Size(const ::v8::Arguments& /*args*/)
60 {
61  return ::v8::Undefined();
62 }
63 
64 ::v8::Handle<::v8::Value> CompositeProperty_GetProperty(const ::v8::Arguments& /*args*/)
65 {
66  return ::v8::Undefined();
67 }
68 
69 ::v8::Handle<::v8::Value> CompositeProperty_GetPropertyPosition(const ::v8::Arguments& /*args*/)
70 {
71  return ::v8::Undefined();
72 }
73 
74 ::v8::Handle<::v8::Value> CompositeProperty_GetPropertyById(const ::v8::Arguments& /*args*/)
75 {
76  return ::v8::Undefined();
77 }
78 
79 ::v8::Handle<::v8::Value> CompositeProperty_Copy(const ::v8::Arguments& /*args*/)
80 {
81  return ::v8::Undefined();
82 }
83 
84 ::v8::Handle<::v8::Value> CompositeProperty_Clear(const ::v8::Arguments& /*args*/)
85 {
86  return ::v8::Undefined();
87 }
88 
89 ::v8::Handle<::v8::Value> CompositeProperty_Constructor(const ::v8::Arguments& /*args*/)
90 {
91  return ::v8::Undefined();
92 }
93 
94 void te::v8::jsi::RegisterCompositeProperty(::v8::Local<::v8::Object>& global)
95 {
96  ::v8::Local<::v8::FunctionTemplate> jcompositeproperty = ::v8::FunctionTemplate::New(CompositeProperty_Constructor);
97 
98  global->Set(::v8::String::New("TeCompositeProperty"), jcompositeproperty->GetFunction());
99 }
100 
101 static ::v8::Persistent<::v8::FunctionTemplate> sg_compositeproperty_template;
102 
103 ::v8::Persistent<::v8::FunctionTemplate>& te::v8::jsi::GetCompositePropertyTemplate()
104 {
105  if(sg_compositeproperty_template.IsEmpty())
106  {
107  ::v8::Persistent<::v8::FunctionTemplate>& propertyTpl = GetPropertyTemplate();
108  ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
109  result->Inherit(propertyTpl);
110 
111  ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
112 
113  prototype->Set(::v8::String::NewSymbol("getCompositeName"), ::v8::FunctionTemplate::New(CompositeProperty_GetCompositeName));
114  prototype->Set(::v8::String::NewSymbol("setCompositeName"), ::v8::FunctionTemplate::New(CompositeProperty_SetCompositeName));
115  prototype->Set(::v8::String::NewSymbol("add"), ::v8::FunctionTemplate::New(CompositeProperty_Add));
116  prototype->Set(::v8::String::NewSymbol("remove"), ::v8::FunctionTemplate::New(CompositeProperty_Remove));
117  prototype->Set(::v8::String::NewSymbol("getProperties"), ::v8::FunctionTemplate::New(CompositeProperty_GetProperties));
118  prototype->Set(::v8::String::NewSymbol("size"), ::v8::FunctionTemplate::New(CompositeProperty_Size));
119  prototype->Set(::v8::String::NewSymbol("getProperty"), ::v8::FunctionTemplate::New(CompositeProperty_GetProperty));
120  prototype->Set(::v8::String::NewSymbol("getPropertyPosition"), ::v8::FunctionTemplate::New(CompositeProperty_GetPropertyPosition));
121  prototype->Set(::v8::String::NewSymbol("getPropertyById"), ::v8::FunctionTemplate::New(CompositeProperty_GetPropertyById));
122  prototype->Set(::v8::String::NewSymbol("copy"), ::v8::FunctionTemplate::New(CompositeProperty_Copy));
123  prototype->Set(::v8::String::NewSymbol("clear"), ::v8::FunctionTemplate::New(CompositeProperty_Clear));
124 
125  sg_compositeproperty_template = ::v8::Persistent<::v8::FunctionTemplate>::New(result);
126  }
127 
129 }
::v8::Handle<::v8::Value > CompositeProperty_GetProperties(const ::v8::Arguments &)
JavaScript exporting routine for the TerraLib Data Access module.
::v8::Handle<::v8::Value > CompositeProperty_Constructor(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_GetProperty(const ::v8::Arguments &)
void RegisterCompositeProperty(::v8::Local<::v8::Object > &global)
It registers the CompositeProperty class.
::v8::Handle<::v8::Value > CompositeProperty_Remove(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_Add(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_Size(const ::v8::Arguments &)
static::v8::Persistent<::v8::FunctionTemplate > sg_compositeproperty_template
::v8::Handle<::v8::Value > CompositeProperty_SetCompositeName(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_Clear(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_GetPropertyById(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetPropertyTemplate()
It returns a reference to the persistent template of a Property object.
::v8::Handle<::v8::Value > CompositeProperty_GetPropertyPosition(const ::v8::Arguments &)
::v8::Handle<::v8::Value > CompositeProperty_GetCompositeName(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetCompositePropertyTemplate()
It returns a reference to the persistent template of a CompositeProperty object.
::v8::Handle<::v8::Value > CompositeProperty_Copy(const ::v8::Arguments &)