seven bits

bit::Field Class Reference
["Record Definitions"]

#include <bit/field.h>

Inheritance diagram for bit::Field:

bit::FieldBase bit::FieldVector

List of all members.


Detailed Description

A Field identifies a starting point and a length.

This class extends FieldBase by including a name and a description.

Author:
Rick L. Vinyard, Jr.

Public Types

typedef BitPointer< Fieldpointer

Public Member Functions

 Field (std::string name="", size_t length=0, size_t length_units=BITS, int offset=0, size_t offset_units=BITS, std::string descr="")
virtual ~Field ()
virtual size_t length () const
virtual size_t length (size_t units) const
virtual void set_length (size_t length)
virtual size_t length_units () const
virtual void set_length_units (size_t units)
virtual int offset () const
virtual int offset (size_t units) const
virtual void set_offset (int offset)
virtual size_t offset_units () const
virtual void set_offset_units (size_t units)
virtual std::string name () const
 Returns the string name associated with this object.
virtual std::string name (int depth) const
virtual void set_name (const std::string &name)
virtual std::string description () const
 Returns the string description of this object.
virtual void set_description (const std::string &description)
virtual const FieldTypetype () const
 Returns a FieldType object that describes how the field data should be interpreted.
virtual void set_type (const FieldType &)
 Sets the FieldType object describing how the field data should be interpreted.
virtual Encoding encoding () const
 Return the data encoding type.
virtual void set_encoding (Encoding en)
 Set the data encoding type.
virtual const std::string & xml ()
virtual FieldBase::pointer clone ()
virtual Container container_type ()

Static Public Member Functions

static Field::pointer create (std::string name="", size_t length=0, size_t length_units=BITS, int offset=0, size_t offset_units=BITS, std::string descr="")

Protected Attributes

std::string m_name
size_t m_length
size_t m_length_units
int m_offset
size_t m_offset_units
std::string m_description
FieldType m_type
Encoding m_encoding

Member Typedef Documentation

typedef BitPointer<Field> bit::Field::pointer

Reimplemented from bit::FieldBase.

Reimplemented in bit::FieldVector.


Constructor & Destructor Documentation

bit::Field::Field ( std::string  name = "",
size_t  length = 0,
size_t  length_units = BITS,
int  offset = 0,
size_t  offset_units = BITS,
std::string  descr = "" 
)

References set_name().

bit::Field::~Field (  )  [virtual]


Member Function Documentation

Field::pointer bit::Field::create ( std::string  name = "",
size_t  length = 0,
size_t  length_units = BITS,
int  offset = 0,
size_t  offset_units = BITS,
std::string  descr = "" 
) [static]

Referenced by clone(), and bit::xml_read_field().

size_t bit::Field::length (  )  const [virtual]

Returns:
the length of this object in it's length units

Implements bit::FieldBase.

Reimplemented in bit::FieldVector.

References m_length.

size_t bit::Field::length ( size_t  units  )  const [virtual]

Reimplemented from bit::FieldBase.

Reimplemented in bit::FieldVector.

References bit::FieldBase::length().

void bit::Field::set_length ( size_t  length  )  [virtual]

References m_length.

size_t bit::Field::length_units (  )  const [virtual]

Implements bit::FieldBase.

References m_length_units.

void bit::Field::set_length_units ( size_t  units  )  [virtual]

References m_length_units.

int bit::Field::offset (  )  const [virtual]

Returns:
the offset of this object in the offset units of this object

Implements bit::FieldBase.

References m_offset.

int bit::Field::offset ( size_t  units  )  const [virtual]

Reimplemented from bit::FieldBase.

References bit::FieldBase::offset().

void bit::Field::set_offset ( int  offset  )  [virtual]

References m_offset.

size_t bit::Field::offset_units (  )  const [virtual]

Implements bit::FieldBase.

References m_offset_units.

void bit::Field::set_offset_units ( size_t  units  )  [virtual]

References m_offset_units.

std::string bit::Field::name (  )  const [virtual]

Returns the string name associated with this object.

This pure virtual method is reimplemented by children to provide the proper notation, such as the array notation of elements, by children.

Implements bit::FieldBase.

References m_name.

std::string bit::Field::name ( int  depth  )  const [virtual]

Reimplemented from bit::FieldBase.

References bit::FieldBase::name().

void bit::Field::set_name ( const std::string &  name  )  [virtual]

References m_name.

Referenced by Field().

std::string bit::Field::description (  )  const [virtual]

Returns the string description of this object.

Implements bit::FieldBase.

References m_description.

void bit::Field::set_description ( const std::string &  description  )  [virtual]

References m_description.

const FieldType & bit::Field::type (  )  const [virtual]

Returns a FieldType object that describes how the field data should be interpreted.

Implements bit::FieldBase.

References m_type.

void bit::Field::set_type ( const FieldType type  )  [virtual]

Sets the FieldType object describing how the field data should be interpreted.

Implements bit::FieldBase.

References m_type.

Encoding bit::Field::encoding (  )  const [virtual]

Return the data encoding type.

If encoding type of this field is set to ENCODING_NONE and this field has a parent, then the parent's encoding type is returned.

Implements bit::FieldBase.

References bit::FieldBase::encoding(), bit::ENCODING_NONE, m_encoding, and bit::FieldBase::m_parent.

void bit::Field::set_encoding ( Encoding  en  )  [virtual]

Set the data encoding type.

Implements bit::FieldBase.

References m_encoding.

const std::string & bit::Field::xml (  )  [virtual]

FieldBase::pointer bit::Field::clone (  )  [virtual]

virtual Container bit::Field::container_type (  )  [inline, virtual]

Implements bit::FieldBase.

Reimplemented in bit::FieldVector.

References bit::FIELD.


Member Data Documentation

std::string bit::Field::m_name [protected]

size_t bit::Field::m_length [protected]

size_t bit::Field::m_length_units [protected]

int bit::Field::m_offset [protected]

size_t bit::Field::m_offset_units [protected]

std::string bit::Field::m_description [protected]

Referenced by encoding(), and set_encoding().


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

Generated on Mon Nov 3 10:50:01 2008 for bit by doxygen 1.5.6