IMP  2.3.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-29065/imp-2.3.1/tools/build/container_templates/container
7  * by tools/build/make_containers.py.
8  *
9  * Copyright 2007-2014 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 <boost/unordered_set.hpp>
19 
20 IMPCONTAINER_BEGIN_NAMESPACE
21 
22 //! Track statistics on a SingletonContainer
23 /** The current statistics are average and min/max occupancy. Other
24  statistics can be added on request, but we probably want to
25  restrict it to ones that are cheap to gather. */
26 class IMPCONTAINEREXPORT SingletonContainerStatistics : public ScoreState {
28  unsigned int total_;
29  unsigned int checks_;
30  unsigned int max_;
31  unsigned int min_;
32  bool track_unique_;
33  boost::unordered_set<kernel::Particle*> unique_;
34 
35  public:
36  SingletonContainerStatistics(SingletonContainerAdaptor c);
37  void show_statistics(std::ostream &out) const;
38  /** Keeping track of the number of unique entries seen is
39  expensive, so it is not done by default.
40  */
41  void set_track_unique(bool tf);
42  virtual void do_before_evaluate() IMP_OVERRIDE;
43  virtual void do_after_evaluate(DerivativeAccumulator *da) IMP_OVERRIDE;
47 };
48 
49 IMPCONTAINER_END_NAMESPACE
50 
51 #endif /* IMPCONTAINER_SINGLETON_CONTAINER_STATISTICS_H */
Class for adding derivatives from restraints to the model.
Import IMP/kernel/SingletonContainer.h in the namespace.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
A smart pointer to a reference counted object.
Definition: Pointer.h:87
ScoreStates maintain invariants in the Model.
Track statistics on a SingletonContainer.
Import IMP/kernel/ScoreState.h in the namespace.
virtual ModelObjectsTemp do_get_inputs() const =0
virtual ModelObjectsTemp do_get_outputs() const =0
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.