GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Parity.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef Gw_Parity
24 #define Gw_Parity
25 #define GW_PARITY_H Gw_Parity
26 
27 #ifndef GW_QNUMBER_H
28 #include "QNumber.h"
29 #endif
30 
31 #ifndef GW_INFODATA_H
32 #include <InfoData.h>
33 #endif
34 
35 // std includes
36 #include <iostream>
37 using namespace std;
38 
39 namespace Gw {
40 
46 class Parity : public QNumber, public InfoData
47 {
48 public:
49  enum EParity { kMinus = -1, kPlus = 1 } ;
50 
51 private:
52  Short_t fParity; // parity value
53 
54 public:
55  Parity();
56  Parity(const Parity &p) : QNumber(p), InfoData(p) { fParity = p.fParity; }
57  explicit Parity(Parity::EParity p) { Set(p); }
58  virtual ~Parity();
59 
61  virtual bool IsQNumber(QNumber::EQtype) const;
62 
63  void Set(Parity::EParity);
64  bool IsParity(Parity::EParity) const;
65 
67  virtual void Set(const char *s) ;
68 
70  Parity& operator*= (Parity& p);
71 
73  ClassDef(Parity,1); // the parity quantum number
74 };
75 // inline members
76 inline bool Parity::IsQNumber(QNumber::EQtype t) const { return kParity == t; }
77 inline void Parity::Set(Parity::EParity p) { fParity = p; }
78 inline bool Parity::IsParity(Parity::EParity p) const { return p == fParity; }
79 }
80 
82 std::ostream & operator << (std::ostream &, const Gw::Parity &);
83 #endif
header file for InfoData
Base class for a quantum number.
Definition: QNumber.h:43
EQtype
label type for any possible quantum number
Definition: QNumber.h:47
std::ostream & operator<<(std::ostream &os, const ADF::FactoryItem &item)
This class discribes a specific quantum number: the parity.
Definition: Parity.h:46
Parity(const Parity &p)
Definition: Parity.h:56
Base class to get/set some flag informations concerning any data.
Definition: InfoData.h:46
Parity(Parity::EParity p)
Definition: Parity.h:57
header file for a general quantum number (QNumber)