SST  6.0.0
StructuralSimulationToolkit
statnull.h
1 // Copyright 2009-2016 Sandia Corporation. Under the terms
2 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2016, Sandia Corporation
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 
12 
13 #ifndef _H_SST_CORE_NULL_STATISTIC_
14 #define _H_SST_CORE_NULL_STATISTIC_
15 
16 #include <sst/core/sst_types.h>
17 
18 #include <sst/core/component.h>
19 #include <sst/core/statapi/statbase.h>
20 
21 namespace SST {
22 namespace Statistics {
23 
24 // NOTE: When calling base class members of classes derived from
25 // a templated base class. The user must use "this->" in
26 // order to call base class members (to avoid a compilier
27 // error) because they are "nondependant named" and the
28 // templated base class is a "dependant named". The
29 // compilier will not look in dependant named base classes
30 // when looking up independant names.
31 // See: http://www.parashift.com/c++-faq-lite/nondependent-name-lookup-members.html
32 
33 /**
34  \class NullStatistic
35 
36  An empty statistic place holder.
37 
38  @tparam T A template for holding the main data type of this statistic
39 */
40 
41 template <typename T>
42 class NullStatistic : public Statistic<T>
43 {
44 private:
45  friend class SST::Component;
46 
47  NullStatistic(Component* comp, std::string& statName, std::string& statSubId, Params& statParams)
48  : Statistic<T>(comp, statName, statSubId, statParams)
49  {
50  // Set the Name of this Statistic
51  this->setStatisticTypeName("NULL");
52  }
53 
54  ~NullStatistic(){};
55 
56 protected:
57  void addData_impl(T data)
58  {
59  // Do Nothing
60  }
61 
62 private:
63  void clearStatisticData()
64  {
65  // Do Nothing
66  }
67 
68  void registerOutputFields(StatisticOutput* statOutput)
69  {
70  // Do Nothing
71  }
72 
73  void outputStatisticData(StatisticOutput* statOutput, bool EndOfSimFlag)
74  {
75  // Do Nothing
76  }
77 
78  bool isReady() const
79  {
80  return true;
81  }
82 
83  bool isNullStatistic() const
84  {
85  return true;
86  }
87 
88 private:
89 };
90 
91 } //namespace Statistics
92 } //namespace SST
93 
94 #endif
Forms the base class for statistics output generation within the SST core.
Definition: statoutput.h:47
Main component object for the simulation.
Definition: component.h:56
void setStatisticTypeName(const char *typeName)
Set an optional Statistic Type Name.
Definition: statbase.h:177
Definition: action.cc:17
Forms the template defined base class for statistics gathering within SST.
Definition: statbase.h:263
Parameter store.
Definition: params.h:46
An empty statistic place holder.
Definition: statnull.h:42