IMP
2.1.1
The Integrative Modeling Platform
|
A simple decorator which adds a name to a particle. More...
#include <IMP/example/ExampleDecorator.h>
Public Member Functions | |
ExampleDecorator (::IMP::kernel::Model *m,::IMP::kernel::ParticleIndex id) | |
ExampleDecorator (const IMP::kernel::ParticleAdaptor &d) | |
std::string | get_decorator_name () const |
Get the name added to the particle. | |
void | set_decorator_name (std::string nm) |
Set the name added to the particle. | |
void | show (std::ostream &out=std::cout) const |
Public Member Functions inherited from IMP::kernel::Decorator | |
ParticleIndex | get_particle_index () const |
Particle * | get_particle () const |
Model * | get_model () const |
Returns the Model containing the particle. | |
Decorator (Particle *p) | |
Decorator () | |
Static Public Member Functions | |
static ExampleDecorator | decorate_particle (::IMP::kernel::Particle *p) |
static bool | get_is_setup (kernel::Model *m, kernel::ParticleIndex pi) |
return true if the particle has a name | |
static bool | get_is_setup (const IMP::kernel::ParticleAdaptor &p) |
static bool | particle_is_instance (IMP::kernel::Model *m, IMP::kernel::ParticleIndex pi) |
static bool | particle_is_instance (::IMP::kernel::Particle *p) |
static ExampleDecorator | setup_particle (kernel::Model *m, ParticleIndex pi, std::string name) |
static ExampleDecorator | setup_particle (IMP::kernel::ParticleAdaptor decorator, std::string name) |
Static Public Member Functions inherited from IMP::kernel::Decorator | |
static bool | get_is_setup (Particle *p) |
Return true if the particle can be cast to the decorator. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from IMP::kernel::Decorator | |
Decorator (kernel::Model *m, ParticleIndex pi) | |
Decorator (ParticleAdaptor p) | |
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 kernel::Particle and the invariant is that the name is always non-empty.
The source code is as follows:
Definition at line 31 of file ExampleDecorator.h.
|
static |
Definition at line 68 of file ExampleDecorator.h.
|
static |
Definition at line 68 of file ExampleDecorator.h.
|
static |
Definition at line 68 of file ExampleDecorator.h.
|
static |
Setup the particle so it can be used with this decorator.
Definition at line 69 of file ExampleDecorator.h.