diff --git a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/cpp/CppDocumentationModelTest.kt b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/cpp/CppDocumentationModelTest.kt new file mode 100644 index 000000000..cc6436975 --- /dev/null +++ b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/cpp/CppDocumentationModelTest.kt @@ -0,0 +1,24 @@ +package com.jetbrains.rd.generator.test.cases.generator.cpp + +import com.jetbrains.rd.generator.test.cases.generator.testModels.DocumentationModelRoot +import com.jetbrains.rd.generator.testframework.CppRdGenOutputTest +import org.junit.jupiter.api.Test + +class CppDocumentationModelTest : CppRdGenOutputTest() { + + companion object { + const val TEST_NAME = "documentationModelTest" + } + + override val testName = TEST_NAME + + override val verifyComments = true + + override fun expectedFileCount(model: Class<*>) = when (model) { + DocumentationModelRoot::class.java -> 2 + else -> 0 + } + + @Test + fun test1() = doTest(DocumentationModelRoot::class.java) +} diff --git a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/csharp/CSharpDocumentationModelTest.kt b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/csharp/CSharpDocumentationModelTest.kt new file mode 100644 index 000000000..a86015cae --- /dev/null +++ b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/csharp/CSharpDocumentationModelTest.kt @@ -0,0 +1,19 @@ +package com.jetbrains.rd.generator.test.cases.generator.csharp + +import com.jetbrains.rd.generator.test.cases.generator.testModels.DocumentationModelRoot +import com.jetbrains.rd.generator.testframework.CSharpRdGenOutputTest +import org.junit.jupiter.api.Test + +class CSharpDocumentationModelTest : CSharpRdGenOutputTest() { + + companion object { + const val TEST_NAME = "documentationModelTest" + } + + override val testName = TEST_NAME + + override val verifyComments = true + + @Test + fun test1() = doTest(DocumentationModelRoot::class.java) +} diff --git a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/kotlin/KotlinDocumentationModelTest.kt b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/kotlin/KotlinDocumentationModelTest.kt new file mode 100644 index 000000000..7f62dc9f3 --- /dev/null +++ b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/kotlin/KotlinDocumentationModelTest.kt @@ -0,0 +1,19 @@ +package com.jetbrains.rd.generator.test.cases.generator.kotlin + +import com.jetbrains.rd.generator.test.cases.generator.testModels.DocumentationModelRoot +import com.jetbrains.rd.generator.testframework.KotlinRdGenOutputTest +import org.junit.jupiter.api.Test + +class KotlinDocumentationModelTest : KotlinRdGenOutputTest() { + + companion object { + const val TEST_NAME = "documentationModelTest" + } + + override val testName = TEST_NAME + + override val verifyComments = true + + @Test + fun test1() = doTest(DocumentationModelRoot::class.java) +} diff --git a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/testModels/ModelWithDocumentation.kt b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/testModels/ModelWithDocumentation.kt new file mode 100644 index 000000000..6041166f8 --- /dev/null +++ b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/test/cases/generator/testModels/ModelWithDocumentation.kt @@ -0,0 +1,19 @@ +package com.jetbrains.rd.generator.test.cases.generator.testModels + +import com.jetbrains.rd.generator.nova.* +import com.jetbrains.rd.generator.test.cases.generator.cpp.CppDocumentationModelTest +import com.jetbrains.rd.generator.test.cases.generator.csharp.CSharpDocumentationModelTest +import com.jetbrains.rd.generator.test.cases.generator.kotlin.KotlinDocumentationModelTest +import com.jetbrains.rd.generator.testframework.CSharpRdGenOutputTest +import com.jetbrains.rd.generator.testframework.CppRdGenOutputTest +import com.jetbrains.rd.generator.testframework.KotlinRdGenOutputTest + +object DocumentationModelRoot : Root( + *KotlinRdGenOutputTest.generators(KotlinDocumentationModelTest.TEST_NAME, "org.example"), + *CppRdGenOutputTest.generators(CppDocumentationModelTest.TEST_NAME, "org.example"), + *CSharpRdGenOutputTest.generators(CSharpDocumentationModelTest.TEST_NAME, "org.example") +) { + init { + documentation = "This is a documentation test,\nand it is also multiline." + } +} diff --git a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/testframework/RdGenOutputTestBase.kt b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/testframework/RdGenOutputTestBase.kt index 63540fc2c..05b1157f3 100644 --- a/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/testframework/RdGenOutputTestBase.kt +++ b/rd-kt/rd-gen/src/test/kotlin/com/jetbrains/rd/generator/testframework/RdGenOutputTestBase.kt @@ -19,6 +19,8 @@ abstract class RdGenOutputTestBase { protected abstract val fileExtensionNoDot: String protected abstract val generatedSourcesDir: String + protected open val verifyComments = false + protected open fun expectedFileCount(model: Class<*>): Int = 1 protected inline fun doTest( @@ -97,9 +99,11 @@ abstract class RdGenOutputTestBase { testFolder.deleteRecursively() } - private fun processLines(lines: List) = lines - .map { it.trimEnd() } - .filter { !it.trim().startsWith("//") } + private fun processLines(lines: List): Sequence { + val result = lines.asSequence().map { it.trimEnd() } + return if (verifyComments) result + else result.filter { !it.trim().startsWith("//") } + } protected fun processText(lines: List) = processLines(lines).joinToString("\n") protected fun getGoldFile(resourceRelativePath: String): File { diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs new file mode 100644 index 000000000..9af59a884 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.cs @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +using System; +using System.Linq; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using JetBrains.Annotations; + +using JetBrains.Core; +using JetBrains.Diagnostics; +using JetBrains.Collections; +using JetBrains.Collections.Viewable; +using JetBrains.Lifetimes; +using JetBrains.Serialization; +using JetBrains.Rd; +using JetBrains.Rd.Base; +using JetBrains.Rd.Impl; +using JetBrains.Rd.Tasks; +using JetBrains.Rd.Util; +using JetBrains.Rd.Text; + + +// ReSharper disable RedundantEmptyObjectCreationArgumentList +// ReSharper disable InconsistentNaming +// ReSharper disable RedundantOverflowCheckingContext + + +namespace org.example +{ + + + /// + /// This is a documentation test, + and it is also multiline. + ///

Generated from: ModelWithDocumentation.kt:14

+ ///
+ public class DocumentationModelRoot : RdExtBase + { + //fields + //public fields + + //private fields + //primary constructor + private DocumentationModelRoot( + ) + { + } + //secondary constructor + //deconstruct trait + //statics + + + + protected override long SerializationHash => -7782552752810534509L; + + protected override Action Register => RegisterDeclaredTypesSerializers; + public static void RegisterDeclaredTypesSerializers(ISerializers serializers) + { + + serializers.RegisterToplevelOnce(typeof(DocumentationModelRoot), DocumentationModelRoot.RegisterDeclaredTypesSerializers); + } + + public DocumentationModelRoot(Lifetime lifetime, IProtocol protocol) : this() + { + Identify(protocol.Identities, RdId.Root.Mix("DocumentationModelRoot")); + this.BindTopLevel(lifetime, protocol, "DocumentationModelRoot"); + } + + //constants + + //custom body + //methods + //equals trait + //hash code trait + //pretty print + public override void Print(PrettyPrinter printer) + { + printer.Println("DocumentationModelRoot ("); + printer.Print(")"); + } + //toString + public override string ToString() + { + var printer = new SingleLinePrettyPrinter(); + Print(printer); + return printer.ToString(); + } + } +} diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt new file mode 100644 index 000000000..1ebded810 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot.kt @@ -0,0 +1,62 @@ +@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection") +package org.example + +import com.jetbrains.rd.framework.* +import com.jetbrains.rd.framework.base.* +import com.jetbrains.rd.framework.impl.* + +import com.jetbrains.rd.util.lifetime.* +import com.jetbrains.rd.util.reactive.* +import com.jetbrains.rd.util.string.* +import com.jetbrains.rd.util.* +import kotlin.time.Duration +import kotlin.reflect.KClass +import kotlin.jvm.JvmStatic + + + +/** + * This is a documentation test, +and it is also multiline. + * #### Generated from [ModelWithDocumentation.kt:14] + */ +class DocumentationModelRoot private constructor( +) : RdExtBase() { + //companion + + companion object : ISerializersOwner { + + override fun registerSerializersCore(serializers: ISerializers) { + DocumentationModelRoot.register(serializers) + } + + + + + + const val serializationHash = -7782552752810534509L + + } + override val serializersOwner: ISerializersOwner get() = DocumentationModelRoot + override val serializationHash: Long get() = DocumentationModelRoot.serializationHash + + //fields + //methods + //initializer + //secondary constructor + //equals trait + //hash code trait + //pretty print + override fun print(printer: PrettyPrinter) { + printer.println("DocumentationModelRoot (") + printer.print(")") + } + //deepClone + override fun deepClone(): DocumentationModelRoot { + return DocumentationModelRoot( + ) + } + //contexts + //threading + override val extThreading: ExtThreadingKind get() = ExtThreadingKind.Default +} diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.cpp b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.cpp new file mode 100644 index 000000000..883acad74 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.cpp @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#include "DocumentationModelRoot.Generated.h" + + +#include "DocumentationModelRoot/DocumentationModelRoot.Generated.h" +#include "DocumentationModelRoot/DocumentationModelRoot.Generated.h" + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable:4250 ) +#pragma warning( disable:4307 ) +#pragma warning( disable:4267 ) +#pragma warning( disable:4244 ) +#pragma warning( disable:4100 ) +#endif + +namespace org.example { +// companion + +DocumentationModelRoot::DocumentationModelRootSerializersOwner const DocumentationModelRoot::serializersOwner; + +void DocumentationModelRoot::DocumentationModelRootSerializersOwner::registerSerializersCore(rd::Serializers const& serializers) const +{ +} + +void DocumentationModelRoot::connect(rd::Lifetime lifetime, rd::IProtocol const * protocol) +{ + DocumentationModelRoot::serializersOwner.registry(protocol->get_serializers()); + + identify(*(protocol->get_identity()), rd::RdId::Null().mix("DocumentationModelRoot")); + bind(lifetime, protocol, "DocumentationModelRoot"); +} + +// constants +// initializer +void DocumentationModelRoot::initialize() +{ + serializationHash = -7782552752810534509L; +} +// primary ctor +// secondary constructor +// default ctors and dtors +DocumentationModelRoot::DocumentationModelRoot() +{ + initialize(); +} +// reader +// writer +// virtual init +void DocumentationModelRoot::init(rd::Lifetime lifetime) const +{ + rd::RdExtBase::init(lifetime); +} +// identify +void DocumentationModelRoot::identify(const rd::Identities &identities, rd::RdId const &id) const +{ + rd::RdBindableBase::identify(identities, id); +} +// getters +// intern +// equals trait +// equality operators +bool operator==(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs) { + return &lhs == &rhs; +} +bool operator!=(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs){ + return !(lhs == rhs); +} +// hash code trait +// type name trait +// static type name trait +// polymorphic to string +std::string DocumentationModelRoot::toString() const +{ + std::string res = "DocumentationModelRoot\n"; + return res; +} +// external to string +std::string to_string(const DocumentationModelRoot & value) +{ + return value.toString(); +} +} + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h new file mode 100644 index 000000000..27576d123 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/asis/DocumentationModelRoot/DocumentationModelRoot.h @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#ifndef DOCUMENTATIONMODELROOT_GENERATED_H +#define DOCUMENTATIONMODELROOT_GENERATED_H + + +#include "protocol/Protocol.h" +#include "types/DateTime.h" +#include "impl/RdSignal.h" +#include "impl/RdProperty.h" +#include "impl/RdList.h" +#include "impl/RdSet.h" +#include "impl/RdMap.h" +#include "base/ISerializersOwner.h" +#include "base/IUnknownInstance.h" +#include "serialization/ISerializable.h" +#include "serialization/Polymorphic.h" +#include "serialization/NullableSerializer.h" +#include "serialization/ArraySerializer.h" +#include "serialization/InternedSerializer.h" +#include "serialization/SerializationCtx.h" +#include "serialization/Serializers.h" +#include "ext/RdExtBase.h" +#include "task/RdCall.h" +#include "task/RdEndpoint.h" +#include "task/RdSymmetricCall.h" +#include "std/to_string.h" +#include "std/hash.h" +#include "std/allocator.h" +#include "util/enum.h" +#include "util/gen_util.h" + +#include +#include +#include +#include + +#include "thirdparty.hpp" +#include "instantiations_DocumentationModelRoot.h" + + + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable:4250 ) +#pragma warning( disable:4307 ) +#pragma warning( disable:4267 ) +#pragma warning( disable:4244 ) +#pragma warning( disable:4100 ) +#endif + +/// +/// This is a documentation test, +and it is also multiline. +///

Generated from: ModelWithDocumentation.kt:14

+///
+namespace org.example { + +class DocumentationModelRoot : public rd::RdExtBase { + +public: + struct DocumentationModelRootSerializersOwner final : public rd::ISerializersOwner { + void registerSerializersCore(rd::Serializers const& serializers) const override; + }; + + static const DocumentationModelRootSerializersOwner serializersOwner; + + + +public: + void connect(rd::Lifetime lifetime, rd::IProtocol const * protocol); + + +private: + // custom serializers + +public: + // constants + +protected: + // fields + +private: + // initializer + void initialize(); + +public: + + // default ctors and dtors + + DocumentationModelRoot(); + + DocumentationModelRoot(DocumentationModelRoot &&) = delete; + + DocumentationModelRoot& operator=(DocumentationModelRoot &&) = delete; + + virtual ~DocumentationModelRoot() = default; + + // reader + + // writer + + // virtual init + void init(rd::Lifetime lifetime) const override; + + // identify + void identify(const rd::Identities &identities, rd::RdId const &id) const override; + + // getters + + // intern + +private: + // equals trait + +public: + // equality operators + friend bool operator==(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs); + friend bool operator!=(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs); + // hash code trait + // type name trait + // static type name trait + +private: + // polymorphic to string + std::string toString() const override; + +public: + // external to string + friend std::string to_string(const DocumentationModelRoot & value); +}; + +} + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +#endif // DOCUMENTATIONMODELROOT_GENERATED_H diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs new file mode 100644 index 000000000..9af59a884 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.cs @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +using System; +using System.Linq; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using JetBrains.Annotations; + +using JetBrains.Core; +using JetBrains.Diagnostics; +using JetBrains.Collections; +using JetBrains.Collections.Viewable; +using JetBrains.Lifetimes; +using JetBrains.Serialization; +using JetBrains.Rd; +using JetBrains.Rd.Base; +using JetBrains.Rd.Impl; +using JetBrains.Rd.Tasks; +using JetBrains.Rd.Util; +using JetBrains.Rd.Text; + + +// ReSharper disable RedundantEmptyObjectCreationArgumentList +// ReSharper disable InconsistentNaming +// ReSharper disable RedundantOverflowCheckingContext + + +namespace org.example +{ + + + /// + /// This is a documentation test, + and it is also multiline. + ///

Generated from: ModelWithDocumentation.kt:14

+ ///
+ public class DocumentationModelRoot : RdExtBase + { + //fields + //public fields + + //private fields + //primary constructor + private DocumentationModelRoot( + ) + { + } + //secondary constructor + //deconstruct trait + //statics + + + + protected override long SerializationHash => -7782552752810534509L; + + protected override Action Register => RegisterDeclaredTypesSerializers; + public static void RegisterDeclaredTypesSerializers(ISerializers serializers) + { + + serializers.RegisterToplevelOnce(typeof(DocumentationModelRoot), DocumentationModelRoot.RegisterDeclaredTypesSerializers); + } + + public DocumentationModelRoot(Lifetime lifetime, IProtocol protocol) : this() + { + Identify(protocol.Identities, RdId.Root.Mix("DocumentationModelRoot")); + this.BindTopLevel(lifetime, protocol, "DocumentationModelRoot"); + } + + //constants + + //custom body + //methods + //equals trait + //hash code trait + //pretty print + public override void Print(PrettyPrinter printer) + { + printer.Println("DocumentationModelRoot ("); + printer.Print(")"); + } + //toString + public override string ToString() + { + var printer = new SingleLinePrettyPrinter(); + Print(printer); + return printer.ToString(); + } + } +} diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt new file mode 100644 index 000000000..1ebded810 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot.kt @@ -0,0 +1,62 @@ +@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection") +package org.example + +import com.jetbrains.rd.framework.* +import com.jetbrains.rd.framework.base.* +import com.jetbrains.rd.framework.impl.* + +import com.jetbrains.rd.util.lifetime.* +import com.jetbrains.rd.util.reactive.* +import com.jetbrains.rd.util.string.* +import com.jetbrains.rd.util.* +import kotlin.time.Duration +import kotlin.reflect.KClass +import kotlin.jvm.JvmStatic + + + +/** + * This is a documentation test, +and it is also multiline. + * #### Generated from [ModelWithDocumentation.kt:14] + */ +class DocumentationModelRoot private constructor( +) : RdExtBase() { + //companion + + companion object : ISerializersOwner { + + override fun registerSerializersCore(serializers: ISerializers) { + DocumentationModelRoot.register(serializers) + } + + + + + + const val serializationHash = -7782552752810534509L + + } + override val serializersOwner: ISerializersOwner get() = DocumentationModelRoot + override val serializationHash: Long get() = DocumentationModelRoot.serializationHash + + //fields + //methods + //initializer + //secondary constructor + //equals trait + //hash code trait + //pretty print + override fun print(printer: PrettyPrinter) { + printer.println("DocumentationModelRoot (") + printer.print(")") + } + //deepClone + override fun deepClone(): DocumentationModelRoot { + return DocumentationModelRoot( + ) + } + //contexts + //threading + override val extThreading: ExtThreadingKind get() = ExtThreadingKind.Default +} diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.cpp b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.cpp new file mode 100644 index 000000000..883acad74 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.cpp @@ -0,0 +1,95 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#include "DocumentationModelRoot.Generated.h" + + +#include "DocumentationModelRoot/DocumentationModelRoot.Generated.h" +#include "DocumentationModelRoot/DocumentationModelRoot.Generated.h" + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable:4250 ) +#pragma warning( disable:4307 ) +#pragma warning( disable:4267 ) +#pragma warning( disable:4244 ) +#pragma warning( disable:4100 ) +#endif + +namespace org.example { +// companion + +DocumentationModelRoot::DocumentationModelRootSerializersOwner const DocumentationModelRoot::serializersOwner; + +void DocumentationModelRoot::DocumentationModelRootSerializersOwner::registerSerializersCore(rd::Serializers const& serializers) const +{ +} + +void DocumentationModelRoot::connect(rd::Lifetime lifetime, rd::IProtocol const * protocol) +{ + DocumentationModelRoot::serializersOwner.registry(protocol->get_serializers()); + + identify(*(protocol->get_identity()), rd::RdId::Null().mix("DocumentationModelRoot")); + bind(lifetime, protocol, "DocumentationModelRoot"); +} + +// constants +// initializer +void DocumentationModelRoot::initialize() +{ + serializationHash = -7782552752810534509L; +} +// primary ctor +// secondary constructor +// default ctors and dtors +DocumentationModelRoot::DocumentationModelRoot() +{ + initialize(); +} +// reader +// writer +// virtual init +void DocumentationModelRoot::init(rd::Lifetime lifetime) const +{ + rd::RdExtBase::init(lifetime); +} +// identify +void DocumentationModelRoot::identify(const rd::Identities &identities, rd::RdId const &id) const +{ + rd::RdBindableBase::identify(identities, id); +} +// getters +// intern +// equals trait +// equality operators +bool operator==(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs) { + return &lhs == &rhs; +} +bool operator!=(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs){ + return !(lhs == rhs); +} +// hash code trait +// type name trait +// static type name trait +// polymorphic to string +std::string DocumentationModelRoot::toString() const +{ + std::string res = "DocumentationModelRoot\n"; + return res; +} +// external to string +std::string to_string(const DocumentationModelRoot & value) +{ + return value.toString(); +} +} + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + diff --git a/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h new file mode 100644 index 000000000..27576d123 --- /dev/null +++ b/rd-kt/rd-gen/src/test/resources/testData/documentationModelTest/reversed/DocumentationModelRoot/DocumentationModelRoot.h @@ -0,0 +1,147 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a RdGen v1.13. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ +#ifndef DOCUMENTATIONMODELROOT_GENERATED_H +#define DOCUMENTATIONMODELROOT_GENERATED_H + + +#include "protocol/Protocol.h" +#include "types/DateTime.h" +#include "impl/RdSignal.h" +#include "impl/RdProperty.h" +#include "impl/RdList.h" +#include "impl/RdSet.h" +#include "impl/RdMap.h" +#include "base/ISerializersOwner.h" +#include "base/IUnknownInstance.h" +#include "serialization/ISerializable.h" +#include "serialization/Polymorphic.h" +#include "serialization/NullableSerializer.h" +#include "serialization/ArraySerializer.h" +#include "serialization/InternedSerializer.h" +#include "serialization/SerializationCtx.h" +#include "serialization/Serializers.h" +#include "ext/RdExtBase.h" +#include "task/RdCall.h" +#include "task/RdEndpoint.h" +#include "task/RdSymmetricCall.h" +#include "std/to_string.h" +#include "std/hash.h" +#include "std/allocator.h" +#include "util/enum.h" +#include "util/gen_util.h" + +#include +#include +#include +#include + +#include "thirdparty.hpp" +#include "instantiations_DocumentationModelRoot.h" + + + +#ifdef _MSC_VER +#pragma warning( push ) +#pragma warning( disable:4250 ) +#pragma warning( disable:4307 ) +#pragma warning( disable:4267 ) +#pragma warning( disable:4244 ) +#pragma warning( disable:4100 ) +#endif + +/// +/// This is a documentation test, +and it is also multiline. +///

Generated from: ModelWithDocumentation.kt:14

+///
+namespace org.example { + +class DocumentationModelRoot : public rd::RdExtBase { + +public: + struct DocumentationModelRootSerializersOwner final : public rd::ISerializersOwner { + void registerSerializersCore(rd::Serializers const& serializers) const override; + }; + + static const DocumentationModelRootSerializersOwner serializersOwner; + + + +public: + void connect(rd::Lifetime lifetime, rd::IProtocol const * protocol); + + +private: + // custom serializers + +public: + // constants + +protected: + // fields + +private: + // initializer + void initialize(); + +public: + + // default ctors and dtors + + DocumentationModelRoot(); + + DocumentationModelRoot(DocumentationModelRoot &&) = delete; + + DocumentationModelRoot& operator=(DocumentationModelRoot &&) = delete; + + virtual ~DocumentationModelRoot() = default; + + // reader + + // writer + + // virtual init + void init(rd::Lifetime lifetime) const override; + + // identify + void identify(const rd::Identities &identities, rd::RdId const &id) const override; + + // getters + + // intern + +private: + // equals trait + +public: + // equality operators + friend bool operator==(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs); + friend bool operator!=(const DocumentationModelRoot &lhs, const DocumentationModelRoot &rhs); + // hash code trait + // type name trait + // static type name trait + +private: + // polymorphic to string + std::string toString() const override; + +public: + // external to string + friend std::string to_string(const DocumentationModelRoot & value); +}; + +} + +#ifdef _MSC_VER +#pragma warning( pop ) +#endif + + + +#endif // DOCUMENTATIONMODELROOT_GENERATED_H