Exemplo n.º 1
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n// Code automatically generated by FOMCodeGen version ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GeneratorVersion));

            #line default
            #line hidden
            this.Write(" from ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(System.IO.Path.GetFileName(FOM.Filename)));

            #line default
            #line hidden
            this.Write(", do not edit\r\n\r\n");

            #line 9 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            if (FOM.ModelIdentification.Name != null)
            {
            #line default
            #line hidden

            #line 10 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Name, "Name: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 11 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 12 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            if (FOM.ModelIdentification.Copyright != null)
            {
            #line default
            #line hidden

            #line 13 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Copyright, "Copyright: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 14 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 15 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            if (FOM.ModelIdentification.Version != null)
            {
            #line default
            #line hidden

            #line 16 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Version, "Version: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 17 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 18 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            if (FOM.ModelIdentification.Description != null)
            {
            #line default
            #line hidden

            #line 19 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Description, "Description: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 20 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 21 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            if (FOM.ModelIdentification.Purpose != null)
            {
            #line default
            #line hidden

            #line 22 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Purpose, "Purpose: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 23 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n#pragma once\r\n\r\n#include <vector>\r\n#include <functional>\r\n#include <memory>\r\n\r\n" +
                       "");

            #line 31 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GetPredefinedTypeIncludes(FOMParser.FileContext.kObjectInterfaces)));

            #line default
            #line hidden
            this.Write("\r\n#include \"");

            #line 32 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DataTypesHeaderFilename));

            #line default
            #line hidden
            this.Write("\"\r\n\r\n");

            #line 34 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("namespace ");

            #line 38 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 39 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n");

            #line 41 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

            foreach (var objectClass in FOM.ObjectClasses)
            {
            #line default
            #line hidden
                this.Write("class I");

            #line 45 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(";\r\n// I");

            #line 46 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("ObjectClass represents the HLA object class ");

            #line 46 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.QualifiedName));

            #line default
            #line hidden
                this.Write(".\r\n// Instances of I");

            #line 47 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(" represent the corresponding HLA object instances.\r\nclass I");

            #line 48 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("ObjectClass\r\n{\r\n  public:\r\n    using DiscoverObjectInstanceCallback = std::functi" +
                           "on<void(std::shared_ptr<I");

            #line 51 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(">)>;\r\n    using RemoveObjectInstanceCallback = std::function<void(std::shared_ptr" +
                           "<I");

            #line 52 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(">)>;\r\n    using ObjectCreatedCallbackType = std::function<void(std::shared_ptr<I");

            #line 53 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(@">, bool success)>;
    // Publish/unpublish this object class. Creating object instances requires publishing the object class.
    virtual void Publish() = 0;
    virtual void Unpublish() = 0;
    // Subscribe/unsubscribe this object class. Taking part in object discovery and receiving attribute updates requires subscribing the object class.
    // Note that the appropriate callbacks should have been registered *before* subscribing to the object class.
    virtual void Subscribe(bool deliverToSelf) = 0;
    virtual void Unsubscribe() = 0;
    // Return an existing object instance by name, or nullptr if not existant.
    virtual std::shared_ptr<I");

            #line 62 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> GetObjectInstance(const std::wstring& instanceName) = 0;\r\n    // Create an inst" +
                           "ance of I");

            #line 63 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(@". Returns nullptr if the object instance already exists.
    // If another federate has already created an object instance with the same name and the same object class,
    // the discover object instance mechanism will reuse the object returned by 'create object instance'.
    // A discover object instance callback should be installed by the application to appropriately handle this case.
    virtual std::shared_ptr<I");

            #line 67 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> CreateObjectInstance(const std::wstring& instanceName) = 0;\r\n    // Create an i" +
                           "nstance of I");

            #line 68 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(", and notify the application about having completed the HLA object registration.\r" +
                           "\n    // The callback\'s \'success\' parameter indicates whether the object instance" +
                           " name could successfully be reserved for the object.\r\n    virtual std::shared_pt" +
                           "r<I");

            #line 70 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> CreateObjectInstance(const std::wstring& instanceName, ObjectCreatedCallbackTyp" +
                           "e createdCallback) = 0;\r\n    // Restore a \'dead\' instance of I");

            #line 71 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(@". Returns nullptr if the object instance already exists.
    // If another federate has already created an object instance with the same name and the same object class,
    // the discover object instance mechanism will reuse the object returned by 'create object instance'.
    // A discover object instance callback should be installed by the application to appropriately handle this case.
    virtual std::shared_ptr<I");

            #line 75 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> RestoreObjectInstance(std::shared_ptr<I");

            #line 75 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> existingObject) = 0;\r\n    // Restore a \'dead\' instance of I");

            #line 76 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(", and notify the application about having completed the HLA object registration.\r" +
                           "\n    // The callback\'s \'success\' parameter indicates whether the object instance" +
                           " name could successfully be reserved for the object.\r\n    virtual std::shared_pt" +
                           "r<I");

            #line 78 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("> RestoreObjectInstance(std::shared_ptr<I");

            #line 78 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write(@"> existingObject, ObjectCreatedCallbackType createdCallback) = 0;

    // install a discover object instance callback for this HLA object class
    virtual uint32_t RegisterDiscoverObjectInstanceCallback(DiscoverObjectInstanceCallback callback) = 0;
    virtual void UnregisterDiscoverObjectInstanceCallback(uint32_t callbackToken) = 0;

    // install a remove object instance callback for the HLA object class
    virtual uint32_t RegisterRemoveObjectInstanceCallback(RemoveObjectInstanceCallback callback) = 0;
    virtual void UnregisterRemoveObjectInstanceCallback(uint32_t callbackToken) = 0;
};

