DdsJs/ddsjs_base.cpp
// From C++ to JavaScript for topic PublicationBuiltinTopicData
From C++ to JavaScript for topic PublicationBuiltinTopicData
From C ++ to JavaScript for topic PublicationBuiltinTopicData
Local<Value> PublicationBuiltinTopicDataField::FromCppToJsValue(PublicationBuiltinTopicDataField::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,
			PublicationBuiltinTopicDataField::keyFieldName
		),
		::DDS::BuiltinTopicKey_tField::FromCppToJsValue(
			cppValue.key
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::participant_keyFieldName
		),
		::DDS::BuiltinTopicKey_tField::FromCppToJsValue(
			cppValue.participant_key
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::topic_nameFieldName
		),
		::DdsJs::UnboundedStringField::FromCppToJsValue(
			cppValue.topic_name
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::type_nameFieldName
		),
		::DdsJs::UnboundedStringField::FromCppToJsValue(
			cppValue.type_name
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::durabilityFieldName
		),
		::DDS::DurabilityQosPolicyField::FromCppToJsValue(
			cppValue.durability
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::durability_serviceFieldName
		),
		::DDS::DurabilityServiceQosPolicyField::FromCppToJsValue(
			cppValue.durability_service
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::deadlineFieldName
		),
		::DDS::DeadlineQosPolicyField::FromCppToJsValue(
			cppValue.deadline
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::latency_budgetFieldName
		),
		::DDS::LatencyBudgetQosPolicyField::FromCppToJsValue(
			cppValue.latency_budget
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::livelinessFieldName
		),
		::DDS::LivelinessQosPolicyField::FromCppToJsValue(
			cppValue.liveliness
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::reliabilityFieldName
		),
		::DDS::ReliabilityQosPolicyField::FromCppToJsValue(
			cppValue.reliability
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::lifespanFieldName
		),
		::DDS::LifespanQosPolicyField::FromCppToJsValue(
			cppValue.lifespan
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::user_dataFieldName
		),
		::DDS::UserDataQosPolicyField::FromCppToJsValue(
			cppValue.user_data
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::ownershipFieldName
		),
		::DDS::OwnershipQosPolicyField::FromCppToJsValue(
			cppValue.ownership
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::ownership_strengthFieldName
		),
		::DDS::OwnershipStrengthQosPolicyField::FromCppToJsValue(
			cppValue.ownership_strength
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::destination_orderFieldName
		),
		::DDS::DestinationOrderQosPolicyField::FromCppToJsValue(
			cppValue.destination_order
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::presentationFieldName
		),
		::DDS::PresentationQosPolicyField::FromCppToJsValue(
			cppValue.presentation
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::partitionFieldName
		),
		::DDS::PartitionQosPolicyField::FromCppToJsValue(
			cppValue.partition
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::topic_dataFieldName
		),
		::DDS::TopicDataQosPolicyField::FromCppToJsValue(
			cppValue.topic_data
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}setResult = result->Set(
		ctx,
		Local<String>::New(
			isolate,
			PublicationBuiltinTopicDataField::group_dataFieldName
		),
		::DDS::GroupDataQosPolicyField::FromCppToJsValue(
			cppValue.group_data
		)
	);
	if (!setResult.FromMaybe(false))
	{
	}
	return scope.Escape(result);
}
Local < Value > PublicationBuiltinTopicDataField :: FromCppToJsValue ( PublicationBuiltinTopicDataField :: 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 , PublicationBuiltinTopicDataField :: keyFieldName ) , :: DDS :: BuiltinTopicKey_tField :: FromCppToJsValue ( cppValue . key ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: participant_keyFieldName ) , :: DDS :: BuiltinTopicKey_tField :: FromCppToJsValue ( cppValue . participant_key ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: topic_nameFieldName ) , :: DdsJs :: UnboundedStringField :: FromCppToJsValue ( cppValue . topic_name ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: type_nameFieldName ) , :: DdsJs :: UnboundedStringField :: FromCppToJsValue ( cppValue . type_name ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: durabilityFieldName ) , :: DDS :: DurabilityQosPolicyField :: FromCppToJsValue ( cppValue . durability ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: durability_serviceFieldName ) , :: DDS :: DurabilityServiceQosPolicyField :: FromCppToJsValue ( cppValue . durability_service ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: deadlineFieldName ) , :: DDS :: DeadlineQosPolicyField :: FromCppToJsValue ( cppValue . deadline ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: latency_budgetFieldName ) , :: DDS :: LatencyBudgetQosPolicyField :: FromCppToJsValue ( cppValue . latency_budget ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: livelinessFieldName ) , :: DDS :: LivelinessQosPolicyField :: FromCppToJsValue ( cppValue . liveliness ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: reliabilityFieldName ) , :: DDS :: ReliabilityQosPolicyField :: FromCppToJsValue ( cppValue . reliability ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: lifespanFieldName ) , :: DDS :: LifespanQosPolicyField :: FromCppToJsValue ( cppValue . lifespan ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: user_dataFieldName ) , :: DDS :: UserDataQosPolicyField :: FromCppToJsValue ( cppValue . user_data ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: ownershipFieldName ) , :: DDS :: OwnershipQosPolicyField :: FromCppToJsValue ( cppValue . ownership ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: ownership_strengthFieldName ) , :: DDS :: OwnershipStrengthQosPolicyField :: FromCppToJsValue ( cppValue . ownership_strength ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: destination_orderFieldName ) , :: DDS :: DestinationOrderQosPolicyField :: FromCppToJsValue ( cppValue . destination_order ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: presentationFieldName ) , :: DDS :: PresentationQosPolicyField :: FromCppToJsValue ( cppValue . presentation ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: partitionFieldName ) , :: DDS :: PartitionQosPolicyField :: FromCppToJsValue ( cppValue . partition ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: topic_dataFieldName ) , :: DDS :: TopicDataQosPolicyField :: FromCppToJsValue ( cppValue . topic_data ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } setResult = result -> Set ( ctx , Local < String > :: New ( isolate , PublicationBuiltinTopicDataField :: group_dataFieldName ) , :: DDS :: GroupDataQosPolicyField :: FromCppToJsValue ( cppValue . group_data ) ) ; if ( ! setResult . FromMaybe ( false ) ) { } return scope . Escape ( result ) ; }
From C++ to JavaScript for topic PublicationBuiltinTopicData
From C ++ to JavaScript for topic PublicationBuiltinTopicData
// 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 // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception // TODO: throw exception