IMP  2.1.1
The Integrative Modeling Platform
SingletonContainerStatistics.h
Go to the documentation of this file.
1 /**
2  * \file IMP/container/SingletonContainerStatistics.h
3  * \brief A container for Singletons.
4  *
5  * WARNING This file was generated from SingletonContainerStatistics.h
6  * in /tmp/nightly-build-61576/imp-2.1.1/tools/build/container_templates/container
7  * by tools/maintenance/setup_containers.py.
8  *
9  * Copyright 2007-2013 IMP Inventors. All rights reserved.
10  */
11 
12 #ifndef IMPCONTAINER_SINGLETON_CONTAINER_STATISTICS_H
13 #define IMPCONTAINER_SINGLETON_CONTAINER_STATISTICS_H
14 
15 #include <IMP/container/container_config.h>
16 #include <IMP/SingletonContainer.h>
17 #include <IMP/ScoreState.h>
18 #include <IMP/score_state_macros.h>
19 #include <IMP/base/set.h>
20 
21 IMPCONTAINER_BEGIN_NAMESPACE
22 
23 //! Track statistics on a SingletonContainer
24 /** The current statistics are average and min/max occupancy. Other
25  statistics can be added on request, but we probably want to
26  restrict it to ones that are cheap to gather. */
27 class IMPCONTAINEREXPORT SingletonContainerStatistics : public ScoreState {
29  unsigned int total_;
30  unsigned int checks_;
31  unsigned int max_;
32  unsigned int min_;
33  bool track_unique_;
35 
36  public:
37  SingletonContainerStatistics(SingletonContainerAdaptor c);
38  void show_statistics(std::ostream &out) const;
39  /** Keeping track of the number of unique entries seen is
40  expensive, so it is not done by default.
41  */
42  void set_track_unique(bool tf);
43  virtual void do_before_evaluate() IMP_OVERRIDE;
44  virtual void do_after_evaluate(DerivativeAccumulator *da) IMP_OVERRIDE;
45  virtual kernel::ModelObjectsTemp do_get_inputs() const IMP_OVERRIDE;
46  virtual kernel::ModelObjectsTemp do_get_outputs() const IMP_OVERRIDE;
48 };
49 
50 IMPCONTAINER_END_NAMESPACE
51 
52 #endif /* IMPCONTAINER_SINGLETON_CONTAINER_STATISTICS_H */
Class for adding derivatives from restraints to the model.
Import IMP/kernel/SingletonContainer.h in the namespace.
A smart pointer to a reference counted object.
Definition: base/Pointer.h:87
ScoreStates maintian invariants in the Model.
Track statistics on a SingletonContainer.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Import IMP/kernel/ScoreState.h in the namespace.
Import IMP/kernel/score_state_macros.h in the namespace.
virtual ModelObjectsTemp do_get_inputs() const =0
Declare an efficient stl-compatible set.
virtual ModelObjectsTemp do_get_outputs() const =0