#include <bit/fieldbase.h>
Inheritance diagram for bit::FieldBase:
Public Types | |
typedef BitPointer< FieldBase > | pointer |
A convenience typedef to a smart pointer to FieldBase. | |
typedef BitPointer< FieldBase > | pointer |
A convenience typedef to a smart pointer to FieldBase. | |
typedef BitPointer< 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 const std::string & | xml ()=0 |
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 (exception::invalid_container_op, std::out_of_range) |
virtual FieldBase & | operator[] (size_t i) throw (exception::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 () |
virtual Container | container_type ()=0 |
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 const std::string & | xml ()=0 |
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 (exception::invalid_container_op, std::out_of_range) |
virtual FieldBase & | operator[] (size_t i) throw (exception::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 () |
virtual Container | container_type ()=0 |
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 const std::string & | xml ()=0 |
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 (exception::invalid_container_op, std::out_of_range) |
virtual FieldBase & | operator[] (size_t i) throw (exception::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 () |
virtual Container | container_type ()=0 |
Protected Member Functions | |
virtual FieldBase::pointer | previous_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
virtual FieldBase::pointer | next_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
virtual FieldBase::pointer | previous_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
virtual FieldBase::pointer | next_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
virtual FieldBase::pointer | previous_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
virtual FieldBase::pointer | next_field (FieldBase::pointer current_field) throw (exception::invalid_container_op) |
Protected Attributes | |
FieldBase * | m_parent |
FieldType | m_type |
std::string | m_xml |
FieldBase * | m_parent |
FieldBase * | m_parent |
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... |
size_t bit::FieldBase::length | ( | size_t | units | ) | const [virtual] |
Whether the object is specified in bits or octets, length(BITS) will always return the length in bits and length(OCTETS) will always return the length in octets.
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.
int bit::FieldBase::offset | ( | size_t | units | ) | const [virtual] |
This method can be used to get the offset as a specified unit size regardless of the currently set offset unit size of this object.
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.
int bit::FieldBase::start | ( | size_t | units = BITS |
) | const [virtual] |
This method will return the starting position of this object in the specified units, which defaults to bits. The returned value will also account for the offset of the parent object (if this object has a parent).
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.
virtual std::string bit::FieldBase::name | ( | ) | const [pure 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.
Implemented in bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, and bit::RecordBase.
bool bit::FieldBase::operator< | ( | const FieldBase & | other | ) | const [virtual] |
Compares the starting bit position of objects.
This overload is provided to allow easy sorting of objects according to their starting bit position.
bool bit::FieldBase::operator> | ( | const FieldBase & | other | ) | const [virtual] |
Compares the ending bit position of objects.
This overload is provided to allow easy sorting of objects according to position of their last bit.
virtual size_t bit::FieldBase::length | ( | size_t | units | ) | const [virtual] |
Whether the object is specified in bits or octets, length(BITS) will always return the length in bits and length(OCTETS) will always return the length in octets.
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.
virtual int bit::FieldBase::offset | ( | size_t | units | ) | const [virtual] |
This method can be used to get the offset as a specified unit size regardless of the currently set offset unit size of this object.
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.
virtual int bit::FieldBase::start | ( | size_t | units = BITS |
) | const [virtual] |
This method will return the starting position of this object in the specified units, which defaults to bits. The returned value will also account for the offset of the parent object (if this object has a parent).
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.
virtual std::string bit::FieldBase::name | ( | ) | const [pure 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.
Implemented in bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, and bit::RecordBase.
virtual bool bit::FieldBase::operator< | ( | const FieldBase & | other | ) | const [virtual] |
Compares the starting bit position of objects.
This overload is provided to allow easy sorting of objects according to their starting bit position.
virtual bool bit::FieldBase::operator> | ( | const FieldBase & | other | ) | const [virtual] |
Compares the ending bit position of objects.
This overload is provided to allow easy sorting of objects according to position of their last bit.
virtual size_t bit::FieldBase::length | ( | size_t | units | ) | const [virtual] |
Whether the object is specified in bits or octets, length(BITS) will always return the length in bits and length(OCTETS) will always return the length in octets.
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.
virtual int bit::FieldBase::offset | ( | size_t | units | ) | const [virtual] |
This method can be used to get the offset as a specified unit size regardless of the currently set offset unit size of this object.
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.
virtual int bit::FieldBase::start | ( | size_t | units = BITS |
) | const [virtual] |
This method will return the starting position of this object in the specified units, which defaults to bits. The returned value will also account for the offset of the parent object (if this object has a parent).
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.
virtual std::string bit::FieldBase::name | ( | ) | const [pure 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.
Implemented in bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, bit::RecordBase, bit::Field, bit::FieldVector::Element, and bit::RecordBase.
virtual bool bit::FieldBase::operator< | ( | const FieldBase & | other | ) | const [virtual] |
Compares the starting bit position of objects.
This overload is provided to allow easy sorting of objects according to their starting bit position.
virtual bool bit::FieldBase::operator> | ( | const FieldBase & | other | ) | const [virtual] |
Compares the ending bit position of objects.
This overload is provided to allow easy sorting of objects according to position of their last bit.