IMP  2.0.0
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-5687/imp-2.0.0/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/compatibility/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
28 {
30  unsigned int total_;
31  unsigned int checks_;
32  unsigned int max_;
33  unsigned int min_;
34  bool track_unique_;
35  IMP::compatibility::set<Particle*> unique_;
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);
44 };
45 
46 
47 IMPCONTAINER_END_NAMESPACE
48 
49 #endif /* IMPCONTAINER_SINGLETON_CONTAINER_STATISTICS_H */