CMS 3D CMS Logo

ExampleClass.cc
Go to the documentation of this file.
1 //#include "Utilities/Configuration/interface/Architecture.h"
2 
3 /* \file ExampleClass.cc
4  *
5  * $Date: $
6  * $Revision: $
7  * \author W. Woodpecker - CERN
8  */
9 
10 //#include "Subsystem/Package/interface/ExampleClass.h"
11 //#include "Subsystem/Package/interface/SomeAlgorithm.h"
12 
13 using namespace std;
14 
15 #include "ExampleClass.h"
17  public: SomeAlgorithm(){};
18 };
19 
20 
21 
22 // Constructor
24  theCount(0),
25  theAlgo(new SomeAlgorithm())
26 {}
27 
28 // Destructor
30  delete theAlgo;
31 }
32 
33 
34 // A simple setter
35 void ExampleClass::setCount(int ticks){
36  theCount = ticks;
37 }
38 
39 
40 // A simple getter
41 int ExampleClass::count() const{
42  return theCount;
43 }
44 
45 
46 
47 // Another setter
48 void ExampleClass::setValues(const vector<float>& entries) {
49  theValues = entries;
50 }
51 
52 
53 // A getter returning a const reference
54 const vector<float>& ExampleClass::values() const {
55  return theValues;
56 }
57 
58 
59 
60 // A member function
62  float result = 1.;
63  //... do all necessary computations...
64  return result;
65 }
66 
ExampleClass::~ExampleClass
virtual ~ExampleClass()
Virtual Destructor.
Definition: ExampleClass.cc:29
ExampleClass.h
ExampleClass::theCount
int theCount
Definition: ExampleClass.h:48
ExampleClass::count
int count() const
A simple getter.
Definition: ExampleClass.cc:41
ExampleClass::setValues
void setValues(const std::vector< float > &entries)
Another setter.
Definition: ExampleClass.cc:48
ExampleClass::theAlgo
SomeAlgorithm * theAlgo
Definition: ExampleClass.h:50
SomeAlgorithm
Definition: ExampleClass.cc:16
ExampleClass::theValues
std::vector< float > theValues
Definition: ExampleClass.h:49
ExampleClass::values
const std::vector< float > & values() const
A getter returning a const reference.
Definition: ExampleClass.cc:54
ExampleClass::ExampleClass
ExampleClass()
Constructor.
Definition: ExampleClass.cc:23
ExampleClass::setCount
void setCount(int ticks)
A simple setter.
Definition: ExampleClass.cc:35
std
Definition: JetResolutionObject.h:76
mps_fire.result
result
Definition: mps_fire.py:311
ExampleClass::computeMean
float computeMean() const
A member function.
Definition: ExampleClass.cc:61
SomeAlgorithm::SomeAlgorithm
SomeAlgorithm()
Definition: ExampleClass.cc:17