DdsJs/ddsjs_base.cpp
// From C++ to JavaScript for topic Duration_t
From C++ to JavaScript for topic Duration_t
From C ++ to JavaScript for topic Duration_t
Local<Value> Duration_tField::FromCppToJsValue(Duration_tField::ConstRefType cppValue)
{
	Isolate *isolate = Isolate::GetCurrent();
	EscapableHandleScope scope(isolate);
	Local<Object> result(Object::New(isolate));
	Local<Context> ctx = Local<Context>::New(isolate, isolate->GetCurrentContext());
	Maybe< bool > setResult = ::v8::Nothing< bool >();
	setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			Duration_tField::secFieldName
		),
		::DdsJs::LongField::FromCppToJsValue(
			cppValue.sec
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			Duration_tField::nanosecFieldName
		),
		::DdsJs::UnsignedLongField::FromCppToJsValue(
			cppValue.nanosec
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}
	return scope.Escape(result);
}
Local < Value > Duration_tField :: FromCppToJsValue ( Duration_tField :: ConstRefType cppValue ) { Isolate * isolate = Isolate :: GetCurrent ( ) ; EscapableHandleScope scope ( isolate ) ; Local < Object > result ( Object :: New ( isolate ) ) ; Local < Context > ctx = Local < Context > :: New ( isolate , isolate -> GetCurrentContext ( ) ) ; Maybe < bool > setResult = :: v8 :: Nothing < bool > ( ) ; setResult = result -> Set ( ctx , Local < String > :: New ( isolate , Duration_tField :: secFieldName ) , :: DdsJs :: LongField :: FromCppToJsValue ( cppValue . sec ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , Duration_tField :: nanosecFieldName ) , :: DdsJs :: UnsignedLongField :: FromCppToJsValue ( cppValue . nanosec ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } return scope . Escape ( result ) ; }
From C++ to JavaScript for topic Duration_t
From C ++ to JavaScript for topic Duration_t
// TODO: throw exception // TODO: throw exception