DdsJs/ddsjs_base.cpp
// From C++ to JavaScript for topic TopicQos
From C++ to JavaScript for topic TopicQos
From C ++ to JavaScript for topic TopicQos
Local<Value> TopicQosField::FromCppToJsValue(TopicQosField::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,
			TopicQosField::topic_dataFieldName
		),
		::DDS::TopicDataQosPolicyField::FromCppToJsValue(
			cppValue.topic_data
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::durabilityFieldName
		),
		::DDS::DurabilityQosPolicyField::FromCppToJsValue(
			cppValue.durability
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::durability_serviceFieldName
		),
		::DDS::DurabilityServiceQosPolicyField::FromCppToJsValue(
			cppValue.durability_service
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::deadlineFieldName
		),
		::DDS::DeadlineQosPolicyField::FromCppToJsValue(
			cppValue.deadline
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::latency_budgetFieldName
		),
		::DDS::LatencyBudgetQosPolicyField::FromCppToJsValue(
			cppValue.latency_budget
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::livelinessFieldName
		),
		::DDS::LivelinessQosPolicyField::FromCppToJsValue(
			cppValue.liveliness
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::reliabilityFieldName
		),
		::DDS::ReliabilityQosPolicyField::FromCppToJsValue(
			cppValue.reliability
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::destination_orderFieldName
		),
		::DDS::DestinationOrderQosPolicyField::FromCppToJsValue(
			cppValue.destination_order
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::historyFieldName
		),
		::DDS::HistoryQosPolicyField::FromCppToJsValue(
			cppValue.history
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::resource_limitsFieldName
		),
		::DDS::ResourceLimitsQosPolicyField::FromCppToJsValue(
			cppValue.resource_limits
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::transport_priorityFieldName
		),
		::DDS::TransportPriorityQosPolicyField::FromCppToJsValue(
			cppValue.transport_priority
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::lifespanFieldName
		),
		::DDS::LifespanQosPolicyField::FromCppToJsValue(
			cppValue.lifespan
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			TopicQosField::ownershipFieldName
		),
		::DDS::OwnershipQosPolicyField::FromCppToJsValue(
			cppValue.ownership
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}
	return scope.Escape(result);
}
Local < Value > TopicQosField :: FromCppToJsValue ( TopicQosField :: 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 , TopicQosField :: topic_dataFieldName ) , :: DDS :: TopicDataQosPolicyField :: FromCppToJsValue ( cppValue . topic_data ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: durabilityFieldName ) , :: DDS :: DurabilityQosPolicyField :: FromCppToJsValue ( cppValue . durability ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: durability_serviceFieldName ) , :: DDS :: DurabilityServiceQosPolicyField :: FromCppToJsValue ( cppValue . durability_service ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: deadlineFieldName ) , :: DDS :: DeadlineQosPolicyField :: FromCppToJsValue ( cppValue . deadline ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: latency_budgetFieldName ) , :: DDS :: LatencyBudgetQosPolicyField :: FromCppToJsValue ( cppValue . latency_budget ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: livelinessFieldName ) , :: DDS :: LivelinessQosPolicyField :: FromCppToJsValue ( cppValue . liveliness ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: reliabilityFieldName ) , :: DDS :: ReliabilityQosPolicyField :: FromCppToJsValue ( cppValue . reliability ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: destination_orderFieldName ) , :: DDS :: DestinationOrderQosPolicyField :: FromCppToJsValue ( cppValue . destination_order ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: historyFieldName ) , :: DDS :: HistoryQosPolicyField :: FromCppToJsValue ( cppValue . history ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: resource_limitsFieldName ) , :: DDS :: ResourceLimitsQosPolicyField :: FromCppToJsValue ( cppValue . resource_limits ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: transport_priorityFieldName ) , :: DDS :: TransportPriorityQosPolicyField :: FromCppToJsValue ( cppValue . transport_priority ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: lifespanFieldName ) , :: DDS :: LifespanQosPolicyField :: FromCppToJsValue ( cppValue . lifespan ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , TopicQosField :: ownershipFieldName ) , :: DDS :: OwnershipQosPolicyField :: FromCppToJsValue ( cppValue . ownership ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } return scope . Escape ( result ) ; }
From C++ to JavaScript for topic TopicQos
From C ++ to JavaScript for topic TopicQos
// TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception