X-Git-Url: https://ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fstructure.h;h=12b86d1c4a1b8f6c7f241e82b25c47ce5d1caac8;hb=9d8d0f4924171b0acb7ec6a333897fe1ec545707;hp=358e6ce65a4adb55ac5384172fca39e24cabb7cf;hpb=bd2d7351b89743eb68ce7d3bfa7ab62c331f9522;p=ginac.git diff --git a/ginac/structure.h b/ginac/structure.h index 358e6ce6..12b86d1c 100644 --- a/ginac/structure.h +++ b/ginac/structure.h @@ -3,7 +3,7 @@ * Interface to 'abstract' class structure. */ /* - * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2001 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 @@ -25,69 +25,48 @@ #include "basic.h" -#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_NAMESPACE_GINAC struct registered_structure_info { - const char * name; + const char * name; }; /** The class structure is used to implement user defined classes - with named members which behave similar to ordinary C structs. - structure is an 'abstract' base class (it is possible but not - meaningful to make instances), the user defined structures - will be create by the perl script structure.pl */ + with named members which behave similar to ordinary C structs. + structure is an 'abstract' base class (it is possible but not + meaningful to make instances), the user defined structures + will be create by the perl script structure.pl */ class structure : public basic { -// member functions + GINAC_DECLARE_REGISTERED_CLASS(structure, basic) + + // other ctors + // none - // default constructor, destructor, copy constructor assignment operator and helpers + // functions overriding virtual functions from bases classes public: - structure(); - ~structure(); - structure(const structure & other); - const structure & operator=(const structure & other); + void printraw(std::ostream & os) const; + void print(std::ostream & os, unsigned upper_precedence=0) const; + void printtree(std::ostream & os, unsigned indent) const; + void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const; protected: - void copy(const structure & other); - void destroy(bool call_parent); - - // other constructors - // none - - // functions overriding virtual functions from bases classes -public: - basic * duplicate() const; - void printraw(std::ostream & os) const; - void print(std::ostream & os, unsigned upper_precedence=0) const; - void printtree(std::ostream & os, unsigned indent) const; - void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const; + bool is_equal_same_type(const basic & other) const; + + // new virtual functions which can be overridden by derived classes + // none + + // non-virtual functions in this class protected: - int compare_same_type(const basic & other) const; - bool is_equal_same_type(const basic & other) const; - - // new virtual functions which can be overridden by derived classes - // none - - // non-virtual functions in this class -protected: - static std::vector & registered_structures(void); + static std::vector & registered_structures(void); public: - static unsigned register_new(const char * nm); + static unsigned register_new(const char * nm); // member variables // none }; -// global constants - -extern const structure some_structure; -extern const type_info & typeid_structure; - -#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_NAMESPACE_GINAC #endif // ndef __GINAC_STRUCTURE_H__