9 #ifndef IMPKERNEL_CONFIGURATION_H
10 #define IMPKERNEL_CONFIGURATION_H
12 #include <IMP/kernel_config.h>
16 #include <cereal/access.hpp>
17 #include <cereal/types/base_class.hpp>
19 IMPKERNEL_BEGIN_NAMESPACE
25 internal::FloatAttributeTable floats_;
26 internal::FloatsAttributeTable float_lists_;
27 internal::StringAttributeTable strings_;
28 internal::IntAttributeTable ints_;
29 internal::ObjectAttributeTable objects_;
30 internal::WeakObjectAttributeTable weak_objects_;
31 internal::IntsAttributeTable int_lists_;
32 internal::ObjectsAttributeTable object_lists_;
33 internal::ParticleAttributeTable particles_;
34 internal::ParticlesAttributeTable particle_lists_;
35 internal::Vector3DAttributeTable vector3ds_;
36 internal::Vector4DAttributeTable vector4ds_;
37 internal::SparseStringAttributeTable sparse_strings_;
38 internal::SparseIntAttributeTable sparse_ints_;
39 internal::SparseFloatAttributeTable sparse_floats_;
40 internal::SparseParticleAttributeTable sparse_particles_;
41 internal::Vector3DDerivAttributeTable vector3d_derivs_;
42 internal::Vector4DDerivAttributeTable vector4d_derivs_;
44 friend class cereal::access;
45 template<
class Archive>
void serialize(Archive &ar) {
46 ar(cereal::base_class<Object>(
this));
47 if (std::is_base_of<cereal::detail::OutputArchiveBase, Archive>::value) {
48 uint32_t model_id = get_model_id();
53 set_model_from_id(model_id);
55 ar(base_, floats_, float_lists_, strings_, ints_, objects_, weak_objects_,
56 int_lists_, object_lists_, particles_, particle_lists_, vector3ds_,
57 vector4ds_, sparse_strings_, sparse_ints_, sparse_floats_,
58 sparse_particles_, vector3d_derivs_, vector4d_derivs_);
60 void set_model_from_id(uint32_t model_id);
61 uint32_t get_model_id()
const;
69 std::string name =
"Configuration %1%");
73 void load_configuration()
const;
77 void swap_configuration();
83 IMPKERNEL_END_NAMESPACE
A class to store a configuration of a model.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Storage of a model, its restraints, constraints and particles.
A more IMP-like version of the std::vector.
A smart pointer to a reference counted object.
Class for storing model, its restraints, constraints, and particles.
Common base class for heavy weight IMP objects.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
A nullptr-initialized pointer to an IMP Object.
A shared base class to help in debugging and things.
Object(std::string name)
Construct an object with the given name.