27 #include "../../../../common/Exception.h" 28 #include "../../../../core/translator/Translator.h" 29 #include "../../../../dataaccess/dataset/DataSet.h" 30 #include "../../../../dataaccess/dataset/DataSetType.h" 31 #include "../../../../geometry/Geometry.h" 32 #include "../../common/Utils.h" 33 #include "../datatype/DataType.h" 34 #include "../geometry/Geometry.h" 41 #include <boost/cstdint.hpp> 47 return ::v8::Undefined();
53 return ::v8::Undefined();
60 if(args.Holder().IsEmpty())
61 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"In order to use the getType method you must use the object notation: \"dt = dataset.getType();\"")));
66 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Invalid dataset in getType method!")));
72 return hs.Close(jsdt);
74 catch(
const std::exception& e)
76 return ::v8::ThrowException(::v8::String::New(e.what()));
80 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Unexpected exception in getType method!")));
87 return ::v8::Undefined();
93 return ::v8::Undefined();
99 return ::v8::Undefined();
104 ::v8::HandleScope hs;
105 return ::v8::Undefined();
110 ::v8::HandleScope hs;
111 return ::v8::Undefined();
116 ::v8::HandleScope hs;
117 return ::v8::Undefined();
122 ::v8::HandleScope hs;
123 return ::v8::Undefined();
128 ::v8::HandleScope hs;
129 return ::v8::Undefined();
134 ::v8::HandleScope hs;
135 return ::v8::Undefined();
140 ::v8::HandleScope hs;
142 if(args.Holder().IsEmpty())
143 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"In order to use the moveNext method you must use the object notation: \"result = dataset.moveNext();\"")));
145 te::da::DataSet*
d = te::v8::common::Unwrap<te::da::DataSet>(args.Holder());
148 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Invalid dataset in moveNext method!")));
153 ::v8::Handle<::v8::Boolean> jsresult = ::v8::Boolean::New(result);
154 return hs.Close(jsresult);
156 catch(
const std::exception& e)
158 return ::v8::ThrowException(::v8::String::New(e.what()));
162 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Unexpected exception in moveNext method!")));
168 ::v8::HandleScope hs;
169 return ::v8::Undefined();
174 ::v8::HandleScope hs;
175 return ::v8::Undefined();
180 ::v8::HandleScope hs;
181 return ::v8::Undefined();
186 ::v8::HandleScope hs;
187 return ::v8::Undefined();
192 ::v8::HandleScope hs;
193 return ::v8::Undefined();
198 ::v8::HandleScope hs;
199 return ::v8::Undefined();
204 ::v8::HandleScope hs;
205 return ::v8::Undefined();
210 ::v8::HandleScope hs;
211 return ::v8::Undefined();
216 ::v8::HandleScope hs;
217 return ::v8::Undefined();
222 ::v8::HandleScope hs;
223 return ::v8::Undefined();
228 ::v8::HandleScope hs;
229 return ::v8::Undefined();
234 ::v8::HandleScope hs;
235 return ::v8::Undefined();
240 ::v8::HandleScope hs;
241 return ::v8::Undefined();
246 ::v8::HandleScope hs;
247 return ::v8::Undefined();
252 ::v8::HandleScope hs;
253 return ::v8::Undefined();
258 ::v8::HandleScope hs;
259 return ::v8::Undefined();
264 ::v8::HandleScope hs;
265 return ::v8::Undefined();
270 ::v8::HandleScope hs;
271 return ::v8::Undefined();
276 ::v8::HandleScope hs;
277 return ::v8::Undefined();
282 ::v8::HandleScope hs;
283 return ::v8::Undefined();
288 ::v8::HandleScope hs;
289 return ::v8::Undefined();
294 ::v8::HandleScope hs;
295 return ::v8::Undefined();
300 ::v8::HandleScope hs;
301 return ::v8::Undefined();
306 ::v8::HandleScope hs;
307 return ::v8::Undefined();
312 ::v8::HandleScope hs;
313 return ::v8::Undefined();
318 ::v8::HandleScope hs;
319 return ::v8::Undefined();
324 ::v8::HandleScope hs;
325 return ::v8::Undefined();
330 ::v8::HandleScope hs;
331 return ::v8::Undefined();
336 ::v8::HandleScope hs;
337 return ::v8::Undefined();
342 ::v8::HandleScope hs;
343 return ::v8::Undefined();
348 ::v8::HandleScope hs;
349 return ::v8::Undefined();
354 ::v8::HandleScope hs;
355 return ::v8::Undefined();
360 ::v8::HandleScope hs;
362 if(args.Holder().IsEmpty())
363 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"In order to use the getGeometry method you must use the object notation: \"geom = obj.getGeometry(i);\"")));
365 if(args.Length() != 1 || args[0].IsEmpty())
366 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Wrong parameters in getGeometry method!")));
368 te::da::DataSet*
d = te::v8::common::Unwrap<te::da::DataSet>(args.Holder());
371 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Invalid dataset in getGeometry method!")));
375 if(args[0]->IsInt32())
377 int col = args[0]->ToInt32()->Value();
378 std::auto_ptr<te::gm::Geometry> geom(d->
getGeometry(col));
381 return hs.Close(jsgeom);
383 else if(args[0]->IsString())
385 v8::String::Utf8Value jscolname(args[0]->
ToString());
386 std::auto_ptr<te::gm::Geometry> geom(d->
getGeometry(*jscolname));
389 return hs.Close(jsgeom);
392 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Wrong parameter in getGeometry method!")));
394 catch(
const std::exception& e)
396 return ::v8::ThrowException(::v8::String::New(e.what()));
400 return ::v8::ThrowException(::v8::String::New(
TR_V8JSI(
"Unexpected exception in getDataSet method!")));
406 ::v8::HandleScope hs;
407 return ::v8::Undefined();
412 ::v8::HandleScope hs;
413 return ::v8::Undefined();
418 ::v8::HandleScope hs;
419 return ::v8::Undefined();
424 ::v8::HandleScope hs;
425 return ::v8::Undefined();
430 ::v8::HandleScope hs;
431 return ::v8::Undefined();
436 ::v8::HandleScope hs;
437 return ::v8::Undefined();
442 ::v8::HandleScope hs;
443 return ::v8::Undefined();
448 ::v8::HandleScope hs;
449 return ::v8::Undefined();
454 ::v8::HandleScope hs;
455 return ::v8::Undefined();
460 ::v8::HandleScope hs;
461 return ::v8::Undefined();
466 ::v8::HandleScope hs;
467 return ::v8::Undefined();
472 ::v8::HandleScope hs;
473 return ::v8::Undefined();
478 ::v8::HandleScope hs;
479 return ::v8::Undefined();
489 ::v8::Local<::v8::FunctionTemplate> result = ::v8::FunctionTemplate::New();
490 result->Inherit(abstractDataTpl);
492 ::v8::Handle<::v8::ObjectTemplate> prototype = result->PrototypeTemplate();
494 prototype->Set(::v8::String::NewSymbol(
"getTraverseType"), ::v8::FunctionTemplate::New(
DataSet_GetTraverseType));
495 prototype->Set(::v8::String::NewSymbol(
"getAccessPolicy"), ::v8::FunctionTemplate::New(
DataSet_GetAccessPolicy));
496 prototype->Set(::v8::String::NewSymbol(
"getType"), ::v8::FunctionTemplate::New(
DataSet_GetType));
497 prototype->Set(::v8::String::NewSymbol(
"getTransactor"), ::v8::FunctionTemplate::New(
DataSet_GetTransactor));
498 prototype->Set(::v8::String::NewSymbol(
"loadTypeInfo"), ::v8::FunctionTemplate::New(
DataSet_LoadTypeInfo));
499 prototype->Set(::v8::String::NewSymbol(
"getParent"), ::v8::FunctionTemplate::New(
DataSet_GetParent));
500 prototype->Set(::v8::String::NewSymbol(
"getExtent"), ::v8::FunctionTemplate::New(
DataSet_GetExtent));
501 prototype->Set(::v8::String::NewSymbol(
"setFilter"), ::v8::FunctionTemplate::New(
DataSet_SetFilter));
502 prototype->Set(::v8::String::NewSymbol(
"getItem"), ::v8::FunctionTemplate::New(
DataSet_GetItem));
503 prototype->Set(::v8::String::NewSymbol(
"add"), ::v8::FunctionTemplate::New(
DataSet_Add));
504 prototype->Set(::v8::String::NewSymbol(
"isEmpty"), ::v8::FunctionTemplate::New(
DataSet_IsEmpty));
505 prototype->Set(::v8::String::NewSymbol(
"size"), ::v8::FunctionTemplate::New(
DataSet_Size));
506 prototype->Set(::v8::String::NewSymbol(
"moveNext"), ::v8::FunctionTemplate::New(
DataSet_MoveNext));
507 prototype->Set(::v8::String::NewSymbol(
"movePrevious"), ::v8::FunctionTemplate::New(
DataSet_MovePrevious));
508 prototype->Set(::v8::String::NewSymbol(
"moveFirst"), ::v8::FunctionTemplate::New(
DataSet_MoveFirst));
509 prototype->Set(::v8::String::NewSymbol(
"moveBeforeFirst"), ::v8::FunctionTemplate::New(
DataSet_MoveBeforeFirst));
510 prototype->Set(::v8::String::NewSymbol(
"moveLast"), ::v8::FunctionTemplate::New(
DataSet_MoveLast));
511 prototype->Set(::v8::String::NewSymbol(
"moveAfterLast"), ::v8::FunctionTemplate::New(
DataSet_MoveAfterLast));
512 prototype->Set(::v8::String::NewSymbol(
"move"), ::v8::FunctionTemplate::New(
DataSet_Move));
513 prototype->Set(::v8::String::NewSymbol(
"isAtBegin"), ::v8::FunctionTemplate::New(
DataSet_IsAtBegin));
514 prototype->Set(::v8::String::NewSymbol(
"isBeforeBegin"), ::v8::FunctionTemplate::New(
DataSet_IsBeforeBegin));
515 prototype->Set(::v8::String::NewSymbol(
"isAtEnd"), ::v8::FunctionTemplate::New(
DataSet_IsAtEnd));
516 prototype->Set(::v8::String::NewSymbol(
"isAfterLast"), ::v8::FunctionTemplate::New(
DataSet_IsAfterLast));
517 prototype->Set(::v8::String::NewSymbol(
"getChar"), ::v8::FunctionTemplate::New(
DataSet_GetChar));
518 prototype->Set(::v8::String::NewSymbol(
"setChar"), ::v8::FunctionTemplate::New(
DataSet_SetChar));
519 prototype->Set(::v8::String::NewSymbol(
"getUChar"), ::v8::FunctionTemplate::New(
DataSet_GetUChar));
520 prototype->Set(::v8::String::NewSymbol(
"setUChar"), ::v8::FunctionTemplate::New(
DataSet_SetUChar));
521 prototype->Set(::v8::String::NewSymbol(
"getInt16"), ::v8::FunctionTemplate::New(
DataSet_GetInt16));
522 prototype->Set(::v8::String::NewSymbol(
"setInt16"), ::v8::FunctionTemplate::New(
DataSet_SetInt16));
523 prototype->Set(::v8::String::NewSymbol(
"getInt32"), ::v8::FunctionTemplate::New(
DataSet_GetInt32));
524 prototype->Set(::v8::String::NewSymbol(
"setInt32"), ::v8::FunctionTemplate::New(
DataSet_SetInt32));
525 prototype->Set(::v8::String::NewSymbol(
"getInt64"), ::v8::FunctionTemplate::New(
DataSet_GetInt64));
526 prototype->Set(::v8::String::NewSymbol(
"setInt64"), ::v8::FunctionTemplate::New(
DataSet_SetInt64));
527 prototype->Set(::v8::String::NewSymbol(
"getBool"), ::v8::FunctionTemplate::New(
DataSet_GetBool));
528 prototype->Set(::v8::String::NewSymbol(
"setBool"), ::v8::FunctionTemplate::New(
DataSet_SetBool));
529 prototype->Set(::v8::String::NewSymbol(
"getFloat"), ::v8::FunctionTemplate::New(
DataSet_GetFloat));
530 prototype->Set(::v8::String::NewSymbol(
"setFloat"), ::v8::FunctionTemplate::New(
DataSet_SetFloat));
531 prototype->Set(::v8::String::NewSymbol(
"getDouble"), ::v8::FunctionTemplate::New(
DataSet_GetDouble));
532 prototype->Set(::v8::String::NewSymbol(
"setDouble"), ::v8::FunctionTemplate::New(
DataSet_SetDouble));
533 prototype->Set(::v8::String::NewSymbol(
"getNumeric"), ::v8::FunctionTemplate::New(
DataSet_GetNumeric));
534 prototype->Set(::v8::String::NewSymbol(
"setNumeric"), ::v8::FunctionTemplate::New(
DataSet_SetNumeric));
535 prototype->Set(::v8::String::NewSymbol(
"getString"), ::v8::FunctionTemplate::New(
DataSet_GetString));
536 prototype->Set(::v8::String::NewSymbol(
"setString"), ::v8::FunctionTemplate::New(
DataSet_SetString));
537 prototype->Set(::v8::String::NewSymbol(
"getByteArray"), ::v8::FunctionTemplate::New(
DataSet_GetByteArray));
538 prototype->Set(::v8::String::NewSymbol(
"setByteArray"), ::v8::FunctionTemplate::New(
DataSet_SetByteArray));
539 prototype->Set(::v8::String::NewSymbol(
"getGeometry"), ::v8::FunctionTemplate::New(
DataSet_GetGeometry));
540 prototype->Set(::v8::String::NewSymbol(
"setGeometry"), ::v8::FunctionTemplate::New(
DataSet_SetGeometry));
541 prototype->Set(::v8::String::NewSymbol(
"getRaster"), ::v8::FunctionTemplate::New(
DataSet_GetRaster));
542 prototype->Set(::v8::String::NewSymbol(
"setRaster"), ::v8::FunctionTemplate::New(
DataSet_SetRaster));
543 prototype->Set(::v8::String::NewSymbol(
"getDateTime"), ::v8::FunctionTemplate::New(
DataSet_GetDateTime));
544 prototype->Set(::v8::String::NewSymbol(
"setDateTime"), ::v8::FunctionTemplate::New(
DataSet_SetDateTime));
545 prototype->Set(::v8::String::NewSymbol(
"getArray"), ::v8::FunctionTemplate::New(
DataSet_GetArray));
546 prototype->Set(::v8::String::NewSymbol(
"getWKB"), ::v8::FunctionTemplate::New(
DataSet_GetWKB));
547 prototype->Set(::v8::String::NewSymbol(
"getDataSet"), ::v8::FunctionTemplate::New(
DataSet_GetDataSet));
548 prototype->Set(::v8::String::NewSymbol(
"setDataSet"), ::v8::FunctionTemplate::New(
DataSet_SetDataSet));
549 prototype->Set(::v8::String::NewSymbol(
"getValue"), ::v8::FunctionTemplate::New(
DataSet_GetValue));
550 prototype->Set(::v8::String::NewSymbol(
"setValue"), ::v8::FunctionTemplate::New(
DataSet_SetValue));
551 prototype->Set(::v8::String::NewSymbol(
"getAsString"), ::v8::FunctionTemplate::New(
DataSet_GetAsString));
552 prototype->Set(::v8::String::NewSymbol(
"isNull"), ::v8::FunctionTemplate::New(
DataSet_IsNull));
::v8::Handle<::v8::Value > DataSet_Add(const ::v8::Arguments &)
virtual std::unique_ptr< te::gm::Geometry > getGeometry(std::size_t i) const =0
Method for retrieving a geometric attribute value.
::v8::Local<::v8::Object > Make(T *obj, TF tfunc, const bool isOwner)
It creates a new JavaScript object from a C++ object (obj).
::v8::Handle<::v8::Value > DataSet_SetInt32(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_MoveNext(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > DataSet_GetFloat(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetBool(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_MoveBeforeFirst(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetNumeric(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_IsNull(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_Move(const ::v8::Arguments &)
A class that models the description of a dataset.
::v8::Handle<::v8::Value > DataSet_IsAtEnd(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetChar(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetBool(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_MoveAfterLast(const ::v8::Arguments &)
JavaScript exporting routine for the TerraLib Data Access module.
::v8::Handle<::v8::Value > DataSet_GetInt64(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetDateTime(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetFloat(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_MoveFirst(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetInt16(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetAccessPolicy(const ::v8::Arguments &)
virtual bool moveNext()=0
It moves the internal pointer to the next item of the collection.
::v8::Handle<::v8::Value > DataSet_SetGeometry(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetItem(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetRaster(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetNumeric(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetWKB(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetTransactor(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetType(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > DataSet_SetFilter(const ::v8::Arguments &)
static te::dt::DateTime d(2010, 8, 9, 15, 58, 39)
static te::dt::TimeDuration dt(20, 30, 50, 11)
::v8::Handle<::v8::Value > DataSet_SetDouble(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetString(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetParent(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetTraverseType(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetByteArray(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetDouble(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetInt16(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetAbstractDataTemplate()
It returns a reference to the persistent template of an AbstractData object.
::v8::Handle<::v8::Value > DataSet_LoadTypeInfo(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_IsAfterLast(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetUChar(const ::v8::Arguments &)
::v8::Persistent<::v8::FunctionTemplate > & GetDataSetTemplate()
It returns a reference to the persistent template of a DataSet object.
::v8::Handle<::v8::Value > DataSet_GetByteArray(const ::v8::Arguments &)
A dataset is the unit of information manipulated by the data access module of TerraLib.
::v8::Handle<::v8::Value > DataSet_IsEmpty(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetDataSet(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetValue(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetArray(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetDataSet(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetGeometry(const ::v8::Arguments &args)
::v8::Handle<::v8::Value > DataSet_GetExtent(const ::v8::Arguments &)
::v8::Local<::v8::Object > Geometry_Make(te::gm::Geometry *g, const bool isOwner)
Given a C++ geometry this function creates a new JavaScript geometry cast to the right geometry subty...
::v8::Handle<::v8::Value > DataSet_MoveLast(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetUChar(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetAsString(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetInt32(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetDateTime(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_IsAtBegin(const ::v8::Arguments &)
static::v8::Persistent<::v8::FunctionTemplate > sg_dataset_template
::v8::Persistent<::v8::FunctionTemplate > & GetDataSetTypeTemplate()
It returns a reference to the persistent template of a DataSetType object.
::v8::Handle<::v8::Value > DataSet_GetRaster(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_SetInt64(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetChar(const ::v8::Arguments &)
#define TR_V8JSI(message)
It marks a string in order to get translated. This is a special mark used in the Vector Geometry modu...
::v8::Handle<::v8::Value > DataSet_Size(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_MovePrevious(const ::v8::Arguments &)
std::string ToString(const XMLCh *const value)
It converts the XML string to a standard C++ string.
::v8::Handle<::v8::Value > DataSet_GetString(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_IsBeforeBegin(const ::v8::Arguments &)
::v8::Handle<::v8::Value > DataSet_GetValue(const ::v8::Arguments &)