Class to map attributes. More...
#include <attributemap.h>
Public Member Functions | |
AttributeMap () | |
Standard constructor. | |
AttributeMap (const QString &meta, const QString &dsrcattr, QString *attr, attrmode mode) | |
Constructor. | |
AttributeMap (const QString &meta, const QString &dsrcattr, int *attr, attrmode mode) | |
Constructor. | |
AttributeMap (const QString &meta, const QString &dsrcattr, QStringList *attr, attrmode mode) | |
Constructor. | |
AttributeMap (const AttributeMap &amap) | |
Copy constructor. | |
virtual | ~AttributeMap () |
Standard destructor. | |
void | setMeta (const QString &meta) |
Setter. | |
void | setDsrcAttr (const QString &dsrcattr) |
Setter. | |
void | setAttrVal (const QString &value) |
Setter. | |
void | setAttrVal (QString *value) |
void | setAttrVal (const QStringList &value) |
Setter. | |
void | setAttrVal (QStringList *value) |
void | setAttrVal (const QVariant &value) |
Setter. | |
void | setMode (attrmode mode) |
Setter. | |
QString | getMeta (void) const |
Getter. | |
QString | getDsrcAttr (void) const |
Getter. | |
QVariant | getAttrs (void) const |
Getter. | |
attrmode | getMode (void) const |
Getter. | |
QString | getType (void) const |
Getter. | |
bool | isMulti (void) const |
Check type. | |
void | operator= (const AttributeMap &amap) |
Operator. | |
Private Attributes | |
QString | meta |
This variable stores meta information of the AttributeMap (like corresponding datasource table). | |
QString | dsrcattr |
This variable stores the datasource field name. For example "objectClass" in the case of LDAP as datasource. | |
QString | type |
This variable stores the type of the value the Member attr point to. | |
void * | attr |
This pointer points to the attribute and associate it witch dsrcattr. | |
attrmode | mode |
This enumeration type stores the mapping type. | |
Friends | |
std::ostream & | operator<< (std::ostream &output, const AttributeMap &amap) |
Output. |
Class to map attributes.
This class is needed to map an variable to any other datafield. So you can acces an attribute over several attributemaps.
AttributeMap::AttributeMap | ( | ) | [inline] |
Standard constructor.
The Standard constructor is implemented so that AttributeMaps can also be created without pareters. In this case the getters are used.
AttributeMap::AttributeMap | ( | const QString & | meta, | |
const QString & | dsrcattr, | |||
QString * | attr, | |||
attrmode | mode | |||
) |
Constructor.
This constructor is called if the attribute to which the created AttributeMap object should point to is a QString.
meta | This member is used to store meta information about the AttributeMap object (for example a database table) | |
dsrcattr | This member stands for the field in the datasource. So the AttributeMap object value is accessible over the datasource field name. | |
attr | The datasource attribute value. | |
mode | The attribute mode. |
AttributeMap::AttributeMap | ( | const QString & | meta, | |
const QString & | dsrcattr, | |||
int * | attr, | |||
attrmode | mode | |||
) |
Constructor.
This constructor is called if the attribute to which the created AttributeMap object should point to is an integer.
meta | This member is used to store meta information about the AttributeMap object (for example a database table). | |
dsrcattr | This member stands for the field in the datasource. So the AttributeMap object value is accessible over the datasource field name. | |
attr | The datasource attribute value. | |
mode | The attribute mode. |
AttributeMap::AttributeMap | ( | const QString & | meta, | |
const QString & | dsrcattr, | |||
QStringList * | attr, | |||
attrmode | mode | |||
) |
Constructor.
This constructor is called if the attribute to which the created AttributeMap object should point to is a QStringList.
meta | This member is used to store meta information about the AttributeMap object (for example a database table). | |
dsrcattr | This member stands for the field in the datasource. So the AttributeMap object value is accessible over the datasource field name.. | |
attr | The datasource attribute value. | |
mode | The attribute mode. |
AttributeMap::AttributeMap | ( | const AttributeMap & | amap | ) |
Copy constructor.
Create a copy of an existing AttributeMap object.
amap | The AttributeMap which should be cloned. |
virtual AttributeMap::~AttributeMap | ( | ) | [inline, virtual] |
Standard destructor.
The destructor has no special tasks.
QVariant AttributeMap::getAttrs | ( | void | ) | const |
Getter.
A QVariant is used as carrier for attr and returned.
QString AttributeMap::getDsrcAttr | ( | void | ) | const |
Getter.
Get datasource attribute.
QString AttributeMap::getMeta | ( | void | ) | const |
Getter.
Get meta information.
QString AttributeMap::getType | ( | void | ) | const |
Getter.
Get Type.
bool AttributeMap::isMulti | ( | void | ) | const |
Check type.
This function checks if attributemap is a mapping from a multi attribute.
void AttributeMap::operator= | ( | const AttributeMap & | amap | ) |
Operator.
Make the current AttributeMap object pointing to the same attribute as amap and assign its values to the current object.
amap | Attribute value to set. |
void AttributeMap::setAttrVal | ( | const QVariant & | value | ) |
Setter.
Set attribute value. This function checks which typ is encapsulated by value and calls a suitable setAttrVal for the given type.
value | Attribute value to set. |
void AttributeMap::setAttrVal | ( | QStringList * | value | ) |
void AttributeMap::setAttrVal | ( | const QStringList & | value | ) |
Setter.
Set attribute value. In this function the attr member is set in dependency of the specified type. The assignment will be only accomplished if the type member of AttributeMap says that attr has a suitable type.
value | Attribute value to set. |
void AttributeMap::setAttrVal | ( | QString * | value | ) |
void AttributeMap::setAttrVal | ( | const QString & | value | ) |
Setter.
Set attribute value. In this function the attr member is set in dependency of the specified type. If the specified type says that an AttributeMap points to an integer an this function is called, the value which is of the type QString will be transformed in an integer.
value | Attribute value to set. |
void AttributeMap::setDsrcAttr | ( | const QString & | dsrcattr | ) |
Setter.
Set datasource attribute.
dsrcattr | datasource attribute to set. |
void AttributeMap::setMeta | ( | const QString & | meta | ) |
Setter.
Set meta information.
meta | Meta information to set. |
void AttributeMap::setMode | ( | attrmode | mode | ) |
Setter.
Set attribute Mode. Be sure that also the attr Member is changed after calling this setter.
mode | set Attribute mode. |
std::ostream& operator<< | ( | std::ostream & | output, | |
const AttributeMap & | amap | |||
) | [friend] |
Output.
This function is only needed to give out the AttributeMap on STDOUT.
output | Reference to stdout. | |
amap | Reference to an AttributeMap object. |
void* AttributeMap::attr [private] |
This pointer points to the attribute and associate it witch dsrcattr.
QString AttributeMap::dsrcattr [private] |
This variable stores the datasource field name. For example "objectClass" in the case of LDAP as datasource.
QString AttributeMap::meta [private] |
This variable stores meta information of the AttributeMap (like corresponding datasource table).
attrmode AttributeMap::mode [private] |
This enumeration type stores the mapping type.
QString AttributeMap::type [private] |
This variable stores the type of the value the Member attr point to.