class Attribute

Attribute is a class for storing typed key/value pairs. More...

Definition#include <sysadm/Attribute.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Members


Detailed Description

Attribute is a class for storing typed key/value pairs. The only types supported are String, long, bool, double, and AttrBundle.

Attributes are aggregated into AttrBundles to represent bundles of information.

enum EType {NONE, STRING, LONG, BOOLEAN, DOUBLE, BUNDLE }

Enumeration of the supported types. "NONE" is only used for the NUL Attribute.

 Attribute (const String& key, const String& value)

Construct a String Attribute.

 Attribute (const String& key, const char* value)

 Attribute (const String& key, long long value)

Construct a long Attribute.

 Attribute (const String& key, bool value)

Construct a bool Attribute.

 Attribute (const String& key, double value)

Construct a double Attribute.

 Attribute (const String& key, const class AttrBundle& bundle)

Construct a bundle Attribute.

 Attribute (const String& key, const String& type, const String& value)

Construct an Attribute based on string representation of "type" and "value". This is used when deserializing AttrBundles.

 Attribute (const String& key, EType type, const String& value)

Construct an Attribute based on "type" and a string representation of "value".

 Attribute (const Attribute& other)

Copy constructor.

Attribute ()

[virtual]

Destructor.

Attribute&  operator= (const Attribute& other)

Assignment operator.

String  getKey ()

[const virtual]

Accessors for key and type.

EType  getType ()

[const virtual]

String  stringValue ()

[const virtual]

Getting the value of an Attribute. These all assert that the Attribute is of the right type.

long long  longValue ()

[const virtual]

bool  booleanValue ()

[const virtual]

double  doubleValue ()

[const virtual]

String  bundleValue ()

[const virtual]

bundleValue() returns a serialized AttrBundle rather than an AttrBundle, to avoid circular dependency between Attribute and AttrBundle.

String  getTypeString ()

[const virtual]

Get string representations of type and value. These are used in AttrBundle::serialize().

String  getValueString ()

[const virtual]

bool  operator== (const Attribute& other)

[const virtual]

Comparison operators. These compare both the keys and the values of the two Attributes.

bool  operator!= (const Attribute& other)

[const virtual]

static const Attribute NUL

A "null" attribute.


Generated by: rusty@irem on Mon Sep 18 18:07:52 2000, using kdoc 2.0a36.