BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
LabeledCandidate.h
Go to the documentation of this file.
1#ifndef DCHAIN_LABELEDCANDIDATE_H
2#define DCHAIN_LABELEDCANDIDATE_H
3// -*- C++ -*-
4//
5// Package: DChain
6// Module: LabeledCandidate
7//
8// Description: pairing of subclass of Candidate and Conjugation::Label
9//
10// Usage:
11// <usage>
12//
13// Author: Simon Patton
14// Created: Wed Sep 18 14:47:30 EDT 1996
15// $Id: LabeledCandidate.h,v 1.1.1.1 2009/03/03 06:06:56 maqm Exp $: LabeledCandidate.h,v 1.6 1997/08/19 23:01:45 sjp Exp $
16//
17// Revision history
18//
19// $Log: LabeledCandidate.h,v $
20// Revision 1.1.1.1 2009/03/03 06:06:56 maqm
21// first import of DecayChain
22//
23// Revision 1.1 2006/01/11 20:28:08 cdj
24// massive class renaming, addition of [] for selection and unit tests
25//
26//
27
28// system include files
29
30// user include files
31#include "DecayChain/Element/conjugation.h" // enumerator
33
34// forward declarations
35namespace dchain {
36template < class CandidateClass >
38{
39 // friend classses and functions
40
41 public:
42 // constants, enums and typedefs
43
44 // Constructors and destructor
47 m_pointer( aOtherLabeled.m_pointer ) ,
48 m_label( aOtherLabeled.m_label )
49 {}
50 virtual ~LabeledCandidate() {}
51
52 // assignment operator(s)
54 {
55 m_pointer = aOtherLabeled.m_pointer ;
56 m_label = aOtherLabeled.m_label ;
57 return ( *this ) ;
58 }
59
60
61 // member functions
62
63 // const member functions
64// note: The following function can NOT be virtual as its return type changes
65// for CandidateClasses
66 const CandidateClass& operator()() const {
67 return ( *m_pointer ) ;
68 }
69
70//
71 const CandidateClass& labeledClass() const {
72 return ( *m_pointer ) ;
73 }
74
76 return ( m_label ) ;
77 }
78
79 bool operator==( const conjugation::Label& aLabel ) const {
80 return ( aLabel == m_label ) ;
81 }
82
83 bool operator!=( const conjugation::Label& aLabel ) const {
84 return ( aLabel != m_label ) ;
85 }
86
87
88 // static member functions
89
90 protected:
91 // Constructors and destructor
92 template<class THolder>
93 LabeledCandidate( THolder aCandidateClass ,
94 const conjugation::Label aLabel ) :
95 m_pointer(aCandidateClass),
96 m_label(aLabel) {}
97
98 // protected member functions
99 CandidateClass* pointer() {
100 return m_pointer.pointer();
101 }
102
103 // protected const member functions
104 const CandidateClass* pointer() const {
105 return ( m_pointer.pointer() ) ;
106 }
107
108
109 private:
110 // Constructors and destructor
111
112 // private member functions
113
114 // private const member functions
115
116 // data members
118 conjugation::Label m_label ;
119
120 // static data members
121
122} ;
123}
124
125#endif /* DCHAIN_LABELEDCANDIDATE_H */
bool operator!=(const conjugation::Label &aLabel) const
const CandidateClass & operator()() const
const CandidateClass * pointer() const
conjugation::Label label() const
const CandidateClass & labeledClass() const
LabeledCandidate(THolder aCandidateClass, const conjugation::Label aLabel)
CandidateClass * pointer()
const LabeledCandidate & operator=(const LabeledCandidate< CandidateClass > &aOtherLabeled)
bool operator==(const conjugation::Label &aLabel) const
LabeledCandidate(const LabeledCandidate< CandidateClass > &aOtherLabeled)