class I");

            #line 89 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden

            #line 89 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

                if (objectClass.BaseClass != null)
                {
            #line default
            #line hidden
                    this.Write(" : public I");

            #line 92 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.BaseClass.Name));

            #line default
            #line hidden
                    this.Write("\r\n");

            #line 93 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write(" : public std::enable_shared_from_this<I");

            #line 94 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                    this.Write(">\r\n");

            #line 95 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                } // if

            #line default
            #line hidden
                this.Write("{\r\n");

            #line 97 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

                string attributeBitsClass   = "uint32_t";
                string attributeBitsPostfix = "";
                if (objectClass.Attributes.Count > 32)
                {
                    attributeBitsClass   = "uint64_t";
                    attributeBitsPostfix = "ull";
                }


            #line default
            #line hidden
                this.Write("  public:\r\n");

            #line 107 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                if (objectClass.BaseClass == null)
                {
            #line default
            #line hidden
                    this.Write("    using AttributeBits = ");

            #line 108 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(attributeBitsClass));

            #line default
            #line hidden
                    this.Write(";\r\n    static const AttributeBits kNone = 0x0;\r\n");

            #line 110 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                }

            #line default
            #line hidden

            #line 111 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

                ulong bit;
                if (objectClass.BaseClass != null)
                {
                    bit = (ulong)(1 << objectClass.BaseClass.AllAttributes.Count);
                }
                else
                {
                    bit = 1;
                }
                foreach (var attribute in objectClass.Attributes)
                {
                    if (attribute.DataType != null)
                    {
            #line default
            #line hidden
                        this.Write("    static const AttributeBits k");

            #line 121 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                        this.Write("Bit = 0x");

            #line 121 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(bit.ToString("X")));

            #line default
            #line hidden

            #line 121 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attributeBitsPostfix));

            #line default
            #line hidden
                        this.Write(";\r\n");

            #line 122 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

                        bit = bit << 1;
                    } // if (attribute.DataType != null)
                }     // foreach (var attribute in objectClass.Attributes)


            #line default
            #line hidden
                this.Write("\r\n    I");

            #line 128 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("() {}\r\n");

            #line 129 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                if (objectClass.BaseClass == null)
                {
            #line default
            #line hidden
                    this.Write("    virtual ~I");

            #line 130 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                    this.Write("() {}\r\n");

            #line 131 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write("    ~I");

            #line 132 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                    this.Write("() {}\r\n");

            #line 133 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                }

            #line default
            #line hidden
                this.Write("    // copying and moving an object instance is not allowed\r\n    I");

            #line 135 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("(const I");

            #line 135 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("&) = delete;\r\n    I");

            #line 136 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("(I");

            #line 136 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("&&) = delete;\r\n    I");

            #line 137 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("& operator=(const I");

            #line 137 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("&) = delete;\r\n    I");

            #line 138 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("& operator=(I");

            #line 138 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("&&) = delete;\r\n\r\n");

            #line 140 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                if (objectClass.BaseClass == null)
                {
            #line default
            #line hidden
                    this.Write(@"    virtual std::wstring GetObjectInstanceName() const = 0;
    // has this object a valid HLA object instance handle?
    virtual bool IsValid() const = 0;
    // After having called CreateObjectInstance, wait until object registration completed.
    // Returns false if the object registration failed.
    virtual bool WaitForObjectValid() = 0;
    // has this object been created by this federate?
    virtual bool IsOwner() const = 0;
    // Delete the object from HLA and the class registry.
    // Be careful to keep a shared_ptr to the object while executing Release!
    virtual void Release() = 0;
");

            #line 152 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                }

            #line default
            #line hidden

            #line 153 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

                foreach (var attribute in objectClass.Attributes)
                {
                    if (attribute.DataType != null)
                    {
            #line default
            #line hidden
                        this.Write("    // attribute ");

            #line 158 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                        this.Write(" : ");

            #line 158 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.DataType.Name));

            #line default
            #line hidden
                        this.Write("\r\n    virtual ");

            #line 159 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.DataType.ReturnCppType));

            #line default
            #line hidden
                        this.Write(" Get");

            #line 159 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                        this.Write("() const = 0;\r\n");

            #line 160 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        if (attribute.DataType is FOMParser.FixedRecordDataType)
                        {
            #line default
            #line hidden
                            this.Write("    virtual ");

            #line 161 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attribute.DataType.ModifiableReturnCppType));

            #line default
            #line hidden
                            this.Write(" Get");

            #line 161 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                            this.Write("() = 0;\r\n");

            #line 162 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        }

            #line default
            #line hidden
                        this.Write("    virtual void Set");

            #line 163 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                        this.Write("(");

            #line 163 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.DataType.ParameterCppType));

            #line default
            #line hidden
                        this.Write(" newValue) = 0;\r\n");

            #line 164 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("    // attribute ");

            #line 165 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(attribute.Name));

            #line default
            #line hidden
                        this.Write(" : no data type\r\n");

            #line 166 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    } // if (attribute.DataType != null)
                }     // foreach (var attribute in objectClass.Attributes)


            #line default
            #line hidden

            #line 170 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                if (objectClass.HasValidAttributes)
                {
            #line default
            #line hidden

            #line 171 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    if (objectClass.BaseClass != null && !objectClass.BaseClass.HasValidAttributes) // first child class with valid attributes

                    {
            #line default
            #line hidden
                        this.Write("    // send all attribute values\r\n    virtual void UpdateAllAttributeValues() = 0" +
                                   ";\r\n    // send all attribute values, as TSO message\r\n    virtual void UpdateAllA" +
                                   "ttributeValues(");

            #line 175 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                        this.Write(@" time) = 0;
    // send attribute values which have been modified since last call
    virtual void UpdateModifiedAttributeValues() = 0;
    // send attribute values which have been modified since last call, as TSO message
    virtual void UpdateModifiedAttributeValues(");

            #line 179 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                        this.Write(@" time) = 0;
    // bitmask of attributes ever received
    virtual AttributeBits GetReceivedAttributes() const = 0;
    // bitmask of attributes received in last update (cleared after update callbacks executed)
    virtual AttributeBits GetUpdatedAttributes() const = 0;
    // bitmask of attributes ever modified
    virtual AttributeBits GetInitializedAttributes() const = 0;
    // bitmask of attributes modified since last updateAttributeValues/provideAttributeValues
    // (cleared by UpdateAttributeValues or ProvideAttributeValues)
    virtual AttributeBits GetModifiedAttributes() const = 0;
    // request attribute values which haven't been updated in last reflectAttributeValues
    virtual void RequestAttributeValues() = 0;
    // request all attribute values
    virtual void RequestAllAttributeValues() = 0;
");

            #line 193 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    }

            #line default
            #line hidden

            #line 194 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    if (objectClass.ChildClasses.Count == 0)
                    {
            #line default
            #line hidden
                        this.Write("    using UpdateCallback = std::function<void(std::shared_ptr<I");

            #line 195 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                        this.Write(">, optional<");

            #line 195 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                        this.Write("> time, optional<OrderType> orderType)>;\r\n    virtual uint32_t RegisterUpdateCall" +
                                   "back(UpdateCallback callback) = 0;\r\n    virtual void UnregisterUpdateCallback(ui" +
                                   "nt32_t callbackToken) = 0;\r\n");

            #line 198 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                    } // if (objectClass.ChildClasses.Count == 0)

            #line default
            #line hidden

            #line 199 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                } // if (objectClass.HasValidAttributes)

            #line default
            #line hidden
                this.Write("};\r\n\r\n");

            #line 202 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            } // foreach (var objectClass in FOM.ObjectClasses)

            #line default
            #line hidden
            this.Write("\r\nclass IObjectClassRegistry\r\n{\r\n  public:\r\n");

            #line 207 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            foreach (var objectClass in FOM.ObjectClasses)
            {
            #line default
            #line hidden
                this.Write("    virtual I");

            #line 208 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("ObjectClass* Get");

            #line 208 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(objectClass.Name));

            #line default
            #line hidden
                this.Write("ObjectClass() const = 0;\r\n");

            #line 209 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("  protected:\r\n    virtual ~IObjectClassRegistry() {}\r\n}; // class IObjectClassReg" +
                       "istry\r\n\r\n");

            #line 214 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"

            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("} // namespace ");

            #line 218 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 219 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMObjectInterfacesHeader.tt"
            }

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
Exemplo n.º 2
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n// Code automatically generated by FOMCodeGen version ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GeneratorVersion));

            #line default
            #line hidden
            this.Write(" from ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(System.IO.Path.GetFileName(FOM.Filename)));

            #line default
            #line hidden
            this.Write(@", do not edit

#pragma once

#include <vector>
#include ""RTI/Handle.h""
#include ""RTI/RTIambassador.h""
#include ""RTI/encoding/BasicDataElements.h""
#include ""RTI/encoding/HLAfixedRecord.h""
#include ""RTI/encoding/HLAfixedArray.h""
#include ""RTI/encoding/HLAvariableArray.h""

");

            #line 19 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GetPredefinedTypeIncludes(FOMParser.FileContext.kInteractionHeader)));

            #line default
            #line hidden
            this.Write("\r\n#include \"");

            #line 20 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(InteractionInterfacesHeaderFilename));

            #line default
            #line hidden
            this.Write("\"\r\n#include \"");

            #line 21 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(EncodingHeaderFilename));

            #line default
            #line hidden
            this.Write("\"\r\n\r\n");

            #line 23 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("namespace ");

            #line 24 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 25 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\nclass InteractionClassRegistry;\r\nclass ObjectClassRegistry;\r\n\r\n");

            #line 30 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            foreach (var interactionClass in FOM.InteractionClasses)
            {
            #line default
            #line hidden
                this.Write("class ");

            #line 31 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write(";\r\nclass ");

            #line 32 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass : public I");

            #line 32 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass\r\n{\r\n  public:\r\n    // I");

            #line 35 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass\r\n    ");

            #line 36 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass() = default;\r\n    virtual ~");

            #line 37 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write(@"InteractionClass() = default;
    ObjectClassRegistry* GetObjectClassRegistry();
    InteractionClassRegistry* GetInteractionClassRegistry() { return mInteractionClassRegistry; }
    void Publish() override;
    void Unpublish() override;
    void Subscribe(bool deliverToSelf) override;
");

            #line 43 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                if (interactionClass.HasValidParameters)
                {
            #line default
            #line hidden
                    this.Write("    virtual void Subscribe(");

            #line 44 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden
                    this.Write(", bool deliverToSelf) override;\r\n");

            #line 45 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                }

            #line default
            #line hidden
                this.Write("    void Unsubscribe() override;\r\n    void send(");

            #line 47 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden
                this.Write(") override;\r\n    void sendWithTime(");

            #line 48 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden

            #line 48 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                if (interactionClass.HasValidParameters)
                {
            #line default
            #line hidden
                    this.Write(", ");

            #line 48 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                }

            #line default
            #line hidden

            #line 48 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                this.Write(@" time) override;
    ReceiveCallbackHandle RegisterReceiveCallback(ReceiveCallback callback) override;
    void UnregisterReceiveCallback(ReceiveCallbackHandle callbackHandle) override;

    // internal
    void ReceiveInteraction(const rti1516ev::ParameterHandleValueMap & parameters);
    void ReceiveInteraction(const rti1516ev::ParameterHandleValueMap & parameters, const rti1516ev::LogicalTime& time, OrderType receivedOrder);
    rti1516ev::InteractionClassHandle GetInteractionClassHandle() const { return mInteractionClassHandle; }
");

            #line 56 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                if (interactionClass.BaseClass != null)
                {
            #line default
            #line hidden
                    this.Write("    ");

            #line 57 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                    this.Write("InteractionClass(rti1516ev::RTIambassador* rtiAmbassador, InteractionClassRegistr" +
                               "y* interactionClassRegistry, ");

            #line 57 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.BaseClass.Name));

            #line default
            #line hidden
                    this.Write("InteractionClass* baseClass);\r\n");

            #line 58 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                }
                else
                {
            #line default
            #line hidden
                    this.Write("    ");

            #line 59 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                    this.Write("InteractionClass(rti1516ev::RTIambassador* rtiAmbassador, InteractionClassRegistr" +
                               "y* interactionClassRegistry);\r\n");

            #line 60 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                } // if (interactionClass.BaseClass != null)

            #line default
            #line hidden

            #line 61 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"

                var baseClass = interactionClass.BaseClass;
                while (baseClass != null)
                {
                    foreach (var parameter in baseClass.Parameters)
                    {
                        if (parameter.DataType != null)
                        {
            #line default
            #line hidden
                            this.Write("    // parameter ");

            #line 69 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                            this.Write(" : ");

            #line 69 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(parameter.DataType.Name));

            #line default
            #line hidden
                            this.Write("\r\n");

            #line 70 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        }
                        else
                        {
            #line default
            #line hidden
                            this.Write("    // parameter ");

            #line 71 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                            this.Write(" : no data type\r\n");

            #line 72 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        } // if (parameter.DataType != null)

            #line default
            #line hidden
                        this.Write("    rti1516ev::ParameterHandle Get");

            #line 73 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write("ParameterHandle() const { return mBaseClass->Get");

            #line 73 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write("ParameterHandle(); }\r\n");

            #line 74 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    } // foreach (var parameter in interactionClass.Parameters)
                    baseClass = baseClass.BaseClass;
                }     // while (baseClass != null)


            #line default
            #line hidden

            #line 78 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"

                foreach (var parameter in interactionClass.Parameters)
                {
                    if (parameter.DataType != null)
                    {
            #line default
            #line hidden
                        this.Write("    // parameter ");

            #line 83 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write(" : ");

            #line 83 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.DataType.Name));

            #line default
            #line hidden
                        this.Write("\r\n");

            #line 84 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("    // parameter ");

            #line 85 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write(" : no data type\r\n");

            #line 86 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    } // if (parameter.DataType != null)

            #line default
            #line hidden
                    this.Write("    rti1516ev::ParameterHandle Get");

            #line 87 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                    this.Write("ParameterHandle() const { return m");

            #line 87 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                    this.Write("ParameterHandle; }\r\n");

            #line 88 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                } // foreach (var parameter in interactionClass.Parameters)

            #line default
            #line hidden
                this.Write(@"    rti1516ev::ParameterHandleSet GetAllParameterHandles();
  private:
    InteractionClassRegistry* mInteractionClassRegistry;
    rti1516ev::RTIambassador* mRtiAmbassador;
    // interaction class handle
    rti1516ev::InteractionClassHandle mInteractionClassHandle;
");

            #line 95 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                if (interactionClass.BaseClass != null)
                {
            #line default
            #line hidden
                    this.Write("    ");

            #line 96 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.BaseClass.Name));

            #line default
            #line hidden
                    this.Write("InteractionClass* mBaseClass;\r\n");

            #line 97 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                }

            #line default
            #line hidden
                this.Write("    bool mPublished = false;\r\n    bool mSubscribed = false;\r\n    // Parameter han" +
                           "dles\r\n");

            #line 101 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"

                foreach (var parameter in interactionClass.Parameters)
                {
                    if (parameter.DataType != null)
                    {
            #line default
            #line hidden
                        this.Write("    // parameter ");

            #line 106 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write(" : ");

            #line 106 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.DataType.Name));

            #line default
            #line hidden
                        this.Write("\r\n");

            #line 107 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    }
                    else
                    {
            #line default
            #line hidden
                        this.Write("    // parameter ");

            #line 108 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                        this.Write(" : no data type\r\n");

            #line 109 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    } // if (parameter.DataType != null)

            #line default
            #line hidden
                    this.Write("    rti1516ev::ParameterHandle m");

            #line 110 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(parameter.Name));

            #line default
            #line hidden
                    this.Write("ParameterHandle;\r\n");

            #line 111 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                } // foreach (var parameter in interactionClass.Parameters)


            #line default
            #line hidden
                this.Write("    std::map<ReceiveCallbackHandle, ReceiveCallback> mReceiveCallbacks;\r\n    Rece" +
                           "iveCallbackHandle mReceiveCallbacksNextKey = 0;\r\n};\r\n\r\n");

            #line 117 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            } // foreach (var interactionClass in FOM.InteractionClasses)

            #line default
            #line hidden
            this.Write(@" 

class ObjectClassRegistry;
class InteractionClassRegistry : public IInteractionClassRegistry
{
  public:
    InteractionClassRegistry(ObjectClassRegistry* objectClassRegistry);
    ~InteractionClassRegistry();
    ObjectClassRegistry* GetObjectClassRegistry() { return mObjectClassRegistry; }
    void Initialize(rti1516ev::RTIambassador* rtiAmbassador);
    void Finalize();

");

            #line 129 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            foreach (var interactionClass in FOM.InteractionClasses)
            {
            #line default
            #line hidden
                this.Write("    I");

            #line 130 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass* Get");

            #line 130 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass() const override { return m");

            #line 130 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass.get(); }\r\n");

            #line 131 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            }

            #line default
            #line hidden
            this.Write(@"
    void ReceiveInteraction(rti1516ev::InteractionClassHandle theInteraction, const rti1516ev::ParameterHandleValueMap & parameters);
    void ReceiveInteraction(rti1516ev::InteractionClassHandle theInteraction, const rti1516ev::ParameterHandleValueMap & parameters, const rti1516ev::LogicalTime&, OrderType orderType);

  private:
    rti1516ev::RTIambassador* mRtiAmbassador;
    ObjectClassRegistry* mObjectClassRegistry;
");

            #line 139 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            foreach (var interactionClass in FOM.InteractionClasses)
            {
            #line default
            #line hidden
                this.Write("    std::unique_ptr<");

            #line 140 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass> m");

            #line 140 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass;\r\n");

            #line 141 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            }

            #line default
            #line hidden
            this.Write(@"    std::map<rti1516ev::InteractionClassHandle, std::function<void(const rti1516ev::ParameterHandleValueMap&)>> mReceiveCallbacks;
    std::map<rti1516ev::InteractionClassHandle, std::function<void(const rti1516ev::ParameterHandleValueMap&, const rti1516ev::LogicalTime&, OrderType)>> mReceiveWithTimeCallbacks;
}; // class InteractionClassRegistry

");

            #line 146 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"

            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("} // namespace ");

            #line 150 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 151 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionsHeader.tt"
            }

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n// Code automatically generated by FOMCodeGen version ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GeneratorVersion));

            #line default
            #line hidden
            this.Write(" from ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(System.IO.Path.GetFileName(FOM.Filename)));

            #line default
            #line hidden
            this.Write(", do not edit\r\n\r\n");

            #line 9 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            if (FOM.ModelIdentification.Name != null)
            {
            #line default
            #line hidden

            #line 10 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Name, "Name: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 11 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 12 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            if (FOM.ModelIdentification.Copyright != null)
            {
            #line default
            #line hidden

            #line 13 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Copyright, "Copyright: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 14 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 15 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            if (FOM.ModelIdentification.Version != null)
            {
            #line default
            #line hidden

            #line 16 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Version, "Version: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 17 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 18 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            if (FOM.ModelIdentification.Description != null)
            {
            #line default
            #line hidden

            #line 19 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Description, "Description: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 20 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden

            #line 21 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            if (FOM.ModelIdentification.Purpose != null)
            {
            #line default
            #line hidden

            #line 22 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Purpose, "Purpose: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 23 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n#pragma once\r\n\r\n#include <vector>\r\n#include <functional>\r\n\r\n");

            #line 30 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GetPredefinedTypeIncludes(FOMParser.FileContext.kInteractionInterfaces)));

            #line default
            #line hidden
            this.Write("\r\n#include \"");

            #line 31 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(DataTypesHeaderFilename));

            #line default
            #line hidden
            this.Write("\"\r\n#include \"");

            #line 32 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(ObjectInterfacesHeaderFilename));

            #line default
            #line hidden
            this.Write("\"\r\n\r\n");

            #line 34 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("namespace ");

            #line 35 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 36 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n");

            #line 38 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            foreach (var interactionClass in FOM.InteractionClasses)
            {
            #line default
            #line hidden
                this.Write("// I");

            #line 39 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass represents the HLA interaction class ");

            #line 39 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.QualifiedName));

            #line default
            #line hidden
                this.Write(".\r\nclass I");

            #line 40 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write(@"InteractionClass
{
  public:
    // Publish/unpublish the interaction class. Sending an interaction of this class requires publishing the interaction class.
    virtual void Publish() = 0;
    virtual void Unpublish() = 0;
    // Subscribe the interaction class. Receiving interactions requires having subscribed to this interaction class.
    // Note that the appropriate callbacks should have been registered *before* subscribing to the interaction class.
    virtual void Subscribe(bool deliverToSelf) = 0;
");

            #line 49 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                if (interactionClass.HasValidParameters)
                {
            #line default
            #line hidden
                    this.Write(@"    // Subscribe the interaction class with filter values. Only interactions with parameters matching the given values will be received.
    // Filtered subscriptions may be issued several times with differing value tuples. 'nullopt' may be used as a wildcard, matching
    // any incoming value.
    virtual void Subscribe(");

            #line 53 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden
                    this.Write(", bool deliverToSelf) = 0;\r\n");

            #line 54 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                }

            #line default
            #line hidden
                this.Write(@"    // Unsubscribe the interaction class, cancelling reception of interactions. Calling Unsubscribe will also clear all filtered subscriptions, if any.
    virtual void Unsubscribe() = 0;
    // Send an interaction as receive order message.
    virtual void send(");

            #line 58 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden
                this.Write(") = 0;\r\n    // Send a time stamped interaction.\r\n    virtual void sendWithTime(");

            #line 60 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden

            #line 60 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                if (interactionClass.HasValidParameters)
                {
            #line default
            #line hidden
                    this.Write(", ");

            #line 60 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                }

            #line default
            #line hidden

            #line 60 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                this.Write(@" time) = 0;
    // Register an interaction callback. The optional time stamp will be delivered by the application. When the time stamp is valid,
    // the optional order type will indicate the source of the time stamp.
    using ReceiveCallback = std::function<void(");

            #line 63 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.CppParameterList));

            #line default
            #line hidden

            #line 63 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                if (interactionClass.HasValidParameters)
                {
            #line default
            #line hidden
                    this.Write(", ");

            #line 63 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                }

            #line default
            #line hidden
                this.Write("optional<");

            #line 63 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOM.NativeTimeType));

            #line default
            #line hidden
                this.Write(@"> time, optional<OrderType> orderType)>;
    using ReceiveCallbackHandle = uint32_t;
    constexpr static ReceiveCallbackHandle kInvalidCallbackHandle = 0xffffffff;
    virtual ReceiveCallbackHandle RegisterReceiveCallback(ReceiveCallback callback) = 0;
    virtual void UnregisterReceiveCallback(ReceiveCallbackHandle callbackHandle) = 0;
};

");

            #line 70 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            } // foreach (var interactionClass in FOM.InteractionClasses)

            #line default
            #line hidden
            this.Write("\r\nclass IInteractionClassRegistry\r\n{\r\n  public:\r\n");

            #line 75 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            foreach (var interactionClass in FOM.InteractionClasses)
            {
            #line default
            #line hidden
                this.Write("    virtual I");

            #line 76 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass* Get");

            #line 76 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(interactionClass.Name));

            #line default
            #line hidden
                this.Write("InteractionClass() const = 0;\r\n");

            #line 77 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("  protected:\r\n    virtual ~IInteractionClassRegistry() {}\r\n}; // class IInteracti" +
                       "onClassRegistry\r\n\r\n");

            #line 82 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("} // namespace ");

            #line 83 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 84 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMInteractionInterfacesHeader.tt"
            }

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }
Exemplo n.º 4
0
        /// <summary>
        /// Create the template output
        /// </summary>
        public virtual string TransformText()
        {
            this.Write("\r\n// Code automatically generated by FOMCodeGen version ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GeneratorVersion));

            #line default
            #line hidden
            this.Write(" from ");

            #line 7 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(System.IO.Path.GetFileName(FOM.Filename)));

            #line default
            #line hidden
            this.Write(", do not edit\r\n\r\n");

            #line 9 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            if (FOM.ModelIdentification.Name != null)
            {
            #line default
            #line hidden

            #line 10 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Name, "Name: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 11 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden

            #line 12 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            if (FOM.ModelIdentification.Copyright != null)
            {
            #line default
            #line hidden

            #line 13 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Copyright, "Copyright: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 14 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden

            #line 15 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            if (FOM.ModelIdentification.Version != null)
            {
            #line default
            #line hidden

            #line 16 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Version, "Version: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 17 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden

            #line 18 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            if (FOM.ModelIdentification.Description != null)
            {
            #line default
            #line hidden

            #line 19 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Description, "Description: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 20 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden

            #line 21 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            if (FOM.ModelIdentification.Purpose != null)
            {
            #line default
            #line hidden

            #line 22 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(FOMParser.FormatAsComment(FOM.ModelIdentification.Purpose, "Purpose: ")));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 23 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n#pragma once\r\n\r\n#include <vector>\r\n#include <ostream>\r\n#include <cassert>\r\n#inc" +
                       "lude <new>\r\n#include <utility>\r\n#include <type_traits>\r\n\r\n");

            #line 34 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.GetPredefinedTypeIncludes(FOMParser.FileContext.kDataTypes)));

            #line default
            #line hidden
            this.Write("\r\n\r\n");

            #line 36 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("namespace ");

            #line 40 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write(" {\r\n");

            #line 41 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden
            this.Write("\r\n// define placement_new in case some other header has redefined operator new to" +
                       " sth. different (e.g. MS crtdbg)\r\n#ifndef _PLACEMENT_NEW_DEFINED\r\n#pragma push_m" +
                       "acro(\"new\")\r\n#undef new\r\ntemplate <class X, typename ... Types>\r\ninline X* place" +
                       "ment_new(void* addr, Types&& ... args)\r\n{\r\n  return new (addr) X(std::forward<Ty" +
                       "pes>(args)...);\r\n}\r\n#pragma pop_macro(\"new\")\r\n#define _PLACEMENT_NEW_DEFINED\r\n#e" +
                       "ndif\r\n\r\n// define our own simplified \'optional\' types, similar to but independen" +
                       "t of std::optional (since C++17) or boost::optional\r\n\r\nstruct nullopt_t\n{\n  enum" +
                       " class _Construct { _Token };\n  explicit constexpr nullopt_t(_Construct) { }\n};\n" +
                       "\n/// Tag to disengage optional objects.\nconstexpr nullopt_t nullopt { nullopt_t:" +
                       ":_Construct::_Token };\n\r\nclass bad_optional_access : public std::exception\r\n{\r\np" +
                       "ublic:\r\n  virtual const char* what() const noexcept override { return (\"Bad opti" +
                       "onal access\"); }\r\n};\r\n\r\n// (empty) base template\r\ntemplate<typename T, bool=std:" +
                       ":is_class<T>::value > struct optional {};\r\n\r\n// Specialization for classes and s" +
                       "tructs used by-value, w. in-place copy-construction.\r\n// This implementation is " +
                       "limited to copy-constructible and default-destructible classes!\r\ntemplate<typena" +
                       "me T> struct optional<T, true>\r\n{\r\n  static_assert(!std::is_reference< T >::valu" +
                       "e, \"reference is not supported as optional value\");\r\n  // constructors\r\n  option" +
                       "al() noexcept : _valid(false) {}\r\n  constexpr optional(nullopt_t) noexcept : _va" +
                       "lid(false) {}\r\n  optional(const optional& rhs): _valid(rhs._valid) { create(rhs)" +
                       "; }\r\n  optional(const T& w): _valid(true) { create(w); }\r\n  template<typename Ot" +
                       "her>\r\n  optional(const Other& w): _valid(true) { create(w); }\r\n  template<typena" +
                       "me Other>\r\n  optional(const optional<Other>& rhs): _valid(rhs.has_value()) { if " +
                       "(rhs.has_value()) create(rhs.value()); }\r\n\r\n  // destructor\r\n  ~optional() { if(" +
                       "_valid) destroy(); }\r\n\r\n  // check for value presence\r\n  bool has_value() const " +
                       "{ return _valid; }\r\n  explicit operator bool() const { return _valid; }\r\n  bool " +
                       "operator ! () const { return !_valid; }\r\n\r\n  // assign\r\n  optional& operator = (" +
                       "optional const& rhs) { return assign(rhs); }\r\n  optional& operator = (T const& w" +
                       ") { return assign(w); }\r\n\r\n  // unchecked access to value\r\n  const T& operator *" +
                       " () const & { return *get(); }\r\n  T& operator * () & { return *get(); }\r\n  T con" +
                       "st* operator -> () const { return get(); }\r\n  T* operator -> () { return get(); " +
                       "}\r\n  // checked access to value\r\n  const T& value() const & {\r\n    if (!_valid) " +
                       "{\r\n      throw bad_optional_access{};\r\n    }\r\n    return *get();\r\n  }\r\n  T& valu" +
                       "e() & {\r\n    if (!_valid) {\r\n      throw bad_optional_access{};\r\n    }\r\n    retu" +
                       "rn *get();\r\n  }\r\nprivate:\r\n  template<typename Other>\r\n  void create(const Other" +
                       "& w) { placement_new<T>(&_value, w); }\r\n  void create(const optional& rhs) { if(" +
                       "_valid) create(*rhs.get()); }\r\n  void destroy() { get()->~T(); }\r\n  T const* get" +
                       "() const { assert(_valid && \"no optional value\"); return reinterpret_cast< const" +
                       " T* >(&_value); }\r\n  T* get() { assert(_valid && \"no optional value\"); return re" +
                       "interpret_cast< T* >(&_value); }\r\n  void cleanup() { destroy(); _valid = false; " +
                       "}\r\n  optional& assign(const T& w) {\r\n    if(_valid) *get() = w;\r\n    else create" +
                       "(w), _valid = true;\r\n    return *this;\r\n  }\r\n  optional& assign(const optional& " +
                       "rhs) {\r\n    if(rhs._valid) return assign(*rhs.get());\r\n    if(!_valid) return *t" +
                       "his;\r\n    cleanup();\r\n    return *this;\r\n  }\r\n  bool _valid;\r\n\tunion {\r\n    type" +
                       "name std::remove_cv<T>::type _value;\r\n  };\r\n};\r\n// Specialization for const-ref " +
                       "parameters, implemented by holding a pointer to the original variable.\r\n// Note " +
                       "that non-const references are *not* supported (but could be easily added)!\r\ntemp" +
                       "late<typename T> struct optional<const T&, false>\r\n{\r\n  // constructors\r\n  optio" +
                       "nal() noexcept : _valid(false), _pointer() {}\r\n  constexpr optional(nullopt_t) n" +
                       "oexcept : _valid(false), _pointer() {}\r\n  optional(const optional& rhs): _valid(" +
                       "rhs._valid), _pointer(rhs._pointer) { }\r\n  optional(const T& rhs) noexcept : _va" +
                       "lid(true), _pointer(&rhs) { }\r\n  template<typename Other>\r\n  optional(const Othe" +
                       "r& rhs): _valid(true), _pointer(&rhs) { }\r\n  template<typename Other>\r\n  optiona" +
                       "l(const optional<Other>& rhs): _valid(rhs.has_value()), _pointer(rhs.operator->(" +
                       ")) { }\r\n\r\n  // destructor\r\n  ~optional() { }\r\n\r\n  // check for value presence\r\n " +
                       " bool has_value() const { return _valid; }\r\n  explicit operator bool() const { r" +
                       "eturn _valid; }\r\n  bool operator ! () const { return !_valid; }\r\n\r\n  // assign\r\n" +
                       "  optional& operator = (const optional& rhs) {\r\n    _valid = rhs._valid;\r\n    _p" +
                       "ointer = rhs._pointer;\r\n    return *this;\r\n  }\r\n  optional& operator = (const T&" +
                       " w) {\r\n    _valid = true;\r\n    _pointer = &w;\r\n    return *this;\r\n  }\r\n  // unch" +
                       "ecked access to value\r\n  T const& operator * () const & { return *get(); }\r\n  T " +
                       "const* operator -> () const & { return get(); }\r\n  // checked access to value\r\n " +
                       " const T& value() const & {\r\n    if (!_valid) {\r\n      throw bad_optional_access" +
                       "{};\r\n    }\r\n    return *get();\r\n  }\r\n  T& value() & {\r\n    if (!_valid) {\r\n     " +
                       " throw bad_optional_access{};\r\n    }\r\n    return *get();\r\n  }\r\nprivate:\r\n  const" +
                       " T* get() const {\r\n    assert(_valid && \"no optional value\");\r\n    return _point" +
                       "er;\r\n  }\r\n  bool _valid;\r\n  const T* _pointer = nullptr;\r\n};\r\n// Specialization " +
                       "for everything else, which includes fundamental types and pointer types.\r\ntempla" +
                       "te<typename T> struct optional<T, false>\r\n{\r\n  // constructors\r\n  optional() noe" +
                       "xcept : _valid(false), _value() {}\r\n  constexpr optional(nullopt_t) noexcept : _" +
                       "valid(false), _value() {}\r\n  optional(const optional& rhs): _valid(rhs._valid), " +
                       "_value(rhs._value) { }\r\n  optional(const T& rhs) : _valid(true), _value(rhs) { }" +
                       "\r\n  template<typename Other>\r\n  optional(const Other& rhs): _valid(true), _value" +
                       "(rhs) { }\r\n  template<typename Other>\r\n  optional(const optional<Other>& rhs): _" +
                       "valid(rhs.has_value()), _value(rhs.operator*()) { }\r\n\r\n  // destructor\r\n  ~optio" +
                       "nal() { }\r\n\r\n  // check for value presence\r\n  bool has_value() const { return _v" +
                       "alid; }\r\n  explicit operator bool() const { return _valid; }\r\n  bool operator ! " +
                       "() const { return !_valid; }\r\n\r\n  // assign\r\n  optional& operator = (const optio" +
                       "nal& rhs) {\r\n    _valid = rhs._valid;\r\n    _value = rhs._value;\r\n    return *thi" +
                       "s;\r\n  }\r\n  optional& operator = (const T& w) {\r\n    _valid = true;\r\n    _value =" +
                       " w;\r\n    return *this;\r\n  }\r\n  // unchecked access to value\r\n  T const& operator" +
                       " * () const & { return _value; }\r\n  T const* operator -> () const { return &_val" +
                       "ue; }\r\n  // checked access to value\r\n  const T& value() const & {\r\n    if (!_val" +
                       "id) {\r\n      throw bad_optional_access{};\r\n    }\r\n    return _value;\r\n  }\r\n  T& " +
                       "value() & {\r\n    if (!_valid) {\r\n      throw bad_optional_access{};\r\n    }\r\n    " +
                       "return _value;\r\n  }\r\nprivate:\r\n  bool _valid;\r\n  T _value;\r\n};\r\n\r\nclass InvalidL" +
                       "ogicalTime : public std::logic_error\r\n{\r\n  public:\r\n    InvalidLogicalTime(const" +
                       " std::string& what_arg) : std::logic_error(what_arg) {}\r\n};\r\n\r\nclass NotConnecte" +
                       "d : public std::logic_error\r\n{\r\n  public:\r\n    NotConnected() : std::logic_error" +
                       "(\"not connected\") {}\r\n};\r\n\r\nclass NotInitialized : public std::logic_error\r\n{\r\n " +
                       " public:\r\n    NotInitialized() : std::logic_error(\"class registry not initialize" +
                       "d\") {}\r\n};\r\n\r\n// extended receive order type, includes \'interpolated\' for applic" +
                       "ation-generated timestamps\r\nenum class OrderType { RECEIVE, TIMESTAMP, INTERPOLA" +
                       "TED };\r\n\r\ntemplate<typename char_type, typename traits_type>\r\nstd::basic_ostream" +
                       "<char_type, traits_type>&\r\noperator<<(std::basic_ostream<char_type, traits_type>" +
                       "& os, OrderType value)\r\n{\r\n  switch (value)\r\n  {\r\n    case OrderType::RECEIVE: o" +
                       "s << \"RECEIVE\"; break;\r\n    case OrderType::TIMESTAMP: os << \"TIMESTAMP\"; break;" +
                       "\r\n    case OrderType::INTERPOLATED: os << \"INTERPOLATED\"; break;\r\n  }\r\n  return " +
                       "os;\r\n}\r\n\r\ninline std::string to_string(OrderType value)\r\n{\r\n  switch (value)\r\n  " +
                       "{\r\n    case OrderType::RECEIVE: return \"RECEIVE\";\r\n    case OrderType::TIMESTAMP" +
                       ": return \"TIMESTAMP\";\r\n    case OrderType::INTERPOLATED: return \"INTERPOLATED\";\r" +
                       "\n  }\r\n}\r\n\r\ninline std::wstring to_wstring(OrderType value)\r\n{\r\n  switch (value)\r" +
                       "\n  {\r\n    case OrderType::RECEIVE: return L\"RECEIVE\";\r\n    case OrderType::TIMES" +
                       "TAMP: return L\"TIMESTAMP\";\r\n    case OrderType::INTERPOLATED: return L\"INTERPOLA" +
                       "TED\";\r\n  }\r\n}\r\n");

            #line 300 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            this.Write(this.ToStringHelper.ToStringWithCulture(FOM.DataTypeForwardDeclarations));

            #line default
            #line hidden
            this.Write("\r\n");

            #line 303 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

            foreach (var dataType in FOM.DataTypes)
            {
                if (dataType is FOMParser.SimpleDataType && dataType.Generate)
                {
                    var simpleDataType = dataType as FOMParser.SimpleDataType;
                    if (dataType.Comment != null && dataType.Comment != "")
                    {
            #line default
            #line hidden

            #line 311 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Comment));

            #line default
            #line hidden
                        this.Write("\r\n");

            #line 312 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    }

            #line default
            #line hidden
                    this.Write("typedef ");

            #line 313 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(simpleDataType.Representation.CPPType));

            #line default
            #line hidden
                    this.Write(" ");

            #line 313 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(simpleDataType.Name));

            #line default
            #line hidden
                    this.Write(";\r\n\r\n");

            #line 315 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                } // if (dataType is FOMParser.SimpleDataType)
                else if (dataType is FOMParser.FixedRecordDataType)
                {
                    var fixedRecordDataType = dataType as FOMParser.FixedRecordDataType;
                    if (dataType.Comment != null && dataType.Comment != "")
                    {
            #line default
            #line hidden

            #line 321 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(fixedRecordDataType.Comment));

            #line default
            #line hidden
                        this.Write("\r\n");

            #line 322 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    }

            #line default
            #line hidden
                    this.Write("class ");

            #line 323 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(fixedRecordDataType.Name));

            #line default
            #line hidden

            #line 323 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(fixedRecordDataType.BaseClass != null ? " : public " + fixedRecordDataType.BaseClass.Name : ""));

            #line default
            #line hidden
                    this.Write("\r\n{\r\n  public:\r\n    virtual ~");

            #line 326 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(fixedRecordDataType.Name));

            #line default
            #line hidden
                    this.Write("() noexcept {}\r\n");

            #line 327 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    if (fixedRecordDataType.BaseClass == null)
                    {
            #line default
            #line hidden
                        this.Write("    virtual uint32_t getVersion() const = 0;\r\n");

            #line 329 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    }

            #line default
            #line hidden

            #line 330 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    foreach (var field in fixedRecordDataType.Fields)
                    {
            #line default
            #line hidden
                        this.Write("    virtual void Set");

            #line 331 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write("(");

            #line 331 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.DataType.ParameterCppType));

            #line default
            #line hidden
                        this.Write(" value) = 0;\r\n");

            #line 332 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        if (field.DataType is FOMParser.ArrayDataType)
                        {
                            var arrayDataType = field.DataType as FOMParser.ArrayDataType;


            #line default
            #line hidden
                            this.Write("    virtual void Set");

            #line 335 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                            this.Write("(const ");

            #line 335 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(arrayDataType.DataType.CPPType));

            #line default
            #line hidden
                            this.Write("* value, size_t size) = 0;\r\n");

            #line 336 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        }

            #line default
            #line hidden
                        this.Write("    virtual ");

            #line 337 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.DataType.ReturnCppType));

            #line default
            #line hidden
                        this.Write(" Get");

            #line 337 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write("() const = 0;\r\n    virtual bool Is");

            #line 338 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(field.Name));

            #line default
            #line hidden
                        this.Write("Available() const = 0;\r\n");

            #line 339 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    } // foreach fixedRecordDataType.Fields

            #line default
            #line hidden
                    this.Write("\r\n}; // class ");

            #line 341 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write("\r\n\r\n");

            #line 343 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                } // if (dataType is FOMParser.FixedRecordDataType)
                else if (dataType is FOMParser.EnumeratedDataType && dataType.Generate)
                {
                    var enumeratedDataType = dataType as FOMParser.EnumeratedDataType;
                    if (dataType.Comment != null && dataType.Comment != "")
                    {
            #line default
            #line hidden

            #line 350 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Comment));

            #line default
            #line hidden
                        this.Write("\r\n");

            #line 351 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    }

            #line default
            #line hidden
                    this.Write("enum class ");

            #line 352 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(" : ");

            #line 352 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(enumeratedDataType.Representation.CPPType));

            #line default
            #line hidden
                    this.Write("\r\n{\r\n");

            #line 354 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

                    foreach (var enumerator in enumeratedDataType.Enumerators.Values)
                    {
                        if (enumerator.Comment != null)
                        {
            #line default
            #line hidden
                            this.Write("      ");

            #line 359 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                            this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Comment));

            #line default
            #line hidden
                            this.Write("\r\n");

            #line 360 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        }

            #line default
            #line hidden
                        this.Write("      ");

            #line 361 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write(" = ");

            #line 361 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Value));

            #line default
            #line hidden
                        this.Write(",\r\n");

            #line 362 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    } // foreach enumeratedDataType.Enumerators.Values


            #line default
            #line hidden
                    this.Write("}; // enum ");

            #line 365 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write("\r\n\r\ntemplate<typename char_type, typename traits_type>\r\nstd::basic_ostream<char_t" +
                               "ype, traits_type>&\r\noperator<<(std::basic_ostream<char_type, traits_type>& os, ");

            #line 369 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(" value)\r\n{\r\n  switch (value)\r\n  {\r\n");

            #line 373 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

                    foreach (var enumerator in enumeratedDataType.Enumerators.Values)
                    {
            #line default
            #line hidden
                        this.Write("    case ");

            #line 377 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                        this.Write("::");

            #line 377 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write(": os << \"");

            #line 377 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write("\"; break;\r\n");

            #line 378 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    } // foreach enumeratedDataType.Enumerators.Values


            #line default
            #line hidden
                    this.Write("    default: os << \"<invalid ");

            #line 381 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(">\"; break;\r\n  }\r\n  return os;\r\n}\r\n\r\ninline std::string to_string(");

            #line 386 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(" value)\r\n{\r\n  switch (value)\r\n  {\r\n");

            #line 390 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

                    foreach (var enumerator in enumeratedDataType.Enumerators.Values)
                    {
            #line default
            #line hidden
                        this.Write("    case ");

            #line 394 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                        this.Write("::");

            #line 394 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write(": return \"");

            #line 394 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write("\";\r\n");

            #line 395 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    } // foreach enumeratedDataType.Enumerators.Values


            #line default
            #line hidden
                    this.Write("    default: return \"<invalid ");

            #line 398 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(">\";\r\n  }\r\n}\r\n\r\ninline std::wstring to_wstring(");

            #line 402 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(" value)\r\n{\r\n  switch (value)\r\n  {\r\n");

            #line 406 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

                    foreach (var enumerator in enumeratedDataType.Enumerators.Values)
                    {
            #line default
            #line hidden
                        this.Write("    case ");

            #line 410 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                        this.Write("::");

            #line 410 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write(": return L\"");

            #line 410 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                        this.Write(this.ToStringHelper.ToStringWithCulture(enumerator.Name));

            #line default
            #line hidden
                        this.Write("\";\r\n");

            #line 411 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    } // foreach enumeratedDataType.Enumerators.Values


            #line default
            #line hidden
                    this.Write("    default: return L\"<invalid ");

            #line 414 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                    this.Write(this.ToStringHelper.ToStringWithCulture(dataType.Name));

            #line default
            #line hidden
                    this.Write(">\";\r\n  }\r\n}\r\n\r\n");

            #line 418 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                } // if (dataType is FOMParser.EnumeratedDataType)
            }     // foreach (var dataType in FOM.DataTypes.Values)


            #line default
            #line hidden
            this.Write("\r\n");

            #line 423 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"

            foreach (var namespacePart in FOM.Namespace)
            {
            #line default
            #line hidden
                this.Write("} // namespace ");

            #line 427 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
                this.Write(this.ToStringHelper.ToStringWithCulture(namespacePart));

            #line default
            #line hidden
                this.Write("\r\n");

            #line 428 "D:\vfs\OpenRTI\src\Tools\FOMCodeGen\FOMDataTypesHeader.tt"
            }

            #line default
            #line hidden
            return(this.GenerationEnvironment.ToString());
        }