|
The Prop class is the abstract base class for a number of specialized properties. More...
Header: | #include <Prop.hpp> |
Inherited By: | MsXpS::libXpertMass::ChemicalGroupProp, MsXpS::libXpertMass::DoubleProp, MsXpS::libXpertMass::IntProp, MsXpS::libXpertMass::ModifProp, MsXpS::libXpertMass::NoDeletePointerProp, and MsXpS::libXpertMass::StringProp |
Prop() | |
Prop(const QString &name) | |
Prop(const Prop &other) | |
virtual | ~Prop() |
virtual void * | data() const |
const QString & | name() |
void | setData(void *data) |
void | setName(QString &name) |
virtual Prop & | operator=(const Prop &other) |
Properties are libmass' way of extending the capabilities of objects. A property is merely an encapsulation of:
In order to perform tasks in the derived classes using dynamic binding, virtual functions are available to derived classes to perform:
Derived classes should be named according the following scheme: XxxYyyZzzzProp, like StringProp or MonomerProp or ModifProp.
Note: When a derived class is created, it should register itself to the system by registering its name in the propAllocator(const QString &) function. This function will be able to allocate a property using the proper constructor based on the property name that is passed as argument. It returns a pointer to the newly allocated instance.
The classes that benefit from this Property-based extension mechanism all derive from PropListHolder.
See also StringProp and PropListHolder.
Constructs a Prop instance.
Constructs a Prop instance with name.
Constructs a Prop instance as a copy of other.
Note: The data are not duplicated.
[virtual noexcept]
Prop::~Prop()Destructs this Prop instance.
[virtual]
void *Prop::data() constReturns the data.
See also setData().
Returns the name.
See also setName().
Sets the data
See also data().
Sets the name.
See also name().
[virtual]
Prop &Prop::operator=(const Prop &other)Assigns other to this Prop instance.
This variable holds the name of the property. Initialized to "NOT_SET".
This variable holds the allocated data belonging to this Prop instance. Initialized to nullptr.