Field Class Reference

Holds information about a field of a SimObject. More...

#include <Field.h>

Inheritance diagram for Field:

Inheritance graph
[legend]
Collaboration diagram for Field:

Collaboration graph
[legend]

List of all members.

Public Types

enum  AccessType { readonly = 0, readwrite = 1 }
typedef unsigned char ValueType

Public Member Functions

 Field (void)
virtual ~Field ()
virtual Fieldclone (void) const =0
virtual double getValue (SimObject *o) const =0
virtual void setValue (SimObject *o, double v) const =0
int getOffset () const
ValueType getType () const
void * getPtr (SimObject *o) const

Static Public Member Functions

static double getValue (void const *const field_ptr, const ValueType &type)
static void setValue (void *const field_ptr, const ValueType &type, const double v)

Public Attributes

string name
 Name of the field.
string description
 Short description of the field.
string units
 Units of the field.
AccessType access
 Access: READONLY or READWRITE.
double lb
 Lower bound of the field vlaue(s).
double ub
 Upper bound of the field vlaue(s).

Static Public Attributes

static const ValueType double_t = 0
static const ValueType float_t = 1
static const ValueType int_t = 2
static const ValueType unknown_t = 100

Protected Attributes

Memory layout information
int offset
 Offset in bytes from the head of the.
int size
 Size in bytes of the field.
ValueType type
 The type of value that the field holds.


Detailed Description

Holds information about a field of a SimObject.

See Setting and getting field values for more details.

Definition at line 13 of file Field.h.


Member Typedef Documentation

typedef unsigned char Field::ValueType

Definition at line 19 of file Field.h.


Member Enumeration Documentation

Enumerator:
readonly 
readwrite 

Definition at line 17 of file Field.h.


Constructor & Destructor Documentation

Field::Field ( void   )  [inline]

Definition at line 26 of file Field.h.

References offset.

virtual Field::~Field (  )  [inline, virtual]

Definition at line 30 of file Field.h.


Member Function Documentation

virtual Field* Field::clone ( void   )  const [pure virtual]

virtual double Field::getValue ( SimObject o  )  const [pure virtual]

virtual void Field::setValue ( SimObject o,
double  v 
) const [pure virtual]

int Field::getOffset (  )  const [inline]

Definition at line 59 of file Field.h.

References offset.

Referenced by SimObject::getFieldOffset().

ValueType Field::getType (  )  const [inline]

double Field::getValue ( void const *const   field_ptr,
const ValueType type 
) [inline, static]

Definition at line 96 of file Field.h.

References double_t, float_t, and int_t.

void Field::setValue ( void *const   field_ptr,
const ValueType type,
const double  v 
) [inline, static]

Definition at line 115 of file Field.h.

References double_t, float_t, and int_t.

void* Field::getPtr ( SimObject o  )  const [inline]


Member Data Documentation

const ValueType Field::double_t = 0 [static]

Definition at line 21 of file Field.h.

Referenced by getValue(), ScalarFieldImpl< T, true >::initValueType(), and setValue().

const ValueType Field::float_t = 1 [static]

Definition at line 22 of file Field.h.

Referenced by getValue(), ScalarFieldImpl< T, true >::initValueType(), and setValue().

const ValueType Field::int_t = 2 [static]

Definition at line 23 of file Field.h.

Referenced by getValue(), ScalarFieldImpl< T, true >::initValueType(), and setValue().

const ValueType Field::unknown_t = 100 [static]

Definition at line 24 of file Field.h.

Referenced by ScalarFieldImpl< T, false >::valueType().

string Field::name

Name of the field.

Definition at line 38 of file Field.h.

Referenced by FieldRegistry::registerField(), and ScalarFieldImpl< T, true >::ScalarFieldImpl().

Short description of the field.

Definition at line 41 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

string Field::units

Units of the field.

Definition at line 44 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

Access: READONLY or READWRITE.

Definition at line 47 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

Lower bound of the field vlaue(s).

Definition at line 50 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

Upper bound of the field vlaue(s).

Definition at line 53 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

int Field::offset [protected]

Offset in bytes from the head of the.

For a SimObject o the memory location of the field is given by ( (char *)o + offset )

Definition at line 85 of file Field.h.

Referenced by Field(), getOffset(), getPtr(), ScalarFieldImpl< T, true >::getValue(), ScalarFieldImpl< T, true >::ScalarFieldImpl(), and ScalarFieldImpl< T, true >::setValue().

int Field::size [protected]

Size in bytes of the field.

Definition at line 88 of file Field.h.

Referenced by ScalarFieldImpl< T, true >::ScalarFieldImpl().

ValueType Field::type [protected]

The type of value that the field holds.

Definition at line 91 of file Field.h.

Referenced by getType(), and ScalarFieldImpl< T, true >::ScalarFieldImpl().


The documentation for this class was generated from the following file:

Generated on Wed Jul 9 16:34:50 2008 for PCSIM by  doxygen 1.5.5