Geddei::PropertiesInfo Class Reference
[Geddei's core classes.]

A set of tuples to describe the properties for a Processor object. More...

#include <properties.h>

Inheritance diagram for Geddei::PropertiesInfo:

Inheritance graph
[legend]
Collaboration diagram for Geddei::PropertiesInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const QVariant & defaultValue (const QString &key) const
const QString description (const QString &key) const
const QStringList keys () const
PropertiesInfooperator() (const PropertiesInfo &merge)
PropertiesInfooperator() (const QString &key, const QVariant defaultValue, const QString &description)
 PropertiesInfo ()
 PropertiesInfo (const QString &key, const QVariant defaultValue, const QString &description)
void set (const QString &key, const QVariant defaultValue, const QString &description)
void set (const PropertiesInfo &merge)
const uint size () const

Friends

class Properties

Detailed Description

A set of tuples to describe the properties for a Processor object.

Author:
Gav Wood <gav@cs.york.ac.uk>
PropertiesInfo can be thought of as a map between names and certain attributes for each property. Those attributes are a default value (which implicitly stores type information) and a string description of the what the property does.

It comes with a nice inline construction mechanism to create instances with an unlimited number of tuples.


Constructor & Destructor Documentation

Geddei::PropertiesInfo::PropertiesInfo ( const QString &  key,
const QVariant  defaultValue,
const QString &  description 
) [inline]

Constructor to create a PropertiesInfo object already populated with a tuple.

This can be utilised with the parentheses operator to construct objects with multiple tuples.

Parameters:
key The name of the property the populated tuple will describe.
defaultValue The default value this property will take.
description A description of what this property means.

Geddei::PropertiesInfo::PropertiesInfo (  )  [inline]

Basic constructor. Creates an empty Properties object.


Member Function Documentation

const QVariant& Geddei::PropertiesInfo::defaultValue ( const QString &  key  )  const [inline]

Retrieve the default value for a given property.

Parameters:
key The name of the property.
Returns:
The default value for the property named key.

const QString Geddei::PropertiesInfo::description ( const QString &  key  )  const

Retrieve the description of a given property.

Parameters:
key The name of the property.
Returns:
The description of property key.

const QStringList Geddei::PropertiesInfo::keys (  )  const [inline]

Get a list of the keys in this object.

Returns:
A QStringList containing an entry of each key in this object.

Reimplemented from Geddei::Properties.

PropertiesInfo& Geddei::PropertiesInfo::operator() ( const PropertiesInfo merge  )  [inline]

Inserts (or overwrites) a set of new tuples into this object.

This should only be used in conjunction with the tuple constructor, since otherwise it can make code quite cryptic.

Typical usage:

 PropertiesInfo a, b;
 // a & b are populated...
 PropertiesInfo p = PropertiesInfo(a)(b);
 // p now contains all properties from a and b.

Parameters:
merge The PropertiesInfo object from which to draw data.
Returns:
A reference to this object.
See also:
set()

PropertiesInfo& Geddei::PropertiesInfo::operator() ( const QString &  key,
const QVariant  defaultValue,
const QString &  description 
) [inline]

Inserts (or overwrites) a new tuple into this object.

This should only be used in conjunction with the tuple constructor, since otherwise it can make code quite cryptic.

Typical usage:

 PropertiesInfo p = PropertiesInfo("a", 1, "A's value")
                                  ("b", 2, "B's value");

It may be used similarly inline when calling methods with Properties arguments:

 someObject.someMethod(PropertiesInfo("a", 1, "A's value")
                                     ("b", 2, "B's value"));

Parameters:
key The name of the property the new tuple will describe.
defaultValue The default value this property will take.
description A description of what this property means.
Returns:
A reference to this object.
See also:
set()

void Geddei::PropertiesInfo::set ( const QString &  key,
const QVariant  defaultValue,
const QString &  description 
) [inline]

Inserts (or overwrites) a new tuple into this object.

Parameters:
key The name of the property the new tuple will describe.
defaultValue The default value this property will take.
description A description of what this property means.
See also:
operator()()

void Geddei::PropertiesInfo::set ( const PropertiesInfo merge  )  [inline]

Inserts (or overwrites) a set of new tuples into this object.

Typical usage:

 PropertiesInfo a, b;
 // a & b are populated...
 PropertiesInfo p;
 p.set(a);
 p.set(b);
 // p now contains all properties from a and b.

Parameters:
merge The PropertiesInfo object from which to draw data.
Returns:
A reference to this object.
See also:
operator()()

const uint Geddei::PropertiesInfo::size (  )  const [inline]

Get the number of keys in this object.

Returns:
The number of keys in this object.

Reimplemented from Geddei::Properties.


The documentation for this class was generated from the following files:
Generated on Fri Nov 10 21:58:36 2006 for Exscalibar by  doxygen 1.5.1