8 #ifndef IMPATOM_STRUCTURE_SOURCE_H
9 #define IMPATOM_STRUCTURE_SOURCE_H
11 #include <IMP/atom/atom_config.h>
19 IMPATOM_BEGIN_NAMESPACE
25 static StringKey get_source_chain_id_key();
27 std::string source_id,
28 std::string source_chain_id) {
29 IMP_USAGE_CHECK(!source_id.empty(),
"The structure ID cannot be empty.");
31 m->
add_attribute(get_source_chain_id_key(), pi, source_chain_id);
36 return (m->get_has_attribute(get_source_id_key(), pi) &&
37 m->get_has_attribute(get_source_chain_id_key(), pi));
46 return get_particle()->get_value(get_source_chain_id_key());
51 IMP_USAGE_CHECK(!source_id.empty(),
"The structure ID cannot be empty");
52 get_particle()->set_value(get_source_id_key(), source_id);
57 get_particle()->set_value(get_source_chain_id_key(), source_chain_id);
63 std::string, source_chain_id);
The base class for decorators.
Storage of a model, its restraints, constraints and particles.
Exception definitions and assertions.
Class for storing model, its restraints, constraints, and particles.
std::string get_source_id() const
Get the source ID.
Store strings describing the source of this structure fragment.
void set_source_id(std::string source_id)
Set the structure ID.
void add_attribute(TypeKey attribute_key, ParticleIndex particle, Type value)
Various general useful macros for IMP.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
std::string get_source_chain_id() const
Get the source ID.
Particle * get_particle() const
Returns the particle decorated by this decorator.
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
#define IMP_DECORATOR_METHODS(Name, Parent)
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
void set_source_chain_id(std::string source_chain_id)
Set the structure ID.