#include <property.h>
Inheritance diagram for PropertyManager:
Public Member Functions | |
Constructors and Destructors | |
PropertyManager () throw () | |
Default constructor. | |
PropertyManager (const PropertyManager &property_manager) throw () | |
Copy constructor. | |
virtual | ~PropertyManager () throw () |
Destructor. | |
virtual void | clear () throw () |
Clears all properties. | |
virtual void | destroy () throw () |
Clears all properties. | |
Assignment | |
void | set (const PropertyManager &property_manager) throw () |
Assign properties from another property manager. | |
const PropertyManager & | operator= (const PropertyManager &property_manager) throw () |
Assignment operator. | |
void | get (PropertyManager &property_manager) const throw () |
Assign properties to another property manager. | |
void | swap (PropertyManager &property_manager) throw () |
Swap the properties with another property manager. | |
Accessors | |
BitVector & | getBitVector () throw () |
Return a mutable reference to the bit vector. | |
const BitVector & | getBitVector () const throw () |
Return a const reference to the bit vector containing the unnamed properties. | |
Converters | |
operator BitVector & () throw () | |
Converter to BitVector. | |
Handling unnamed bit properties | |
void | setProperty (Property property) throw () |
Set a property. | |
void | clearProperty (Property property) throw () |
Clear a property. | |
void | toggleProperty (Property property) throw () |
Toggle (invert) a property. | |
Size | countProperties () const throw () |
Count all properties. | |
Handling named properties | |
PropertyManager contains an vector of NamedProperty objects.
Each of the NamedProeprty objects has to have a unique name. The setProperty methods ensure the uniqueness of this name. If a setProperty method is called for an existing name, the existing object is destructed prior to the insertion of the new object. | |
const NamedProperty & | getNamedProperty (Position index) const throw (Exception::IndexOverflow) |
Non-mutable access to a named property by its index. | |
NamedProperty & | getNamedProperty (Position index) throw (Exception::IndexOverflow) |
Mutable access to a named property by its index. | |
void | setProperty (const NamedProperty &property) throw () |
Set a named property. | |
void | setProperty (const string &name) throw () |
Set a named property without any data. | |
void | setProperty (const string &name, bool value) throw () |
Set a named property containing boolean data. | |
void | setProperty (const string &name, int value) throw () |
Set a named property containing a signed integer number. | |
void | setProperty (const string &name, unsigned int value) throw () |
Set a named property containing an unsigned integer number. | |
void | setProperty (const string &name, float value) throw () |
Set a named property containing a floating point number. | |
void | setProperty (const string &name, double value) throw () |
Set a named property containing a double-precision floating point number. | |
void | setProperty (const string &name, const string &value) throw () |
Set a named property containing a string. | |
void | setProperty (const string &name, const PersistentObject &value) throw () |
Set a named property containing a PersistentObject. | |
const NamedProperty & | getProperty (const string &name) const throw () |
Retrieve a named property. | |
void | clearProperty (const string &name) throw () |
Remove a named property. | |
Size | countNamedProperties () const throw () |
Return the number of named properties. | |
Predicates | |
bool | hasProperty (Property property) const throw () |
Query for an unnamed property. | |
bool | hasProperty (const string &name) const throw () |
Query for a named property. | |
bool | operator== (const PropertyManager &pm) const throw () |
Equality operator Two instances are equal if they have the same named and unnamed properties. | |
bool | operator!= (const PropertyManager &pm) const throw () |
Inequality operator. | |
Storable Interface | |
void | write (PersistenceManager &pm) const throw () |
Persistent stream writing. | |
bool | read (PersistenceManager &pm) throw () |
Persistent stream reading. | |
Debugging and Diagnostics | |
bool | isValid () const throw () |
Test if instance is valid. | |
void | dump (std::ostream &s=std::cout, Size depth=0) const throw () |
Internal state dump. |
This class manages properties of a class. A property can be seen as easy way to extend the class BALL_EXPORT' attributes without changing its interface. There are different types of properties defined depending on the kind of data stored. The simplest kind of property is just stored as a boolean information: Either an object has a certain property, or it does not. These properties are obviously coded as a BitVector. However the meaning of the different bits has to be defined and the uniqueness of this meaning has to be guaranteed. In order to avoid this, all kernel classes derived from PropertyManager contain a public enum that defines a value NUMBER_OF_PROPERTIES. All user defined properties should refer to this constant (e.g. by defining MY_PROPERTY = Molecule::NUMBER_OF_PROPERTIES + 1
).
|
Remove a named property.
If the named property
|
|
Clear a property.
This method clears an unnamed property of a PropertyManager object by calling
|
|
Return the number of named properties.
|
|
Count all properties. This method returns the sum of unnamed and named properties. It counts the number of ones in the bit vector and the number of properties stored in the named property vector. |
|
Internal state dump. Dump the current internal state of {*this} to the output ostream s with dumping depth depth .
Reimplemented in Atom, AtomContainer, Bond, Chain, Fragment, Molecule, NucleicAcid, Nucleotide, PDBAtom, Protein, Residue, SecondaryStructure, VIEW::Representation, VIEW::AtomBondModelBaseProcessor, VIEW::AddBackboneModel, VIEW::AddBallAndStickModel, VIEW::AddLineModel, VIEW::ModelProcessor, VIEW::AddSurfaceModel, and VIEW::AddVanDerWaalsModel. |
|
Assign properties to another property manager.
This method copies the contents of the PropertyManager object to the given
|
|
Return a const reference to the bit vector containing the unnamed properties. This method returns the bit vector containing the unnamed properties of the property manager. |
|
Return a mutable reference to the bit vector. This method returns the bit vector containing the unnamed properties of the property manager. |
|
Mutable access to a named property by its index.
|
|
Non-mutable access to a named property by its index.
|
|
Retrieve a named property.
If the property manager contains a property named
|
|
Test if instance is valid. Returns true if the bitvector is valid.
Reimplemented in Atom, AtomContainer, Bond, NucleicAcid, Nucleotide, Protein, Residue, SecondaryStructure, VIEW::Representation, and VIEW::ModelProcessor. |
|
Converter to BitVector. This operator converts a PropertyManager object to a BitVector object containing the unnamed properties. |
|
Assignment operator. This operator calls <tt>set(property_manager) to assign a new object.
|
|
Equality operator Two instances are equal if they have the same named and unnamed properties.
|
|
Assign properties from another property manager.
|
|
Set a named property containing a PersistentObject.
This method creates a new named property containing a string (
|
|
Set a named property containing a string.
This method creates a new named property containing a string (
|
|
Set a named property containing a double-precision floating point number.
This method creates a new named property containing a floating point number (
|
|
Set a named property containing a floating point number.
This method creates a new named property containing a floating point number (
|
|
Set a named property containing an unsigned integer number.
This method creates a new named property containing an unsigned int (
|
|
Set a named property containing a signed integer number.
This method creates a new named property containing an int (
|
|
Set a named property containing boolean data.
This method creates a new named property containing boolean data (
|
|
Set a named property without any data.
This method creates a new named property not containing any data (
|
|
Set a named property.
This method adds a new named property to the property manager's array of named properties or substitutes an already existing named property by
|
|
Set a property.
This method sets an unnamed property of a PropertyManager object by calling
|
|
Swap the properties with another property manager.
|
|
Toggle (invert) a property.
This method clears an unnamed property of a PropertyManager object by calling
|