]> www.ginac.de Git - ginac.git/blob - ginac/coloridx.h
- enforced GiNaC coding standards :-)
[ginac.git] / ginac / coloridx.h
1 /** @file coloridx.h
2  *
3  *  Interface to GiNaC's color indices.
4  *
5  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (at your option) any later version.
11  *
12  *  This program is distributed in the hope that it will be useful,
13  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *  GNU General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20  */
21
22 #ifndef __GINAC_COLORIDX_H__
23 #define __GINAC_COLORIDX_H__
24
25 #include <string>
26 #include <vector>
27
28 class coloridx : public idx
29 {
30     friend class color;
31
32 // member functions
33
34     // default constructor, destructor, copy constructor assignment operator and helpers
35 public:
36     coloridx();
37     ~coloridx();
38     coloridx (coloridx const & other);
39     coloridx const & operator=(coloridx const & other);
40 protected:
41     void copy(coloridx const & other);
42     void destroy(bool call_parent);
43
44     // other constructors
45 public:
46     explicit coloridx(bool cov);
47     explicit coloridx(string const & n, bool cov=false);
48     explicit coloridx(char const * n, bool cov=false);
49     explicit coloridx(unsigned const v, bool cov=false); 
50
51     // functions overriding virtual functions from bases classes
52 public:
53     basic * duplicate() const;
54     void printraw(ostream & os) const;
55     void printtree(ostream & os, unsigned indent) const;
56     void print(ostream & os, unsigned upper_precedence=0) const;
57     bool info(unsigned inf) const;
58
59     // new virtual functions which can be overridden by derived classes
60     // none
61
62     // non-virtual functions in this class
63     // none
64
65     // member variables
66     // none
67 };
68
69 // global constants
70
71 extern const coloridx some_coloridx;
72 extern type_info const & typeid_coloridx;
73
74 // macros
75
76 #define ex_to_coloridx(X) (static_cast<coloridx const &>(*(X).bp))
77
78 #endif // ndef __GINAC_COLORIDX_H__