PreparedStatement.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 PreparedQuery.cpp
22 
23  \brief Utility functions to register the PreparedQuery class into Google JavaScript V8 engine.
24  */
25 
26 // TerraLib
27 #include "../../../../dataaccess/datasource/PreparedQuery.h"
28 #include "DataAccess.h"
29 
30 ::v8::Handle<::v8::Value> PreparedQuery_GetName(const ::v8::Arguments& args)
31 {
32  return ::v8::Undefined();
33 }
34 
35 ::v8::Handle<::v8::Value> PreparedQuery_Prepare(const ::v8::Arguments& args)
36 {
37  return ::v8::Undefined();
38 }
39 
40 ::v8::Handle<::v8::Value> PreparedQuery_Execute(const ::v8::Arguments& args)
41 {
42  return ::v8::Undefined();
43 }
44 
45 ::v8::Handle<::v8::Value> PreparedQuery_Query(const ::v8::Arguments& args)
46 {
47  return ::v8::Undefined();
48 }
49 
50 ::v8::Handle<::v8::Value> PreparedQuery_GetTransactor(const ::v8::Arguments& args)
51 {
52  return ::v8::Undefined();
53 }
54 
55 static ::v8::Persistent<::v8::FunctionTemplate> sds_preparedstatement_template;
56 
57 ::v8::Persistent<::v8::FunctionTemplate>& te::v8::jsi::GetPreparedQueryTemplate()
58 {
59  if(sds_preparedstatement_template.IsEmpty())
60  {
61  ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
62  ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
63 
64  prototype->Set(::v8::String::NewSymbol("getName"), ::v8::FunctionTemplate::New(PreparedQuery_GetName));
65  prototype->Set(::v8::String::NewSymbol("prepare"), ::v8::FunctionTemplate::New(PreparedQuery_Prepare));
66  prototype->Set(::v8::String::NewSymbol("execute"), ::v8::FunctionTemplate::New(PreparedQuery_Execute));
67  prototype->Set(::v8::String::NewSymbol("query"), ::v8::FunctionTemplate::New(PreparedQuery_Query));
68  prototype->Set(::v8::String::NewSymbol("getTransactor"), ::v8::FunctionTemplate::New(PreparedQuery_GetTransactor));
69 
70  sds_preparedstatement_template = ::v8::Persistent<::v8::FunctionTemplate>::New(result);
71  }
72 
74 }
75 
::v8::Handle<::v8::Value > PreparedQuery_GetTransactor(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > PreparedQuery_Execute(const ::v8::Arguments &args)
JavaScript exporting routine for the TerraLib Data Access module.
::v8::Handle<::v8::Value > PreparedQuery_GetName(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > PreparedQuery_Prepare(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > PreparedQuery_Query(const ::v8::Arguments &args)
static::v8::Persistent<::v8::FunctionTemplate > sds_preparedstatement_template
::v8::Persistent<::v8::FunctionTemplate > & GetPreparedQueryTemplate()
It returns a reference to the persistent template of a PreparedQuery object.