AttributeMap Class Reference

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
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.
See also:
attrmode
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.

Parameters:
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.
See also:
attrmode
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.

Parameters:
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.
See also:
attrmode
AttributeMap::AttributeMap ( const AttributeMap amap  ) 

Copy constructor.

Create a copy of an existing AttributeMap object.

Parameters:
amap The AttributeMap which should be cloned.
virtual AttributeMap::~AttributeMap (  )  [inline, virtual]

Standard destructor.

The destructor has no special tasks.


Member Function Documentation

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.

attrmode AttributeMap::getMode ( void   )  const

Getter.

Get attribute mode.

See also:
attrmode
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.

Parameters:
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.

See also:
setAttrVal(const QString &value) setAttrVal(QString *value) setAttrVal(const QStringList &value) setAttrVal(QStringList *value).
Parameters:
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.

Parameters:
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.

Parameters:
value Attribute value to set.
void AttributeMap::setDsrcAttr ( const QString &  dsrcattr  ) 

Setter.

Set datasource attribute.

Parameters:
dsrcattr datasource attribute to set.
void AttributeMap::setMeta ( const QString &  meta  ) 

Setter.

Set meta information.

Parameters:
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.

Parameters:
mode set Attribute mode.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const AttributeMap amap 
) [friend]

Output.

This function is only needed to give out the AttributeMap on STDOUT.

Parameters:
output Reference to stdout.
amap Reference to an AttributeMap object.

Field Documentation

void* AttributeMap::attr [private]

This pointer points to the attribute and associate it witch dsrcattr.

See also:
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).

This enumeration type stores the mapping type.

See also:
attrmode
QString AttributeMap::type [private]

This variable stores the type of the value the Member attr point to.

See also:
attr

The documentation for this class was generated from the following files:
Generated on Wed Mar 24 09:58:13 2010 for kockpit by  doxygen 1.6.3