IMP Reference Guide
2.20.0
The Integrative Modeling Platform
|
A simple decorator which adds a name to a particle. More...
#include <IMP/example/ExampleDecorator.h>
A simple decorator which adds a name to a particle.
A decorator adds functionality to a particle and ensures that invariants are preserved. In this case, the functionality is the setting and access of a name for the Particle and the invariant is that the name is always non-empty.
The source code is as follows:
Definition at line 32 of file ExampleDecorator.h.
Public Member Functions | |
ExampleDecorator (::IMP::Model *m,::IMP::ParticleIndex id) | |
ExampleDecorator (const IMP::ParticleAdaptor &d) | |
std::string | get_decorator_name () const |
Get the name added to the particle. More... | |
void | set_decorator_name (std::string nm) |
Set the name added to the particle. More... | |
void | show (std::ostream &out=std::cout) const |
Public Member Functions inherited from IMP::Decorator | |
bool | get_is_valid () const |
Returns true if constructed with a non-default constructor. More... | |
Model * | get_model () const |
Returns the Model containing the particle. More... | |
Particle * | get_particle () const |
Returns the particle decorated by this decorator. More... | |
ParticleIndex | get_particle_index () const |
Returns the particle index decorated by this decorator. More... | |
operator Particle * () const | |
operator ParticleIndex () const | |
Particle * | operator-> () const |
Static Public Member Functions | |
static bool | get_is_setup (Model *m, ParticleIndex pi) |
return true if the particle has a name More... | |
static bool | get_is_setup (const IMP::ParticleAdaptor &p) |
static ExampleDecorator | setup_particle (Model *m, ParticleIndex pi, std::string name) |
static ExampleDecorator | setup_particle (IMP::ParticleAdaptor pa, std::string name) |
Additional Inherited Members | |
Protected Member Functions inherited from IMP::Decorator | |
Decorator (Model *m, ParticleIndex pi) | |
Decorator (ParticleAdaptor p) | |
std::string IMP::example::ExampleDecorator::get_decorator_name | ( | ) | const |
Get the name added to the particle.
Definition at line 58 of file ExampleDecorator.h.
|
static |
return true if the particle has a name
Definition at line 53 of file ExampleDecorator.h.
void IMP::example::ExampleDecorator::set_decorator_name | ( | std::string | nm | ) |
Set the name added to the particle.
Definition at line 63 of file ExampleDecorator.h.
|
static |
Definition at line 71 of file ExampleDecorator.h.
|
static |
Definition at line 71 of file ExampleDecorator.h.