StormByte C++ Library: Database module 0.0.9999
StormByte-Database is a StormByte library module for handling database connections
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | List of all members
StormByte::Database::Row Class Reference

Row class for databases. More...

#include <row.hxx>

Classes

class  ConstIterator
 
class  Iterator
 Iterator class for Row. More...
 

Public Types

using iterator = Iterator
 
using const_iterator = ConstIterator
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 

Public Member Functions

 Row () noexcept=default
 Default Constructor.
 
 Row (const Row &other)=default
 Copy Constructor.
 
 Row (Row &&other) noexcept=default
 Move Constructor.
 
 ~Row () noexcept=default
 Destructor.
 
Rowoperator= (const Row &other)=default
 Copy Assignment Operator.
 
Rowoperator= (Row &&other) noexcept=default
 Move Assignment Operator.
 
const Valueoperator[] (std::size_t index) const &
 Gets the number of columns in the Row.
 
Valueoperator[] (std::size_t index) &
 Gets the value at the specified index.
 
Value operator[] (std::size_t index) &&
 Gets the value at the specified index (rvalue)
 
const Valueoperator[] (const std::string &columnName) const &
 Gets the value for the specified column name.
 
Valueoperator[] (const std::string &columnName) &
 Gets the value for the specified column name.
 
Value operator[] (const std::string &columnName) &&
 Gets the value for the specified column name (rvalue)
 
void Add (std::string &&columnName, Value &&value)
 Adds a value to the Row.
 
iterator begin () noexcept
 Gets begin iterator.
 
iterator end () noexcept
 Gets end iterator.
 
const_iterator begin () const noexcept
 Gets const begin iterator.
 
const_iterator end () const noexcept
 Gets const end iterator.
 
const_iterator cbegin () const noexcept
 Gets const begin iterator.
 
const_iterator cend () const noexcept
 Gets const end iterator.
 
reverse_iterator rbegin () noexcept
 Gets reverse begin iterator.
 
reverse_iterator rend () noexcept
 Gets reverse end iterator.
 
const_reverse_iterator rbegin () const noexcept
 Gets const reverse begin iterator.
 
const_reverse_iterator rend () const noexcept
 Gets const reverse end iterator.
 
std::size_t Count () const noexcept
 Gets number of columns in the Row.
 

Detailed Description

Row class for databases.

Constructor & Destructor Documentation

◆ Row() [1/2]

StormByte::Database::Row::Row ( const Row other)
default

Copy Constructor.

Parameters
otherOther Row to copy from

◆ Row() [2/2]

StormByte::Database::Row::Row ( Row &&  other)
defaultnoexcept

Move Constructor.

Parameters
otherOther Row to move from

Member Function Documentation

◆ Add()

void StormByte::Database::Row::Add ( std::string &&  columnName,
Value &&  value 
)
inline

Adds a value to the Row.

Parameters
columnNameOptional name of the column
valueValue to add

◆ begin() [1/2]

const_iterator StormByte::Database::Row::begin ( ) const
inlinenoexcept

Gets const begin iterator.

Returns
ConstIterator to the first element

◆ begin() [2/2]

iterator StormByte::Database::Row::begin ( )
inlinenoexcept

Gets begin iterator.

Returns
Iterator to the first element

◆ cbegin()

const_iterator StormByte::Database::Row::cbegin ( ) const
inlinenoexcept

Gets const begin iterator.

Returns
ConstIterator to the first element

◆ cend()

const_iterator StormByte::Database::Row::cend ( ) const
inlinenoexcept

Gets const end iterator.

Returns
ConstIterator to past the last element

◆ Count()

std::size_t StormByte::Database::Row::Count ( ) const
inlinenoexcept

Gets number of columns in the Row.

Returns
Number of columns in the Row

◆ end() [1/2]

const_iterator StormByte::Database::Row::end ( ) const
inlinenoexcept

Gets const end iterator.

Returns
ConstIterator to past the last element

◆ end() [2/2]

iterator StormByte::Database::Row::end ( )
inlinenoexcept

Gets end iterator.

Returns
Iterator to past the last element

◆ operator=() [1/2]

Row & StormByte::Database::Row::operator= ( const Row other)
default

Copy Assignment Operator.

Parameters
otherOther Row to copy from
Returns
Reference to this Row

◆ operator=() [2/2]

Row & StormByte::Database::Row::operator= ( Row &&  other)
defaultnoexcept

Move Assignment Operator.

Parameters
otherOther Row to move from
Returns
Reference to this Row

◆ operator[]() [1/6]

Value & StormByte::Database::Row::operator[] ( const std::string &  columnName) &

Gets the value for the specified column name.

Parameters
columnNameName of the column
Returns
Reference to the Value for the specified column name
Exceptions
ColumnNotFoundif the column name does not exist

◆ operator[]() [2/6]

Value StormByte::Database::Row::operator[] ( const std::string &  columnName) &&

Gets the value for the specified column name (rvalue)

Parameters
columnNameName of the column
Returns
Value for the specified column name
Exceptions
ColumnNotFoundif the column name does not exist

◆ operator[]() [3/6]

const Value & StormByte::Database::Row::operator[] ( const std::string &  columnName) const &

Gets the value for the specified column name.

Parameters
columnNameName of the column
Returns
Reference to the Value for the specified column name
Exceptions
ColumnNotFoundif the column name does not exist

◆ operator[]() [4/6]

Value & StormByte::Database::Row::operator[] ( std::size_t  index) &

Gets the value at the specified index.

Parameters
indexIndex of the value to retrieve
Returns
Reference to the Value at the specified index
Exceptions
OutOfBoundsif index is out of bounds

◆ operator[]() [5/6]

Value StormByte::Database::Row::operator[] ( std::size_t  index) &&

Gets the value at the specified index (rvalue)

Parameters
indexIndex of the value to retrieve
Returns
Value at the specified index
Exceptions
OutOfBoundsif index is out of bounds

◆ operator[]() [6/6]

const Value & StormByte::Database::Row::operator[] ( std::size_t  index) const &

Gets the number of columns in the Row.

Parameters
indexIndex of the value to retrieve
Returns
Number of columns
Exceptions
OutOfBoundsif index is out of bounds

◆ rbegin() [1/2]

const_reverse_iterator StormByte::Database::Row::rbegin ( ) const
inlinenoexcept

Gets const reverse begin iterator.

Returns
Const reverse iterator to the last element

◆ rbegin() [2/2]

reverse_iterator StormByte::Database::Row::rbegin ( )
inlinenoexcept

Gets reverse begin iterator.

Returns
Reverse iterator to the last element

◆ rend() [1/2]

const_reverse_iterator StormByte::Database::Row::rend ( ) const
inlinenoexcept

Gets const reverse end iterator.

Returns
Const reverse iterator to before the first element

◆ rend() [2/2]

reverse_iterator StormByte::Database::Row::rend ( )
inlinenoexcept

Gets reverse end iterator.

Returns
Reverse iterator to before the first element

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