MultiTimeDistribution.h
Go to the documentation of this file.
1 #ifndef _utl_MultiTimeDistribution_h_
2 #define _utl_MultiTimeDistribution_h_
3 
4 #include <utl/TimeDistribution.h>
5 #include <utl/MultiObject.h>
6 
7 
8 namespace utl {
9 
10  template<typename T>
11  class LabeledTimeDistribution : public LabeledObject<TimeDistribution<T> > {
12 
13  public:
15  LabeledObject<TimeDistribution<T> >(label, td) { }
16 
17  LabeledTimeDistribution(const std::pair<int, TimeDistribution<T>*> pair) :
18  LabeledObject<TimeDistribution<T> >(pair) { }
19 
24 
25  };
26 
27 
53  template<typename T>
55  public MultiObject<TimeDistribution<T>, LabeledTimeDistribution<T> > {
56 
57  public:
61  const TimeDistribution<T>& GetTimeDistribution(const int label = 0) const
63 
66  void AddTimeDistribution(const double binSize, const int label)
67  { this->AddObject(new TimeDistribution<T>(binSize), label); }
68 
71  void AddTimeDistribution(const TimeDistribution<T>& td, const int label)
72  { this->AddObject(td, label); }
73 
74  };
75 
76  // To keep the forward declarations consistent
77  // modify TimeDistribution-fwd when chaniging/adding below
78 
81 
82 }
83 
84 
85 #endif
void AddTimeDistribution(const double binSize, const int label)
TimeDistribution< T > & GetTimeDistribution()
A collection of TimeDistribution&lt;T&gt;,which provides methods to access different sources.
Histogram class for time distributions with suppressed empty bins.
LabeledTimeDistribution(const int label, TimeDistribution< T > &td)
utl::MultiTimeDistribution< double > MultiTimeDistributionD
TimeDistribution< T > & GetTimeDistribution(const int label=0)
Returns the trace for /par source.
TimeDistribution< T > & GetObject()
Definition: MultiObject.h:42
const TimeDistribution< T > & GetTimeDistribution(const int label=0) const
container for object and associated labels
Definition: MultiObject.h:71
utl::MultiTimeDistribution< int > MultiTimeDistributionI
LabeledTimeDistribution(const std::pair< int, TimeDistribution< T > * > pair)
const TimeDistribution< T > & GetTimeDistribution() const
void AddTimeDistribution(const TimeDistribution< T > &td, const int label)
Class for attaching a label to an object.
Definition: MultiObject.h:22
void AddObject(const TimeDistribution< T > &obj, const int label)
add with deep copy of the object
Definition: MultiObject.h:128

, generated on Tue Sep 26 2023.