]> www.ginac.de Git - ginac.git/blobdiff - ginac/container.pl
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / container.pl
index d7b860bc586d8290fd25a7bbbf14ca63f8aa5f6a..7a7b3e9dbe262faa684998b4eb3c778827acfa42 100755 (executable)
@@ -89,7 +89,9 @@ END_OF_LET_OP_IMPLEMENTATION
 $interface=<<END_OF_INTERFACE;
 /** \@file ${CONTAINER}.h
  *
 $interface=<<END_OF_INTERFACE;
 /** \@file ${CONTAINER}.h
  *
- *  Definition of GiNaC's ${CONTAINER}. 
+ *  Definition of GiNaC's ${CONTAINER}. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
@@ -98,14 +100,33 @@ $interface=<<END_OF_INTERFACE;
  *                        \$prepend=${prepend}
  *                        \$let_op=${let_op}
  *                        \$open_bracket=${open_bracket}
  *                        \$prepend=${prepend}
  *                        \$let_op=${let_op}
  *                        \$open_bracket=${open_bracket}
- *                        \$close_bracket=${close_bracket} */
+ *                        \$close_bracket=${close_bracket}
+ *
+ *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 
-#ifndef _${CONTAINER_UC}_H_
-#define _${CONTAINER_UC}_H_
+#ifndef __GINAC_${CONTAINER_UC}_H__
+#define __GINAC_${CONTAINER_UC}_H__
 
 #include <${STLHEADER}>
 
 #include <${STLHEADER}>
+#include <ginac/basic.h>
+#include <ginac/ex.h>
 
 
-#include <ginac/ginac.h>
+namespace GiNaC {
 
 typedef ${STLHEADER}<ex> ${STLT};
 
 
 typedef ${STLHEADER}<ex> ${STLT};
 
@@ -196,18 +217,24 @@ protected:
 extern const ${CONTAINER} some_${CONTAINER};
 extern type_info const & typeid_${CONTAINER};
 
 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<const ${CONTAINER} &>(*e.bp);
+}
 
 
-#define ex_to_${CONTAINER}(X) (static_cast<${CONTAINER} const &>(*(X).bp))
+} // namespace GiNaC
 
 
-#endif // ndef _${CONTAINER_UC}_H_
+#endif // ndef __GINAC_${CONTAINER_UC}_H__
 
 END_OF_INTERFACE
 
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${CONTAINER}.cpp
  *
 
 END_OF_INTERFACE
 
 $implementation=<<END_OF_IMPLEMENTATION;
 /** \@file ${CONTAINER}.cpp
  *
- *  Implementation of GiNaC's ${CONTAINER}. 
+ *  Implementation of GiNaC's ${CONTAINER}. */
+
+/*
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
  *  This file was generated automatically by container.pl.
  *  Please do not modify it directly, edit the perl script instead!
  *  container.pl options: \$CONTAINER=${CONTAINER}
@@ -216,12 +243,33 @@ $implementation=<<END_OF_IMPLEMENTATION;
  *                        \$prepend=${prepend}
  *                        \$let_op=${let_op}
  *                        \$open_bracket=${open_bracket}
  *                        \$prepend=${prepend}
  *                        \$let_op=${let_op}
  *                        \$open_bracket=${open_bracket}
- *                        \$close_bracket=${close_bracket} */
+ *                        \$close_bracket=${close_bracket}
+ *
+ *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 #include <iostream>
 #include <stdexcept>
 
 
 #include <iostream>
 #include <stdexcept>
 
-#include "ginac.h"
+#include "${CONTAINER}.h"
+#include "ex.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 ${RESERVE_IMPLEMENTATION}
 
 
 ${RESERVE_IMPLEMENTATION}
 
@@ -231,7 +279,7 @@ ${RESERVE_IMPLEMENTATION}
 
 // public
 
 
 // public
 
-${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER_UC})
+${CONTAINER}::${CONTAINER}() : basic(TINFO_${CONTAINER})
 {
     debugmsg("${CONTAINER} default constructor",LOGLEVEL_CONSTRUCT);
 }
 {
     debugmsg("${CONTAINER} default constructor",LOGLEVEL_CONSTRUCT);
 }
@@ -278,7 +326,7 @@ void ${CONTAINER}::destroy(bool call_parent)
 
 // public
 
 
 // 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);
 {
     debugmsg("${CONTAINER} constructor from ${STLT}",
              LOGLEVEL_CONSTRUCT);
@@ -289,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);
 {
     debugmsg("${CONTAINER} constructor from ${STLT} *",LOGLEVEL_CONSTRUCT);
     ASSERT(vp!=0);
@@ -297,7 +345,7 @@ ${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER_UC})
     delete vp;
 }
 
     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);
 {
     debugmsg("${CONTAINER} constructor from 1 ex",
              LOGLEVEL_CONSTRUCT);
@@ -305,7 +353,7 @@ ${CONTAINER}::${CONTAINER}(ex const & e1) :  basic(TINFO_${CONTAINER_UC})
     seq.push_back(e1);
 }
 
     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);
 {
     debugmsg("${CONTAINER} constructor from 2 ex",
              LOGLEVEL_CONSTRUCT);
@@ -315,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)
 }
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 3 ex",
              LOGLEVEL_CONSTRUCT);
@@ -326,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,
 }
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 4 ex",
              LOGLEVEL_CONSTRUCT);
@@ -338,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,
 }
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 5 ex",
              LOGLEVEL_CONSTRUCT);
@@ -352,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)
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 6 ex",
              LOGLEVEL_CONSTRUCT);
@@ -367,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,
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 7 ex",
              LOGLEVEL_CONSTRUCT);
@@ -383,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,
 
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 8 ex",
              LOGLEVEL_CONSTRUCT);
@@ -401,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)
 ${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);
 {
     debugmsg("${CONTAINER} constructor from 9 ex",
              LOGLEVEL_CONSTRUCT);
@@ -421,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)
                      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);
 {
     debugmsg("${CONTAINER} constructor from 10 ex",
              LOGLEVEL_CONSTRUCT);
@@ -799,6 +847,8 @@ unsigned ${CONTAINER}::precedence=10;
 const ${CONTAINER} some_${CONTAINER};
 type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
 
 const ${CONTAINER} some_${CONTAINER};
 type_info const & typeid_${CONTAINER}=typeid(some_${CONTAINER});
 
+} // namespace GiNaC
+
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${CONTAINER}.h...";
 END_OF_IMPLEMENTATION
 
 print "Creating interface file ${CONTAINER}.h...";