IMP  2.0.0
The Integrative Modeling Platform
kernel/Configuration.h
Go to the documentation of this file.
1 /**
2  * \file IMP/kernel/Configuration.h
3  * \brief Store a set of configurations of the model.
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  *
7  */
8 
9 #ifndef IMPKERNEL_CONFIGURATION_H
10 #define IMPKERNEL_CONFIGURATION_H
11 
12 #include <IMP/kernel/kernel_config.h>
13 #include "Object.h"
14 #include "Pointer.h"
15 #include "Model.h"
16 #include <IMP/base/map.h>
17 
18 IMPKERNEL_BEGIN_NAMESPACE
19 
20 
21 //! A class to store a configuration of a model
22 /** */
23 class IMPKERNELEXPORT Configuration: public IMP::base::Object
24 {
25  mutable Pointer<Model> model_;
26  Pointer<Object> base_;
27  internal::FloatAttributeTable floats_;
28  internal::StringAttributeTable strings_;
29  internal::IntAttributeTable ints_;
30  internal::ObjectAttributeTable objects_;
31  internal::WeakObjectAttributeTable weak_objects_;
32  internal::IntsAttributeTable int_lists_;
33  internal::ObjectsAttributeTable object_lists_;
34  internal::ParticleAttributeTable particles_;
35  internal::ParticlesAttributeTable particle_lists_;
36  public:
37  Configuration(Model *m, std::string name="Configuration %1%");
38  //! Only store parts of the configuration that have changed from base
39  /** At the moment, this does not play well with adding and removing
40  attributes.*/
42  std::string name="Configuration %1%");
43  void load_configuration() const;
44  //! Swap the current configuration with that in the Model
45  /** This should be faster than loading (or at least not slower.
46  */
47  void swap_configuration();
49 };
50 
52 
53 IMPKERNEL_END_NAMESPACE
54 
55 #endif /* IMPKERNEL_CONFIGURATION_H */