diff --git a/src/phasicFlow/typeSelection/typeInfo.hpp b/src/phasicFlow/typeSelection/typeInfo.hpp index b33a17cb..1cd0e284 100644 --- a/src/phasicFlow/typeSelection/typeInfo.hpp +++ b/src/phasicFlow/typeSelection/typeInfo.hpp @@ -58,7 +58,8 @@ struct checkStatic }; template -inline word basicTypeName() +inline +word basicTypeName() { int status; auto &ti = typeid(T); @@ -117,7 +118,8 @@ inline word basicTypeName() } template -word constexpr getTypeName() +inline +word getTypeName() { if constexpr (checkStatic::hasMember()) { @@ -130,7 +132,8 @@ word constexpr getTypeName() } template -word constexpr getTypeName(const T &) +inline +word getTypeName(const T &) { if constexpr (checkStatic::hasMember()) { @@ -157,6 +160,32 @@ bool checkType(Type2 &object) } } // namespace pFlow +#define QuadrupleTypeInfoNV(T) \ + inline static word TYPENAME() \ + { \ + return getTypeName()+"x4"; \ + } \ + word typeName() const \ + { \ + return TYPENAME(); \ + } + +#define TripleTypeInfoNV(T) \ + inline static word TYPENAME() \ + { \ + return getTypeName()+"x3"; \ + } \ + word typeName() const \ + { \ + return TYPENAME(); \ + } + +#define ClassInfo(tName) \ + inline static word TYPENAME() \ + { \ + return tName; \ + } + #define TypeInfo(tName) \ inline static word TYPENAME() \ { \ diff --git a/src/phasicFlow/types/basicTypes/Logical.hpp b/src/phasicFlow/types/basicTypes/Logical.hpp index b664c54f..9b6a01d6 100755 --- a/src/phasicFlow/types/basicTypes/Logical.hpp +++ b/src/phasicFlow/types/basicTypes/Logical.hpp @@ -22,7 +22,7 @@ Licence: #include "builtinTypes.hpp" #include "bTypesFunctions.hpp" -#include "typeInfo.hpp" + namespace pFlow @@ -62,7 +62,15 @@ private: public: /// Type info - TypeInfoNV("Logical"); + inline static word TYPENAME() + { + return "Logical"; + } + + inline word typeName()const + { + return TYPENAME(); + } //// Constructors diff --git a/src/phasicFlow/types/quadruple/quadruple.hpp b/src/phasicFlow/types/quadruple/quadruple.hpp index cf775b1b..6b4133da 100644 --- a/src/phasicFlow/types/quadruple/quadruple.hpp +++ b/src/phasicFlow/types/quadruple/quadruple.hpp @@ -22,6 +22,7 @@ Licence: #define __quadruple_hpp__ #include "error.hpp" +#include "typeInfo.hpp" #include "iIstream.hpp" #include "iOstream.hpp" #include "token.hpp" @@ -40,14 +41,13 @@ class iIstream; // you can see it as a sequence of four elements (w,x,y,z) or an (scalar and // vector) template -class quadruple +struct quadruple { -public: - T s_; triple v_; -public: + + QuadrupleTypeInfoNV(T); //// constructors INLINE_FUNCTION_HD diff --git a/src/phasicFlow/types/triple/triple.hpp b/src/phasicFlow/types/triple/triple.hpp index d9f45043..390c04f4 100644 --- a/src/phasicFlow/types/triple/triple.hpp +++ b/src/phasicFlow/types/triple/triple.hpp @@ -22,6 +22,7 @@ Licence: #include "pFlowMacros.hpp" #include "numericConstants.hpp" +#include "typeInfo.hpp" #include "uniquePtr.hpp" #include "iOstream.hpp" #include "iIstream.hpp" @@ -49,6 +50,7 @@ struct triple T y_; T z_; + TripleTypeInfoNV(T); //// Constructors /// Initilize to zero diff --git a/src/phasicFlow/types/types.hpp b/src/phasicFlow/types/types.hpp index 8d1f593f..37587517 100644 --- a/src/phasicFlow/types/types.hpp +++ b/src/phasicFlow/types/types.hpp @@ -50,16 +50,16 @@ using realx4 = quadruple; using realx4x3 = quadruple; -template<> +/*template<> inline word -basicTypeName() +triple::TYPENAME() { return "int8x3"; } template<> inline word -basicTypeName() +triple::TYPENAME() { return "int32x3"; } @@ -132,7 +132,7 @@ inline word basicTypeName() { return "realx4x3"; -} +}*/ extern const realx3 zero3; extern const realx3 one3;