- switched to automake build environment
[ginac.git] / ginac / coloridx.h
1 /** @file coloridx.h
2  *
3  *  Interface to GiNaC's color indices. */
4
5 #ifndef _COLORIDX_H_
6 #define _COLORIDX_H_
7
8 #include <string>
9 #include <vector>
10
11 #include "idx.h"
12
13 class coloridx : public idx
14 {
15     friend class color;
16
17 // member functions
18
19     // default constructor, destructor, copy constructor assignment operator and helpers
20 public:
21     coloridx();
22     ~coloridx();
23     coloridx (coloridx const & other);
24     coloridx const & operator=(coloridx const & other);
25 protected:
26     void copy(coloridx const & other);
27     void destroy(bool call_parent);
28
29     // other constructors
30 public:
31     explicit coloridx(bool cov);
32     explicit coloridx(string const & n, bool cov=false);
33     explicit coloridx(char const * n, bool cov=false);
34     explicit coloridx(unsigned const v, bool cov=false); 
35
36     // functions overriding virtual functions from bases classes
37 public:
38     basic * duplicate() const;
39     void printraw(ostream & os) const;
40     void printtree(ostream & os, unsigned indent) const;
41     void print(ostream & os, unsigned upper_precedence=0) const;
42     bool info(unsigned inf) const;
43
44     // new virtual functions which can be overridden by derived classes
45     // none
46
47     // non-virtual functions in this class
48     // none
49
50     // member variables
51     // none
52 };
53
54 // global constants
55
56 extern const coloridx some_coloridx;
57 extern type_info const & typeid_coloridx;
58
59 // macros
60
61 #define ex_to_coloridx(X) (static_cast<coloridx const &>(*(X).bp))
62
63 #endif // ndef _COLORIDX_H_