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 
void setValues(const std::vector< float > &entries)
Another setter.
Definition: ExampleClass.cc:48
float computeMean() const
A member function.
Definition: ExampleClass.cc:61
std::vector< float > theValues
Definition: ExampleClass.h:49
int count() const
A simple getter.
Definition: ExampleClass.cc:41
ExampleClass()
Constructor.
Definition: ExampleClass.cc:23
const std::vector< float > & values() const
A getter returning a const reference.
Definition: ExampleClass.cc:54
SomeAlgorithm * theAlgo
Definition: ExampleClass.h:50
void setCount(int ticks)
A simple setter.
Definition: ExampleClass.cc:35
virtual ~ExampleClass()
Virtual Destructor.
Definition: ExampleClass.cc:29