Represents a set of table parts (sub-tables). More...
#include <TableParts.h>
Public Types | |
enum | { PRIMARY = 0x01, VALUE_INDEX = 0x02, QUALIFIER_INDEX = 0x04, ALL = 0x07 } |
Enumeration for describing parts of a table. More... | |
Public Member Functions | |
TableParts (int8_t parts=0) | |
Constructor. More... | |
bool | primary () const |
Test if primary table is included in set. More... | |
bool | value_index () const |
Test if value index is included in set. More... | |
bool | qualifier_index () const |
Test if qualifier index is included in set. More... | |
const std::string | to_string () const |
Returns human readable string describing table parts. More... | |
operator bool () const | |
Checks if any table parts are specified. More... | |
void | clear () |
Clears all parts. More... | |
Public Member Functions inherited from Hypertable::Serializable | |
virtual size_t | encoded_length () const |
Returns serialized object length. More... | |
virtual void | encode (uint8_t **bufp) const |
Writes serialized representation of object to a buffer. More... | |
virtual void | decode (const uint8_t **bufp, size_t *remainp) |
Reads serialized representation of object from a buffer. More... | |
Private Member Functions | |
uint8_t | encoding_version () const override |
Returns encoding version. More... | |
size_t | encoded_length_internal () const override |
Returns internal serialized length. More... | |
void | encode_internal (uint8_t **bufp) const override |
Serialized format is as follows: More... | |
void | decode_internal (uint8_t version, const uint8_t **bufp, size_t *remainp) override |
Reads serialized representation of object from a buffer. More... | |
Private Attributes | |
int8_t | m_parts {} |
Bitmask representing table parts. More... | |
Additional Inherited Members |
Represents a set of table parts (sub-tables).
A table consists of a PRIMARY table and optionally, an associated VALUE_INDEX table and an associated QUALIFIER_INDEX table. An object of this class can be used to hold information about the portions of a table to which an operation applies. It provides member functions for testing whether or not a table part is included in the set, a member function for rendering the set as a human-readable string, and a serialization interface.
Definition at line 47 of file TableParts.h.
|
inline |
Constructor.
parts | Bitmask describing table parts |
Definition at line 65 of file TableParts.h.
|
inline |
Clears all parts.
Definition at line 92 of file TableParts.h.
|
overrideprivatevirtual |
Reads serialized representation of object from a buffer.
This function is to be overridden by derived classes and should decode the object per-se as encoded with encode_internal().
version | Encoding version |
bufp | Address of destination buffer pointer (advanced by call) |
remainp | Address of integer holding amount of serialized encoding remaining |
Implements Hypertable::Serializable.
Definition at line 57 of file TableParts.cc.
|
overrideprivatevirtual |
Serialized format is as follows:
Encoding | Description |
---|---|
1 byte | Bitmask of part bits |
Implements Hypertable::Serializable.
Definition at line 53 of file TableParts.cc.
|
overrideprivatevirtual |
Returns internal serialized length.
This function is to be overridden by derived classes and should return the length of the the serialized object per-se.
Implements Hypertable::Serializable.
Definition at line 40 of file TableParts.cc.
|
overrideprivatevirtual |
Returns encoding version.
Implements Hypertable::Serializable.
Definition at line 36 of file TableParts.cc.
|
inline |
Checks if any table parts are specified.
Definition at line 89 of file TableParts.h.
|
inline |
Test if primary table is included in set.
Definition at line 70 of file TableParts.h.
|
inline |
Test if qualifier index is included in set.
Definition at line 80 of file TableParts.h.
const std::string TableParts::to_string | ( | ) | const |
Returns human readable string describing table parts.
Definition at line 63 of file TableParts.cc.
|
inline |
Test if value index is included in set.
Definition at line 75 of file TableParts.h.
|
private |
Bitmask representing table parts.
Definition at line 106 of file TableParts.h.