]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.h
symbol: make get_domain() a virtual method, remove symbol::domain.
[ginac.git] / ginac / structure.h
index d00100b13ab60e156a10f1ca9c80b8c40fbcad10..3987d8068577aaf7c75d59c6f3c2ea2f622df09d 100644 (file)
@@ -117,14 +117,12 @@ class structure : public basic, public ComparisonPolicy<T> {
        GINAC_DECLARE_REGISTERED_CLASS(structure, basic)
 
        // helpers
-       static tinfo_t get_tinfo() { return reg_info.options.get_id(); }
        static const char *get_class_name() { return "structure"; }
-       static tinfo_t next_structure_tinfo_key() { return new tinfo_static_t; }
 
        // constructors
 public:
        /** Construct structure as a copy of a given C++ structure. */
-       structure(const T & t) : inherited(get_tinfo()), obj(t) { }
+       structure(const T & t) : obj(t) { }
 
        // functions overriding virtual functions from base classes
        // All these are just defaults that can be specialized by the user
@@ -200,7 +198,13 @@ public:
 
        // noncommutativity
        unsigned return_type() const { return return_types::commutative; }
-       tinfo_t return_type_tinfo() const { return this; }
+       return_type_t return_type_tinfo() const 
+       {
+               return_type_t r;
+               r.rl = 0;
+               r.tinfo = &typeid(*this);
+               return r;
+       }
 
 protected:
        bool is_equal_same_type(const basic & other) const
@@ -226,7 +230,7 @@ private:
 
 /** Default constructor */
 template <class T, template <class> class CP>
-structure<T, CP>::structure() : inherited(get_tinfo()) { }
+structure<T, CP>::structure() { }
 
 /** Construct object from archive_node. */
 template <class T, template <class> class CP>
@@ -257,7 +261,7 @@ int structure<T, CP>::compare_same_type(const basic & other) const
 }
 
 template <class T, template <class> class CP>
-registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", structure::next_structure_tinfo_key(), &structure::unarchive));
+registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", typeid(structure<T, CP>), &structure::unarchive));
 
 
 } // namespace GiNaC