Represents a list of database columns. More...

#include <columns.hpp>

Inherits detail::token.

Public Types

enum  t_brackets { WITH_BRACKETS , WITHOUT_BRACKETS }
 

Public Member Functions

 columns (const std::initializer_list< std::string > &column_names, t_brackets with_brackets=WITH_BRACKETS)
 Create a list of columns containing given columns and bracket type.
 
 columns (const std::vector< std::string > &column_names, t_brackets with_brackets=WITH_BRACKETS)
 Create a list of columns containing given columns and bracket type.
 
 columns (std::initializer_list< column > cols, t_brackets with_brackets=WITH_BRACKETS)
 Create a list of columns containing given columns and bracket type.
 
 columns (std::initializer_list< std::shared_ptr< column > > cols, t_brackets with_brackets=WITH_BRACKETS)
 Create a list of columns containing given columns and bracket type.
 
 columns (t_brackets with_brackets=WITH_BRACKETS)
 Creates an empty list of columns.
 
 columns (const columns &x)
 
columnsoperator= (const columns &x)
 
void push_back (const std::shared_ptr< column > &col)
 Append a column to the list.
 
columnswith_brackets ()
 Sets columns to be interpreted with surrounding brackets.
 
columnswithout_brackets ()
 Sets columns to be interpreted without surrounding brackets.
 
void accept (token_visitor &visitor) override
 Interface according to the visitor pattern.
 

Static Public Member Functions

static columns all ()
 Creates a columns object representing all columns.
 
static column count_all ()
 A shortcut for a count all column.
 

Public Attributes

std::vector< std::shared_ptr< column > > columns_
 
t_brackets with_brackets_ = WITH_BRACKETS
 

Detailed Description

Represents a list of database columns.

Member Enumeration Documentation

◆ t_brackets

Enum declaring values on howto interpret the column list

Enumerator
WITH_BRACKETS 

Interpret the columns with surrounding brackets

WITHOUT_BRACKETS 

Interpret the columns without surrounding brackets

Constructor & Destructor Documentation

◆ columns() [1/6]

matador::columns::columns ( const std::initializer_list< std::string > &  column_names,
t_brackets  with_brackets = WITH_BRACKETS 
)

Create a list of columns containing given columns and bracket type.

Parameters
column_namesThe list of column names
with_bracketsThe bracket type

◆ columns() [2/6]

matador::columns::columns ( const std::vector< std::string > &  column_names,
t_brackets  with_brackets = WITH_BRACKETS 
)
explicit

Create a list of columns containing given columns and bracket type.

Parameters
column_namesThe list of column names
with_bracketsThe bracket type

◆ columns() [3/6]

matador::columns::columns ( std::initializer_list< column cols,
t_brackets  with_brackets = WITH_BRACKETS 
)

Create a list of columns containing given columns and bracket type.

Parameters
colsThe list of columns
with_bracketsThe bracket type

◆ columns() [4/6]

matador::columns::columns ( std::initializer_list< std::shared_ptr< column > >  cols,
t_brackets  with_brackets = WITH_BRACKETS 
)

Create a list of columns containing given columns and bracket type.

Parameters
colsThe list of columns
with_bracketsThe bracket type

◆ columns() [5/6]

matador::columns::columns ( t_brackets  with_brackets = WITH_BRACKETS)
explicit

Creates an empty list of columns.

Parameters
with_bracketsThe bracket type

◆ columns() [6/6]

matador::columns::columns ( const columns x)

Copy column

Parameters
xColumn to copy

Member Function Documentation

◆ accept()

void matador::columns::accept ( token_visitor &  visitor)
override

Interface according to the visitor pattern.

Parameters
visitorThe visitor obejct to be accepted

◆ all()

static columns matador::columns::all ( )
static

Creates a columns object representing all columns.

Returns
An all columns representing columns object

◆ count_all()

static column matador::columns::count_all ( )
static

A shortcut for a count all column.

Returns
Count all column

◆ operator=()

columns & matador::columns::operator= ( const columns x)

Copy assign column

Parameters
xColumn to copy
Returns
Reference to copied column

◆ push_back()

void matador::columns::push_back ( const std::shared_ptr< column > &  col)

Append a column to the list.

Parameters
colThe column to be appended

◆ with_brackets()

columns & matador::columns::with_brackets ( )

Sets columns to be interpreted with surrounding brackets.

Sets columns to be interpreted with surrounding brackets. After set a references to this is returned.

Returns
A reference to this

◆ without_brackets()

columns & matador::columns::without_brackets ( )

Sets columns to be interpreted without surrounding brackets.

Sets columns to be interpreted without surrounding brackets. After set a references to this is returned.

Returns
A reference to this

Member Data Documentation

◆ columns_

std::vector<std::shared_ptr<column> > matador::columns::columns_

The list of column shared pointer

◆ with_brackets_

t_brackets matador::columns::with_brackets_ = WITH_BRACKETS

The bracket type


The documentation for this struct was generated from the following file:
  • matador/sql/columns.hpp