0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Hypertable::TableParts Class Reference

Represents a set of table parts (sub-tables). More...

#include <TableParts.h>

Inheritance diagram for Hypertable::TableParts:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::TableParts:
Collaboration graph
[legend]

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

Detailed Description

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.

Constructor & Destructor Documentation

Hypertable::TableParts::TableParts ( int8_t  parts = 0)
inline

Constructor.

Parameters
partsBitmask describing table parts

Definition at line 65 of file TableParts.h.

Member Function Documentation

void Hypertable::TableParts::clear ( )
inline

Clears all parts.

Definition at line 92 of file TableParts.h.

void TableParts::decode_internal ( uint8_t  version,
const uint8_t **  bufp,
size_t *  remainp 
)
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().

Parameters
versionEncoding version
bufpAddress of destination buffer pointer (advanced by call)
remainpAddress of integer holding amount of serialized encoding remaining
See also
encode_internal() for encoding format

Implements Hypertable::Serializable.

Definition at line 57 of file TableParts.cc.

void TableParts::encode_internal ( uint8_t **  bufp) const
overrideprivatevirtual

Serialized format is as follows:

EncodingDescription
1 byteBitmask of part bits

Implements Hypertable::Serializable.

Definition at line 53 of file TableParts.cc.

size_t TableParts::encoded_length_internal ( ) const
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.

Returns
Internal serialized length
See also
encode_internal() for encoding format

Implements Hypertable::Serializable.

Definition at line 40 of file TableParts.cc.

uint8_t TableParts::encoding_version ( ) const
overrideprivatevirtual

Returns encoding version.

Returns
Encoding version

Implements Hypertable::Serializable.

Definition at line 36 of file TableParts.cc.

Hypertable::TableParts::operator bool ( ) const
inline

Checks if any table parts are specified.

Returns
true if any table parts are specified, false otherwise.

Definition at line 89 of file TableParts.h.

bool Hypertable::TableParts::primary ( ) const
inline

Test if primary table is included in set.

Returns
true if primary table is included in set, false otherwise

Definition at line 70 of file TableParts.h.

bool Hypertable::TableParts::qualifier_index ( ) const
inline

Test if qualifier index is included in set.

Returns
true if qualifier index is included in set, false otherwise

Definition at line 80 of file TableParts.h.

const std::string TableParts::to_string ( ) const

Returns human readable string describing table parts.

Returns
Human readable string describing table parts.

Definition at line 63 of file TableParts.cc.

bool Hypertable::TableParts::value_index ( ) const
inline

Test if value index is included in set.

Returns
true if value index is included in set, false otherwise

Definition at line 75 of file TableParts.h.

Member Data Documentation

int8_t Hypertable::TableParts::m_parts {}
private

Bitmask representing table parts.

Definition at line 106 of file TableParts.h.


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