#include <bit/fieldbase.h>
Inheritance diagram for bit::FieldBase:
Public Types | |
typedef boost::shared_ptr< FieldBase > | pointer |
A convenience typedef to a smart pointer to FieldBase. | |
Public Member Functions | |
FieldBase () | |
Default constructor. | |
virtual | ~FieldBase () |
Destructor. | |
virtual size_t | length () const =0 |
virtual size_t | length (size_t units) const |
virtual size_t | length_units () const =0 |
Returns the length units. | |
virtual int | offset () const =0 |
virtual int | offset (size_t units) const |
virtual size_t | offset_units () const =0 |
Returns the offset units. | |
virtual int | start (size_t units=BITS) const |
virtual std::string | name () const =0 |
Returns the string name associated with this object. | |
virtual std::string | name (int depth) const |
virtual size_t | depth () const |
virtual std::string | description () const =0 |
Returns the string description of this object. | |
const FieldType & | type () |
Returns a FieldType object that describes how the field data should be interpreted. | |
void | set_type (const FieldType &) |
Sets the FieldType object describing how the field data should be interpreted. | |
virtual bool | operator< (const FieldBase &other) const |
Compares the starting bit position of objects. | |
virtual bool | operator> (const FieldBase &other) const |
Compares the ending bit position of objects. | |
virtual FieldBase::pointer | clone ()=0 |
virtual iterator | begin () |
virtual iterator | end () |
virtual FieldBase & | operator[] (std::string s) throw (error::invalid_container_op, std::out_of_range) |
virtual FieldBase & | operator[] (size_t i) throw (error::invalid_container_op, std::out_of_range) |
virtual size_t | fields () |
virtual FieldBase::pointer | field (std::string s) |
virtual FieldBase::pointer | field (size_t i) |
FieldBase * | parent () |
Protected Member Functions | |
virtual FieldBase::pointer | previous_field (FieldBase::pointer current_field) throw (error::invalid_container_op) |
virtual FieldBase::pointer | next_field (FieldBase::pointer current_field) throw (error::invalid_container_op) |
Protected Attributes | |
FieldBase * | m_parent |
FieldType | m_type |
Friends | |
class | RecordStorage |
class | RecordVector |
Classes | |
class | iterator |
This is a generalized interator that performs all operations using the generalized container methods in the FieldBase class. More... |
|
When the length in bits is not evenly divisible by the requested unit size (say a 12 bit offset with requested units = 8) the return value will be the number of units required to store the object. For example, if the object has a 12 bit offset and the units parameter = OCTETS, the return value will be 2. |
|
Implemented in bit::Field, bit::FieldVector::Element, bit::Record, and bit::RecordVector. |
|
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. Implemented in bit::Field, bit::FieldVector::Element, and bit::RecordBase. |
|
When the offset size in bits is not evenly divisible by the requested unit size (say a 12 bit offset with requested units = 8) the return value will be the number of units required to complete the offset. For example, if the object has a 12 bit offset and the units parameter = 8, the return value will be 2. If the units were the same, but the offset were -12 bits the return value would be -2. |
|
Implemented in bit::Field, bit::FieldVector::Element, and bit::RecordBase. |
|
Compares the starting bit position of objects. This overload is provided to allow easy sorting of objects according to their starting bit position.
|
|
Compares the ending bit position of objects. This overload is provided to allow easy sorting of objects according to position of their last bit.
|
|
When the offset size in bits is not evenly divisible by the requested unit size (say a 12 bit offset with requested units = 8) the return value will be the number of units required to complete the offset. For example, if the object has a 12 bit offset and the units parameter = 8, the return value will be 2. If the units were the same, but the offset were -12 bits the return value would be -2. |