#include <bit/field.h>
This class extends FieldBase by including a name and a description.
Public Types | |
typedef BitPointer< Field > | pointer |
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 FieldType & | type () 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 |
typedef BitPointer<Field> bit::Field::pointer |
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] |
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] |
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] |
void bit::Field::set_length_units | ( | size_t | units | ) | [virtual] |
References m_length_units.
int bit::Field::offset | ( | ) | const [virtual] |
Implements bit::FieldBase.
References m_offset.
int bit::Field::offset | ( | size_t | units | ) | const [virtual] |
void bit::Field::set_offset | ( | int | offset | ) | [virtual] |
References m_offset.
size_t bit::Field::offset_units | ( | ) | const [virtual] |
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] |
void bit::Field::set_name | ( | const std::string & | name | ) | [virtual] |
std::string bit::Field::description | ( | ) | const [virtual] |
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] |
const std::string & bit::Field::xml | ( | ) | [virtual] |
Implements bit::FieldBase.
Reimplemented in bit::FieldVector.
References m_length, m_length_units, m_name, m_offset, m_offset_units, m_type, bit::FieldBase::m_xml, bit::FieldType::type(), bit::TYPE_NONE, and bit::FieldType::xml().
FieldBase::pointer bit::Field::clone | ( | ) | [virtual] |
Implements bit::FieldBase.
Reimplemented in bit::FieldVector.
References create(), m_description, m_length, m_length_units, m_name, m_offset, m_offset_units, and m_type.
virtual Container bit::Field::container_type | ( | ) | [inline, virtual] |
std::string bit::Field::m_name [protected] |
Referenced by bit::FieldVector::clone(), clone(), name(), set_name(), bit::FieldVector::xml(), and xml().
size_t bit::Field::m_length [protected] |
size_t bit::Field::m_length_units [protected] |
Referenced by bit::FieldVector::clone(), clone(), length_units(), set_length_units(), bit::FieldVector::xml(), and xml().
int bit::Field::m_offset [protected] |
Referenced by bit::FieldVector::clone(), clone(), offset(), set_offset(), bit::FieldVector::xml(), and xml().
size_t bit::Field::m_offset_units [protected] |
Referenced by bit::FieldVector::clone(), clone(), offset_units(), set_offset_units(), bit::FieldVector::xml(), and xml().
std::string bit::Field::m_description [protected] |
Referenced by bit::FieldVector::clone(), clone(), description(), and set_description().
FieldType bit::Field::m_type [protected] |
Referenced by bit::FieldVector::clone(), clone(), set_type(), type(), bit::FieldVector::xml(), and xml().
Encoding bit::Field::m_encoding [protected] |
Referenced by encoding(), and set_encoding().