diff --git a/compiler/lib/src/main/scala/codegen/CppWriter/PortCppWriter.scala b/compiler/lib/src/main/scala/codegen/CppWriter/PortCppWriter.scala index 6ec1276bd..5b10aac1f 100644 --- a/compiler/lib/src/main/scala/codegen/CppWriter/PortCppWriter.scala +++ b/compiler/lib/src/main/scala/codegen/CppWriter/PortCppWriter.scala @@ -113,10 +113,10 @@ case class PortCppWriter ( ), ) ) - wrapMembersInIfDirective( - "#if !FW_DIRECT_PORT_CALLS", - List.concat( - List(hppIncludes, cppIncludes), + List.concat( + List(hppIncludes, cppIncludes), + wrapMembersInIfDirective( + "#if !FW_DIRECT_PORT_CALLS", wrapInNamespaces( namespaceIdentList, List.concat( @@ -127,9 +127,9 @@ case class PortCppWriter ( CppDoc.Lines.Hpp ) ) - ) - ), - CppDoc.Lines.Cpp + ), + CppDoc.Lines.Cpp + ) ) } diff --git a/compiler/tools/fpp-to-cpp/test/component/base/NoArgsPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/NoArgsPortAc.ref.cpp index 160c16bc3..0888bd776 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/NoArgsPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/NoArgsPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for NoArgs port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "base/NoArgsPortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace Ports { namespace { diff --git a/compiler/tools/fpp-to-cpp/test/component/base/NoArgsReturnPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/NoArgsReturnPortAc.ref.cpp index 7eebfc8c0..a7ac0972a 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/NoArgsReturnPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/NoArgsReturnPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for NoArgsReturn port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "base/NoArgsReturnPortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace Ports { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/component/base/TypedPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/TypedPortAc.ref.cpp index 54245df8e..ad3d655f8 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/TypedPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/TypedPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for Typed port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "base/TypedPortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace Ports { namespace { diff --git a/compiler/tools/fpp-to-cpp/test/component/base/TypedReturnPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/component/base/TypedReturnPortAc.ref.cpp index 261f6d204..068cedf52 100644 --- a/compiler/tools/fpp-to-cpp/test/component/base/TypedReturnPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/component/base/TypedReturnPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for TypedReturn port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "base/TypedReturnPortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace Ports { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/AbsTypePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/AbsTypePortAc.ref.cpp index b8829848d..8b797d145 100644 --- a/compiler/tools/fpp-to-cpp/test/port/AbsTypePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/AbsTypePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for AbsType port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "AbsTypePortAc.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/EmptyPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/EmptyPortAc.ref.cpp index eb2f74ab4..86134d5d9 100644 --- a/compiler/tools/fpp-to-cpp/test/port/EmptyPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/EmptyPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for Empty port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "EmptyPortAc.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/FppTypePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/FppTypePortAc.ref.cpp index cd7f5ea5e..06fcf0d56 100644 --- a/compiler/tools/fpp-to-cpp/test/port/FppTypePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/FppTypePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for FppType port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "FppTypePortAc.hpp" #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/KwdNamePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/KwdNamePortAc.ref.cpp index 656233fea..b64585782 100644 --- a/compiler/tools/fpp-to-cpp/test/port/KwdNamePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/KwdNamePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for KwdName port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "KwdNamePortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/PrimitivePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/PrimitivePortAc.ref.cpp index 3e2452c3d..d2a229928 100644 --- a/compiler/tools/fpp-to-cpp/test/port/PrimitivePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/PrimitivePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for Primitive port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "PrimitivePortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/ReturnTypePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/ReturnTypePortAc.ref.cpp index ac2a2669f..6ec629072 100644 --- a/compiler/tools/fpp-to-cpp/test/port/ReturnTypePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/ReturnTypePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for ReturnType port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "ReturnTypePortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace M { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/StringPortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/StringPortAc.ref.cpp index 1d02914a0..ff2972f96 100644 --- a/compiler/tools/fpp-to-cpp/test/port/StringPortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/StringPortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for String port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "StringPortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace { // ---------------------------------------------------------------------- diff --git a/compiler/tools/fpp-to-cpp/test/port/StringReturnTypePortAc.ref.cpp b/compiler/tools/fpp-to-cpp/test/port/StringReturnTypePortAc.ref.cpp index dbb04db95..577bbe43f 100644 --- a/compiler/tools/fpp-to-cpp/test/port/StringReturnTypePortAc.ref.cpp +++ b/compiler/tools/fpp-to-cpp/test/port/StringReturnTypePortAc.ref.cpp @@ -4,12 +4,12 @@ // \brief cpp file for StringReturnType port // ====================================================================== -#if !FW_DIRECT_PORT_CALLS - #include "Fw/Types/Assert.hpp" #include "Fw/Types/ExternalString.hpp" #include "StringReturnTypePortAc.hpp" +#if !FW_DIRECT_PORT_CALLS + namespace M { // ----------------------------------------------------------------------