UDBElement(3)

UDBElement(3) Library Functions Manual UDBElement(3)

NAME

UDBElement - The UDBElement class.

SYNOPSIS

#include <UDBElement.h>

Public Member Functions


UDBElement (const UDBElement &other)
UDBElement (UDBElement &&other)
UDBElement & operator= (const UDBElement &other)
operator = UDBElement & operator= (UDBElement &&other)
operator = bool operator== (const UDBElement &other) const
operator == bool operator!= (const UDBElement &other) const
operator != void writeToBuffer (std::vector< char > &buf)
size_t readFromBuffer (const std::vector< char > &buf, const size_t &start_pos)
size_t calculateWriteSize ()
void shrinkToFit ()

Public Attributes


std::string id
Elements identification value (if any). std::string content
Elements content (if any). std::vector< UDBElement > subelements
Elements subelement (if any).

Detailed Description

The UDBElement class.

This class is suitable for database elements keeping.

Constructor & Destructor Documentation

UDBElement::UDBElement (const UDBElement & other)

Copy constructor.

Parameters

other UDBElement to be copied.

UDBElement::UDBElement (UDBElement && other)

Move constructor.

Parameters

other UDBElement to be moved.

Member Function Documentation

size_t UDBElement::calculateWriteSize ()

Calculates quantity of bytes will be written by writeToBuffer() method.

Returns

Quantity of bytes to be written.

bool UDBElement::operator!= (const UDBElement & other) const

operator !=

Parameters

other UDBElement to be compared.

Returns

true if one of other elements is not equal to this UDBElement corresponding element, false otherwise.

UDBElement & UDBElement::operator= (const UDBElement & other)

operator =

Parameters

other UDBElement to be copied.

Returns

Reference to this UDBElement object.

UDBElement & UDBElement::operator= (UDBElement && other)

operator =

Parameters

other UDBElement to be moved.

Returns

Reference to this UDBElement object.

bool UDBElement::operator== (const UDBElement & other) const

operator ==

Parameters

other UDBElement to be compared.

Returns

true if all elements of other are equal to this UDBElement corresponding elements, false otherwise.

size_t UDBElement::readFromBuffer (const std::vector< char > & buf, const size_t & start_pos)

Tries to read UDBElement from buffer.

Note

This method can throw std::exception in case of errors.

Parameters

buf Buffer UDBElement should be read from.
start_pos Offset of first byte to be read.

Returns

Quantity of bytes have been read.

void UDBElement::shrinkToFit ()

Reduces memory usage by freeing unused memory in internal containers.

void UDBElement::writeToBuffer (std::vector< char > & buf)

Writes this UDBElement to buffer buf.

Parameters

buf Buffer UDBElement should be written to.

Author

Generated automatically by Doxygen for LibUDB from the source code.

Version 1.0.1 LibUDB