X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcontainer.pl;h=7a7b3e9dbe262faa684998b4eb3c778827acfa42;hp=4cb7f8839e0c63faaccabfefc3950a397e6cb9b1;hb=8bcccf834ad41e94a1a4f3a0304c2945b228b4f4;hpb=a8507b8af1c08d9b27d98d57f95c7ca1a8671e27 diff --git a/ginac/container.pl b/ginac/container.pl index 4cb7f883..7a7b3e9d 100755 --- a/ginac/container.pl +++ b/ginac/container.pl @@ -89,7 +89,9 @@ END_OF_LET_OP_IMPLEMENTATION $interface=< -#include +#include +#include + +namespace GiNaC { typedef ${STLHEADER} ${STLT}; @@ -212,9 +217,13 @@ protected: extern const ${CONTAINER} some_${CONTAINER}; extern type_info const & typeid_${CONTAINER}; -// macros +// utility functions +inline const ${CONTAINER} &ex_to_${CONTAINER}(const ex &e) +{ + return static_cast(*e.bp); +} -#define ex_to_${CONTAINER}(X) (static_cast<${CONTAINER} const &>(*(X).bp)) +} // namespace GiNaC #endif // ndef __GINAC_${CONTAINER_UC}_H__ @@ -223,7 +232,9 @@ END_OF_INTERFACE $implementation=< #include -#include "ginac.h" +#include "${CONTAINER}.h" +#include "ex.h" +#include "debugmsg.h" + +namespace GiNaC { ${RESERVE_IMPLEMENTATION} @@ -264,7 +279,7 @@ ${RESERVE_IMPLEMENTATION} // public -${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER_UC}) +${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} default constructor",LOGLEVEL_CONSTRUCT); } @@ -311,7 +326,7 @@ void ${CONTAINER}::destroy(bool call_parent) // public -${CONTAINER}::${CONTAINER}(${STLT} const & s, bool discardable) : basic(TINFO_${CONTAINER_UC}) +${CONTAINER}::${CONTAINER}(${STLT} const & s, bool discardable) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from ${STLT}", LOGLEVEL_CONSTRUCT); @@ -322,7 +337,7 @@ ${CONTAINER}::${CONTAINER}(${STLT} const & s, bool discardable) : basic(TINFO_$ } } -${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER_UC}) +${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from ${STLT} *",LOGLEVEL_CONSTRUCT); ASSERT(vp!=0); @@ -330,7 +345,7 @@ ${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER_UC}) delete vp; } -${CONTAINER}::${CONTAINER}(ex const & e1) : basic(TINFO_${CONTAINER_UC}) +${CONTAINER}::${CONTAINER}(ex const & e1) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 1 ex", LOGLEVEL_CONSTRUCT); @@ -338,7 +353,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1) : basic(TINFO_${CONTAINER_UC}) seq.push_back(e1); } -${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2) : basic(TINFO_${CONTAINER_UC}) +${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 2 ex", LOGLEVEL_CONSTRUCT); @@ -348,7 +363,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2) : basic(TINFO_${CONTAIN } ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3) - : basic(TINFO_${CONTAINER_UC}) + : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 3 ex", LOGLEVEL_CONSTRUCT); @@ -359,7 +374,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3) } ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, - ex const & e4) : basic(TINFO_${CONTAINER_UC}) + ex const & e4) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 4 ex", LOGLEVEL_CONSTRUCT); @@ -371,7 +386,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, } ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, - ex const & e4, ex const & e5) : basic(TINFO_${CONTAINER_UC}) + ex const & e4, ex const & e5) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 5 ex", LOGLEVEL_CONSTRUCT); @@ -385,7 +400,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ex const & e4, ex const & e5, ex const & e6) - : basic(TINFO_${CONTAINER_UC}) + : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 6 ex", LOGLEVEL_CONSTRUCT); @@ -400,7 +415,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ex const & e4, ex const & e5, ex const & e6, - ex const & e7) : basic(TINFO_${CONTAINER_UC}) + ex const & e7) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 7 ex", LOGLEVEL_CONSTRUCT); @@ -416,7 +431,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ex const & e4, ex const & e5, ex const & e6, - ex const & e7, ex const & e8) : basic(TINFO_${CONTAINER_UC}) + ex const & e7, ex const & e8) : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 8 ex", LOGLEVEL_CONSTRUCT); @@ -434,7 +449,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ex const & e4, ex const & e5, ex const & e6, ex const & e7, ex const & e8, ex const & e9) - : basic(TINFO_${CONTAINER_UC}) + : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 9 ex", LOGLEVEL_CONSTRUCT); @@ -454,7 +469,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1, ex const & e2, ex const & e3, ex const & e4, ex const & e5, ex const & e6, ex const & e7, ex const & e8, ex const & e9, ex const &e10) - : basic(TINFO_${CONTAINER_UC}) + : basic(TINFO_${CONTAINER}) { debugmsg("${CONTAINER} constructor from 10 ex", LOGLEVEL_CONSTRUCT); @@ -832,6 +847,8 @@ unsigned ${CONTAINER}::precedence=10; const ${CONTAINER} some_${CONTAINER}; type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER}); +} // namespace GiNaC + END_OF_IMPLEMENTATION print "Creating interface file ${CONTAINER}.h...";