]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.h
- modified GiNaC headers to Alexander's liking
[ginac.git] / ginac / basic.h
index 943939041d442ffa5e681c8f6ab2d22de0a4c789..ebc130f761ce713c3c241a234d597deb2f413f68 100644 (file)
 #include <typeinfo>
 #include <vector>
 
+#include <ginac/flags.h>
+#include <ginac/tinfos.h>
+#include <ginac/debugmsg.h>
+
 class basic;
 class ex;
 class symbol;
@@ -48,7 +52,7 @@ class basic
 public:
     basic()
 #ifdef INLINE_BASIC_CONSTRUCTORS
-    : tinfo_key(TINFO_BASIC), flags(0), refcount(0)
+    : tinfo_key(TINFO_basic), flags(0), refcount(0)
     {
         debugmsg("basic default constructor",LOGLEVEL_CONSTRUCT);
         // nothing to do
@@ -177,42 +181,19 @@ extern type_info const & typeid_basic;
 
 extern int max_recursion_level;
 
-/*
-#ifndef _DEBUG
-*/
+// convenience macros
+
 #define is_of_type(OBJ,TYPE) \
     (dynamic_cast<TYPE *>(const_cast<basic *>(&OBJ))!=0)
 
-/*
 #define is_exactly_of_type(OBJ,TYPE) \
-    (typeid(OBJ)==typeid(some_##TYPE))
-*/
-#define is_exactly_of_type(OBJ,TYPE) \
-    ((OBJ).tinfo()==(some_##TYPE).tinfo())
-
-
-    /*
-#else 
-#define is_of_type(OBJ,TYPE)                               \
-    (ASSERT(typeid(OBJ)!=typeid(exZERO())),                \
-     (dynamic_cast<TYPE *>(const_cast<basic *>(&OBJ))!=0))
-
-#define is_exactly_of_type(OBJ,TYPE)                       \
-    (ASSERT(typeid(OBJ)!=typeid(exZERO())),                \
-     (typeid(OBJ)==typeid(some_##TYPE))
-#endif // ndef _DEBUG
-*/
+    ((OBJ).tinfo()==TINFO_##TYPE)
 
 #define is_ex_of_type(OBJ,TYPE) \
     (dynamic_cast<TYPE *>(const_cast<basic *>((OBJ).bp))!=0)
 
-/*
-#define is_ex_exactly_of_type(OBJ,TYPE) \
-    (typeid(*(OBJ).bp)==typeid(some_##TYPE))
-*/
-
 #define is_ex_exactly_of_type(OBJ,TYPE) \
-    ((*(OBJ).bp).tinfo()==(some_##TYPE).tinfo())
+    ((*(OBJ).bp).tinfo()==TINFO_##TYPE)
 
 #define are_ex_trivially_equal(EX1,EX2) \
     ((EX1).bp==(EX2).bp)