matador Namespace Reference

The Open Object Store namespace. More...

Namespaces

namespace  detail
 Detail namespace of the open object store.
 

Classes

class  acceptor
 
class  address
 
class  any
 Simple any class. More...
 
class  any_visitor
 An any visitor class. More...
 
class  bad_optional_access
 
class  base64
 Base64 encode and decode class. More...
 
class  basic_container
 
class  basic_dialect
 Abstract base class for a concrete sql dialect. More...
 
class  basic_file_sink
 A base class for file stream based sinks. More...
 
class  basic_identifier
 
class  basic_json_mapper
 A base class for all kind of json mapping. More...
 
class  basic_object_store_observer
 
class  basic_sql_logger
 Base class for sql logging. More...
 
class  basic_table
 Base class for kind of tables. More...
 
class  buffer
 
class  buffer_view
 Cursor based string buffer. More...
 
struct  column
 Represents a database column. More...
 
struct  columns
 Represents a list of database columns. More...
 
class  condition< column, detail::basic_query >
 Condition class representing an IN condition. More...
 
class  condition< column, std::initializer_list< V > >
 Condition class representing an IN condition. More...
 
class  condition< column, std::pair< T, T > >
 Between condition. More...
 
class  condition< condition< L, R >, void >
 Logical unary condition. More...
 
class  condition< condition< L1, R1 >, condition< L2, R2 > >
 Logical binary condition. More...
 
class  connection
 The connection class represents a connection to a database. More...
 
struct  connection_info
 
class  connector
 
class  const_container_iterator
 Represents a const has many iterator. More...
 
class  const_json_iterator
 An iterator for json array and objects. More...
 
class  const_tree_iterator
 
class  const_tree_iterator_base
 
class  const_tree_leaf_iterator
 
class  const_tree_sibling_iterator
 
class  const_tree_subtree_iterator
 
class  container
 Has many relation class using a std::vector as container. More...
 
class  container_iterator
 Represents a has many iterator. More...
 
struct  data_type_traits
 Type traits for database types. More...
 
class  database_error
 Thrown by db backend containing all available error information's. More...
 
class  date
 This class provides simple date representation. More...
 
struct  date_format
 
struct  dialect_traits
 
class  factory
 A generic factory class. More...
 
class  fdset
 
class  field
 Describes a database column field. More...
 
class  field_attributes
 
class  file
 
class  file_sink
 A file sink writeing log message to one file. More...
 
class  generic_json_parser
 Parses a json string providing callbacks for json syntax. More...
 
class  handler
 
class  html
 
class  identifiable_holder
 
class  identifier
 
class  io_service
 
class  io_stream
 
class  json
 This class represents either a json value an object or an array. More...
 
class  json_exception
 Exception representing json errors. More...
 
class  json_format
 
class  json_iterator
 An iterator for json array and objects. More...
 
class  json_mapper
 
class  json_object_mapper
 
class  json_parser
 Parse a json formatted stream or string. More...
 
class  leader_follower_thread_pool
 
class  library
 Helps to load and unload external libraries. More...
 
class  log_domain
 Connection to a set of log sinks. More...
 
class  log_manager
 Manages all log domains. More...
 
class  log_sink
 Base class for all log sinks. More...
 
class  logger
 logger to write log messages to log domains More...
 
class  null_sql_logger
 
struct  null_type_t
 
class  object_exception
 An serializable exception class. More...
 
class  object_holder
 Base class for the object pointer and reference class. More...
 
class  object_ptr
 The object_ptr holds a pointer to an serializable. More...
 
class  object_store
 A class that stores all kind of objects. More...
 
class  object_view
 Create a view for a concrete serializable type. More...
 
class  optional
 
class  peer_base
 
class  persistence
 Represents the persistence layer for a database and an object_store. More...
 
class  prototype_node
 Holds the prototype of a concrete serializable. More...
 
class  query
 Creates a SQL query. More...
 
class  reactor
 Implementation of the reactor pattern. More...
 
class  result
 Represents a sql query result. More...
 
class  rotating_file_sink
 A rotating log file sink. More...
 
class  row
 Row representation. More...
 
class  schema
 
class  select_fdsets
 
class  sequencer
 Interface to create and get unique sequence numbers. More...
 
class  serializer
 A base class to serialize objects. More...
 
class  session
 Represents a session to a database. More...
 
class  singleton
 Provides only one instance of a type. More...
 
class  socket_acceptor
 
class  socket_base
 
class  socket_stream
 
class  sql_exception
 An serializable exception class. More...
 
class  sql_logger
 
class  statement
 
class  stderr_sink
 Log sink writing to stderr. More...
 
class  stdout_sink
 Log sink writing to stdout. More...
 
class  stream
 
class  stream_handler
 
class  string_cursor
 
class  table
 
class  table< T, typename std::enable_if<!std::is_base_of< basic_has_many_to_many_item, T >::value >::type >
 Represents a database table. More...
 
class  tcp
 
class  test_suite
 The container for all unit tests. More...
 
class  thread_pool
 
class  time
 Simple time class with milliseconds. More...
 
struct  time_format
 
class  transaction
 This class provides the transaction mechanism. More...
 
class  tree
 A STL like tree class. More...
 
class  tree_iterator
 
class  tree_iterator_base
 
class  tree_leaf_iterator
 
class  tree_sibling_iterator
 
class  tree_subtree_iterator
 
struct  type_traits
 
struct  type_traits< object_ptr< ObjectType > >
 
struct  type_traits< varchar< Size > >
 
class  typed_object_store_observer
 Base class for typed object observer classes. More...
 
class  udp
 
class  unit_exception
 Unit exception class thrown on a unit test assert definition. More...
 
class  unit_test
 A unit_test consists of serveral tests. More...
 
struct  value_type_traits
 
struct  value_type_traits< Type, typename std::enable_if< is_builtin< Type >::value >::type >
 
struct  value_type_traits< Type, typename std::enable_if<!is_builtin< Type >::value >::type >
 
class  varchar
 
class  variable
 Holds the functor to a method. More...
 
class  version
 

Typedefs

using sink_ptr = std::shared_ptr< log_sink >
 
typedef std::shared_ptr< action > action_ptr
 
typedef std::vector< action_ptrt_action_vector
 
typedef std::shared_ptr< detail::token > token_ptr
 
typedef std::list< token_ptrtoken_list_t
 
typedef std::shared_ptr< sequencer_impl > sequencer_impl_ptr
 

Enumerations

enum class  log_level {
  LVL_FATAL , LVL_ERROR , LVL_WARN , LVL_INFO ,
  LVL_DEBUG , LVL_TRACE , LVL_ALL
}
 
enum  protocol_family { V4 , V6 }
 
enum class  event_type : unsigned {
  NONE_MASK = 0 , READ_MASK = 1 << 0 , WRITE_MASK = 1 << 1 , EXCEPT_MASK = 1 << 2 ,
  TIMEOUT_MASK = 1 << 3 , ACCEPT_MASK = READ_MASK , READ_WRITE_MASK = READ_MASK | WRITE_MASK , ALL_MASK = READ_MASK | WRITE_MASK | EXCEPT_MASK | ACCEPT_MASK
}
 
enum class  t_build_options { empty = 0 << 0 , with_quotes = 1 << 0 , with_type = 1 << 1 , with_value = 1 << 2 }
 
enum struct  t_query_command {
  UNKNOWN , CREATE , DROP , SELECT ,
  INSERT , UPDATE , REMOVE
}
 
enum struct  data_type {
  type_char = 0 , type_short , type_int , type_long ,
  type_long_long , type_unsigned_char , type_unsigned_short , type_unsigned_int ,
  type_unsigned_long , type_unsigned_long_long , type_float , type_double ,
  type_bool , type_char_pointer , type_varchar , type_text ,
  type_date , type_time , type_blob , type_null ,
  type_unknown
}
 Enumeration type of all supported builtin data types. More...
 
enum struct  database_type {
  type_char = 0 , type_float , type_double , type_smallint ,
  type_int , type_bigint , type_bool , type_char_pointer ,
  type_varchar , type_text , type_date , type_time ,
  type_blob , type_null , type_unknown
}
 Enumeration of database data types. More...
 
enum class  cascade_type {
  NONE = 0 , REMOVE = 1 , UPDATE = 2 , INSERT = 4 ,
  ALL = REMOVE | UPDATE | INSERT
}
 Cascade types for database actions. More...
 
enum class  constraints : unsigned char {
  NONE = 0 , NOT_NULL = 1 << 0 , INDEX = 1 << 1 , UNIQUE = 1 << 2 ,
  PRIMARY_KEY = 1 << 3 , FOREIGN_KEY = 1 << 4 , DEFAULT = 1 << 5 , UNIQUE_NOT_NULL = UNIQUE | NOT_NULL
}
 
enum class  month : unsigned short {
  january = 1 , february , march , april ,
  may , june , july , august ,
  september , november , december
}
 

Functions

template<class T >
bool operator< (const json &a, const T &b)
 
template<class T >
bool operator< (const T &a, const json &b)
 
template<class T >
bool operator<= (const json &a, const T &b)
 
template<class T >
bool operator<= (const T &a, const json &b)
 
template<class T >
bool operator> (const json &a, const T &b)
 
template<class T >
bool operator> (const T &a, const json &b)
 
template<class T >
bool operator>= (const json &a, const T &b)
 
template<class T >
bool operator>= (const T &a, const json &b)
 
OOS_JSON_API std::string to_string (const json &j)
 
template<class R >
std::ostream & join (R &range, std::ostream &out, const std::string &delim)
 
template<class R >
std::string join (R &range, const std::string &delim)
 
template<class K , class V >
std::ostream & join (std::map< K, V > &range, std::ostream &out, const std::string &delim)
 
template<class K , class V >
std::string join (std::map< K, V > &range, const std::string &delim)
 
OOS_LOGGER_API std::ostream & operator<< (std::ostream &os, log_level lvl)
 
OOS_LOGGER_API std::shared_ptr< file_sinkcreate_file_sink (const std::string &logfile)
 
OOS_LOGGER_API std::shared_ptr< stderr_sinkcreate_stderr_sink ()
 
OOS_LOGGER_API std::shared_ptr< stdout_sinkcreate_stdout_sink ()
 
OOS_LOGGER_API std::shared_ptr< rotating_file_sinkcreate_rotating_file_sink (const std::string &logfile, size_t max_size, size_t file_count)
 
OOS_LOGGER_API void default_min_log_level (log_level min_lvl)
 
OOS_LOGGER_API void default_max_log_level (log_level max_lvl)
 
OOS_LOGGER_API void domain_min_log_level (const std::string &name, log_level min_lvl)
 
OOS_LOGGER_API void domain_max_log_level (const std::string &name, log_level max_lvl)
 
OOS_LOGGER_API void add_log_sink (sink_ptr sink)
 
OOS_LOGGER_API void add_log_sink (sink_ptr sink, const std::string &domain)
 
OOS_LOGGER_API void clear_all_log_sinks ()
 
OOS_LOGGER_API void clear_all_log_sinks (const std::string &domain)
 
OOS_LOGGER_API logger create_logger (std::string source)
 
OOS_LOGGER_API logger create_logger (std::string source, const std::string &domain)
 
OOS_LOGGER_API void log_default (log_level lvl, const std::string &source, const char *message)
 
template<typename... ARGS>
void log (log_level lvl, const std::string &source, const char *what, ARGS const &... args)
 
event_type operator| (event_type a, event_type b)
 
event_type operator& (event_type a, event_type b)
 
event_type operator~ (event_type a)
 
event_type operator^ (event_type a, event_type b)
 
event_typeoperator|= (event_type &a, event_type b)
 
event_typeoperator&= (event_type &a, event_type b)
 
event_typeoperator^= (event_type &a, event_type b)
 
bool is_event_type_set (event_type source, event_type needle)
 
bool is_valid_socket (socket_type fd)
 
template<typename O , class T >
bool set (O *obj, const std::string &name, const T &val)
 
template<typename O , class T >
bool append (O *obj, const std::string &name, const T &val)
 
template<typename O , class T >
bool remove (O *obj, const std::string &name, const T &val)
 
template<typename O , class T >
bool set (O &obj, const std::string &name, const T &val)
 
template<typename O , class T >
bool append (O &obj, const std::string &name, const T &val)
 
template<typename O , class T >
bool remove (O &obj, const std::string &name, const T &val)
 
template<typename O >
bool set (O &obj, const std::string &name, const char *val)
 
template<typename O , class T >
bool get (const O &obj, const std::string &name, T &val)
 
template<typename O >
bool get (const O &obj, const std::string &name, char *val, size_t size)
 
template<typename O , class T >
bool get (const O &obj, const std::string &name, T &val, size_t precision)
 
template<class R , class O >
variable< R > make_var (R(O::*mem_func)() const)
 Create a variable with depth zero.
 
template<class R , class O , class O1 >
variable< R > make_var (O1(O::*mem_func)() const, R(O1::object_type::*mem_func_1)() const)
 Create a variable with depth one.
 
template<class R , class O , class O1 , class O2 >
variable< R > make_var (O1(O::*mem_func)() const, O2(O1::object_type::*mem_func_1)() const, R(O2::object_type::*mem_func_2)() const)
 Create a variable with depth two.
 
template<class R , class O , class O1 , class O2 , class O3 >
variable< R > make_var (O1(O::*mem_func)() const, O2(O1::object_type::*mem_func_1)() const, O3(O2::object_type::*mem_func_2)() const, R(O3::object_type::*mem_func_3)() const)
 Create a variable with depth two.
 
t_build_options operator| (t_build_options a, t_build_options b)
 
t_build_options operator|= (t_build_options &a, t_build_options b)
 
t_build_options operator& (t_build_options a, t_build_options b)
 
bool is_build_options_set (t_build_options source, t_build_options needle)
 
column operator""_col (const char *name, size_t len)
 
std::shared_ptr< columnmake_column (const std::string &name, const field_attributes &attr=null_attributes, const matador::any &val={})
 
std::shared_ptr< columnmake_column (const std::string &name, data_type type, size_t index, const field_attributes &attr=null_attributes)
 
template<typename Type >
std::shared_ptr< columnmake_column (const std::string &name, const field_attributes &attr=null_attributes)
 
template<typename Type >
std::shared_ptr< columnmake_column (const std::string &name, const Type &val, const field_attributes &attr=null_attributes)
 
std::shared_ptr< columnmake_column (const std::string &name, data_type type, const matador::any &val, t_build_options options, size_t index, const field_attributes &attr=null_attributes)
 
template<typename Type >
std::shared_ptr< columnmake_pk_column (const std::string &name, size_t max_size=0)
 
template<>
std::shared_ptr< columnmake_pk_column< std::string > (const std::string &name, size_t max_size)
 
std::shared_ptr< columnmake_pk_column (const std::string &name, data_type type, size_t index, size_t max_size=0)
 
std::shared_ptr< columnmake_null_column (const std::string &name, const field_attributes &attr)
 
template<class V >
condition< column, std::initializer_list< V > > in (const matador::column &col, std::initializer_list< V > args)
 Creates an IN condition for a given column and a list of values.
 
condition< column, detail::basic_queryin (const matador::column &col, detail::basic_query &q)
 Creates an IN condition for a given column and a query to be executed.
 
template<class T >
condition< column, std::pair< T, T > > between (const matador::column &col, T low, T high)
 Creates a between condition.
 
condition< column, std::string > like (const matador::column &col, const std::string &val)
 Creates a like condition.
 
template<class T >
condition< column, T > operator== (const column &col, T val)
 Condition equality operator for a column and a value.
 
condition< column, detail::basic_queryequals (const column &col, detail::basic_query &q)
 Condition equality method for a column and a query.
 
template<class T >
condition< column, T > operator!= (const column &col, T val)
 Condition unequality operator for a column and a value.
 
template<class T >
condition< column, T > operator< (const column &col, T val)
 Condition less operator for a column and a value.
 
template<class T >
condition< column, T > operator<= (const column &col, T val)
 Condition less or equal operator for a column and a value.
 
template<class T >
condition< column, T > operator> (const column &col, T val)
 Condition greater operator for a column and a value.
 
template<class T >
condition< column, T > operator>= (const column &col, T val)
 Condition greater or equal operator for a column and a value.
 
template<class L1 , class R1 , class L2 , class R2 >
condition< condition< L1, R1 >, condition< L2, R2 > > operator&& (const condition< L1, R1 > &l, const condition< L2, R2 > &r)
 AND operation condition consisting of a left and right hand condition.
 
template<class L1 , class R1 , class L2 , class R2 >
condition< condition< L1, R1 >, condition< L2, R2 > > operator|| (const condition< L1, R1 > &l, const condition< L2, R2 > &r)
 OR operation condition consisting of a left and right hand condition.
 
template<class L , class R >
condition< condition< L, R >, void > operator! (const condition< L, R > &c)
 Negates a given condition.
 
template<class L , class R >
std::shared_ptr< detail::basic_condition > make_condition (const condition< L, R > &cond)
 Creates a shared condition from a given condition object.
 
template<class T >
query< T > select (const std::string &table)
 Creates a select query for type T.
 
query< rowselect (columns cols)
 Creates a query for given columns.
 
template<class InputIterator , class Function , class Predicate >
Function for_each_if (InputIterator first, InputIterator last, Predicate pred, Function f)
 Applies a function if element is valid with given predicate.
 
template<class InputIterator , class Function , class T >
Function for_each_equal (InputIterator first, InputIterator last, const T &value, Function f)
 Applies a function if element is equal to the given value.
 
template<class B , class D >
const B * base_class (const D *derived)
 Safely casts a given derived class to its base class.
 
template<class B , class D >
B * base_class (D *derived)
 Safely casts a given derived class to its base class.
 
template<class T >
identifier< T > make_identifier (T val)
 
cascade_type operator~ (cascade_type a)
 
cascade_type operator| (cascade_type a, cascade_type b)
 
cascade_type operator& (cascade_type a, cascade_type b)
 
cascade_type operator^ (cascade_type a, cascade_type b)
 
cascade_typeoperator|= (cascade_type &a, cascade_type b)
 
cascade_typeoperator&= (cascade_type &a, cascade_type b)
 
cascade_typeoperator^= (cascade_type &a, cascade_type b)
 
constraints operator| (constraints a, constraints b)
 
constraints operator& (constraints a, constraints b)
 
bool is_constraint_set (constraints source, constraints needle)
 
OOS_UTILS_API std::string read_as_text (const file &f)
 
OOS_UTILS_API std::string hmac (const std::string &key, const std::string &message)
 
OOS_UTILS_API std::string hmac (const char *key, size_t keylen, const char *message, size_t msglen)
 
const detail::nullopt_t nullopt ((detail::nullopt_t::init()))
 
template<typename T , typename U >
bool operator== (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator!= (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator< (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator> (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator<= (optional< T > const &x, optional< U > const &y)
 
template<typename T , typename U >
bool operator>= (optional< T > const &x, optional< U > const &y)
 
template<typename T >
bool operator== (optional< T > const &x, detail::nullopt_t)
 
template<typename T >
bool operator== (detail::nullopt_t, optional< T > const &x)
 
template<typename T >
bool operator!= (optional< T > const &x, detail::nullopt_t)
 
template<typename T >
bool operator!= (detail::nullopt_t, optional< T > const &x)
 
template<typename T >
optional< T > make_optional (const T &v)
 
template<class T , template< class ... > class C, class Allocator = std::allocator<T>>
stream< T > make_stream (C< T, Allocator > &&container)
 
template<typename T >
stream< T > make_stream (T &&from, T &&to)
 
template<typename T >
stream< T > make_stream (std::initializer_list< T > elems)
 
template<typename T >
stream< T > make_stream_counter (T &&from)
 
template<typename T , typename U >
stream< T > make_stream (T &&from, T &&to, const U &increment)
 
template<typename T , typename U >
stream< T > make_stream_counter (T &&from, const U &increment)
 
template<class T , template< class ... > class C, class Allocator >
stream< T > make_stream (const C< T, Allocator > &container)
 
template<class T , template< class U=T > class C>
stream< T > make_stream (C< T > &&container)
 
OOS_UTILS_API size_t split (const std::string &str, char delim, std::vector< std::string > &values)
 
OOS_UTILS_API size_t split (const std::string &str, char delim, std::list< std::string > &values)
 
OOS_UTILS_API std::string trim (const std::string &str, const std::string &whitespace=" \t")
 
OOS_UTILS_API void replace_all (std::string &in, const std::string &from, const std::string &to)
 
OOS_UTILS_API std::string to_string (const matador::time &x, const char *format=time_format::ISO8601)
 
OOS_UTILS_API std::string to_string (const matador::date &x, const char *format=date_format::ISO8601)
 
template<class T >
std::string to_string (T x, size_t precision=0, typename std::enable_if< std::is_floating_point< T >::value >::type *=0)
 
OOS_UTILS_API const char * skip_ws (const char *str)
 
OOS_UTILS_API bool is_eos (char c)
 
OOS_UTILS_API std::size_t acquire_thread_index (std::thread::id id)
 
OOS_UTILS_API void localtime (const time_t &in, struct tm &out)
 
OOS_UTILS_API void gmtime (const time_t &in, struct tm &out)
 
OOS_UTILS_API size_t strftime (char *buffer, size_t size, const char *format, const time_info &ti)
 
OOS_UTILS_API void gettimeofday (time_info &ti)
 

Variables

const field_attributes null_attributes {}
 

Detailed Description

The Open Object Store namespace.

This is the namespace where all OOS related classes, function and code should be put into.

Typedef Documentation

◆ action_ptr

typedef std::shared_ptr<action> matador::action_ptr

Shortcut to an action shared pointer

◆ sequencer_impl_ptr

typedef std::shared_ptr<sequencer_impl> matador::sequencer_impl_ptr

Shortcut for sequencer implementation pointer

◆ sink_ptr

using matador::sink_ptr = typedef std::shared_ptr<log_sink>

Shortcut to log sink shared pointer

◆ t_action_vector

typedef std::vector<action_ptr> matador::t_action_vector

Shortcut to a vector of action shared pointer

◆ token_list_t

typedef std::list<token_ptr> matador::token_list_t

Shortcut to a list of token shared pointer

◆ token_ptr

typedef std::shared_ptr<detail::token> matador::token_ptr

Shortcut to a token shared pointer

Enumeration Type Documentation

◆ cascade_type

enum class matador::cascade_type
strong

Cascade types for database actions.

Enumerator
NONE 

Cascade type none

REMOVE 

Cascade type remove

UPDATE 

Cascade type update

INSERT 

Cascade type insert

ALL 

Cascade type all

◆ data_type

enum struct matador::data_type
strong

Enumeration type of all supported builtin data types.

Enumerator
type_char 

Data type char

type_short 

Data type short

type_int 

Data type int

type_long 

Data type long

type_long_long 

Data type long long

type_unsigned_char 

Data type unsigned char

type_unsigned_short 

Data type unsigned short

type_unsigned_int 

Data type unsigned int

type_unsigned_long 

Data type unsigned long

type_unsigned_long_long 

Data type unsigned long long

type_float 

Data type float

type_double 

Data type double

type_bool 

Data type bool

type_char_pointer 

Data type character pointer

type_varchar 

Data type varchar

type_text 

Data type text

type_date 

Data type date

type_time 

Data type time

type_blob 

Data type blob

type_null 

Data type null

type_unknown 

Data type unknown

◆ database_type

enum struct matador::database_type
strong

Enumeration of database data types.

Enumerator
type_char 

Data type char

type_float 

Data type float

type_double 

Data type double

type_smallint 

Data type small int

type_int 

Data type integer

type_bigint 

Data type big integer

type_bool 

Data type bool

type_char_pointer 

Data type character pointer

type_varchar 

Data type varchar

type_text 

Data type text

type_date 

Data type date

type_time 

Data type time

type_blob 

Data type blob

type_null 

Data type null

type_unknown 

Data type unknown

◆ event_type

enum class matador::event_type : unsigned
strong

Enum representing an event processing mask for the reactor io dispatcher. The mask values can be bitwise combined and are used to check if a handler (

See also
handler.hpp) is able to read, write or accept.
Enumerator
NONE_MASK 

Enum value for no event

READ_MASK 

Enum value for read mask

WRITE_MASK 

Enum value for write mask

EXCEPT_MASK 

Enum value for except mask

TIMEOUT_MASK 

Enum value for timeout mask

ACCEPT_MASK 

Enum value for accept mask

READ_WRITE_MASK 

Enum value for read write mask

ALL_MASK 

Enum value for all events mask

◆ log_level

enum class matador::log_level
strong

Represents all available log levels

Enumerator
LVL_FATAL 

If a serious error occurred use FATAL level

LVL_ERROR 

On error use ERROR level

LVL_WARN 

Warnings should use WARN level

LVL_INFO 

Information should go with INFO level

LVL_DEBUG 

Debug output should use DEBUG level

LVL_TRACE 

Trace information should use TRACE level

LVL_ALL 

This level represents all log levels and should be used for logging

◆ protocol_family

Enum representing the protocol family IPv4 and IPv6

Enumerator
V4 

IPv4 enum value

V6 

IPv6 enum value

◆ t_query_command

enum struct matador::t_query_command
strong

Enumeration of query command types

Enumerator
UNKNOWN 

Unknown query command

CREATE 

Create query command

DROP 

Drop query command

SELECT 

Select query command

INSERT 

Insert query command

UPDATE 

Update query command

REMOVE 

Remove query command

Function Documentation

◆ acquire_thread_index()

OOS_UTILS_API std::size_t matador::acquire_thread_index ( std::thread::id  id)

Returns the current unique number for the given thread id.

Parameters
idThread id for which a unique is acquired.
Returns
The thread number.

◆ add_log_sink() [1/2]

OOS_LOGGER_API void matador::add_log_sink ( sink_ptr  sink)

Adds a log sink to the default log domain

Parameters
sinkThe log sink to add

◆ add_log_sink() [2/2]

OOS_LOGGER_API void matador::add_log_sink ( sink_ptr  sink,
const std::string &  domain 
)

Adds a log sink to the log domain with the given name. If the domain doesn't exists it is created.

Parameters
sinkThe log sink to add
domainThe log domain name to add

◆ append() [1/2]

template<typename O , class T >
bool matador::append ( O &  obj,
const std::string &  name,
const T &  val 
)

Appends a value to an object member identified by the given name. The object is passed by reference. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be appended.
TThe type of the value to be appended.
Parameters
objThe object reference to append the value to.
nameThe name of the member variable.
valThe value to append.
Returns
True if the operation succeeds.

◆ append() [2/2]

template<typename O , class T >
bool matador::append ( O *  obj,
const std::string &  name,
const T &  val 
)

Appends a value to an object member identified by the given name. The object is passed as pointer. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be appended.
TThe type of the value to be appended.
Parameters
objThe object pointer to append the value to.
nameThe name of the member variable.
valThe value to append.
Returns
True if the operation succeeds.

◆ base_class() [1/2]

template<class B , class D >
const B * matador::base_class ( const D *  derived)

Safely casts a given derived class to its base class.

Template Parameters
BThe base class type
DThe class type of the derived class
Parameters
derivedThe derived object
Returns
The casted object

◆ base_class() [2/2]

template<class B , class D >
B * matador::base_class ( D *  derived)

Safely casts a given derived class to its base class.

Template Parameters
BThe base class type
DThe class type of the derived class
Parameters
derivedThe derived object
Returns
The casted object

◆ between()

template<class T >
condition< column, std::pair< T, T > > matador::between ( const matador::column col,
low,
high 
)

Creates a between condition.

Creates a between condition for the given column with the given range consisting of a low and high value

Template Parameters
TThe type of the column and range
Parameters
colThe column for the between condition
lowThe low value of the range
highThe high value of the range
Returns
The condition object

◆ clear_all_log_sinks() [1/2]

OOS_LOGGER_API void matador::clear_all_log_sinks ( )

Removes all sinks from the default domain

◆ clear_all_log_sinks() [2/2]

OOS_LOGGER_API void matador::clear_all_log_sinks ( const std::string &  domain)

Removes all sinks from the log domain with given domain name

Parameters
domainDomain name to clear all sinks

◆ create_file_sink()

OOS_LOGGER_API std::shared_ptr< file_sink > matador::create_file_sink ( const std::string &  logfile)

Shortcut to create a file log sink with the given path. If the path doesn't exists it is created.

Parameters
logfilePath to the logfile
Returns
A shared_ptr to the file_sink

◆ create_logger() [1/2]

OOS_LOGGER_API logger matador::create_logger ( std::string  source)

Creates a logger with the given source name connected to the default log domain.

Parameters
sourceThe name of the source
Returns
The logger instance

◆ create_logger() [2/2]

OOS_LOGGER_API logger matador::create_logger ( std::string  source,
const std::string &  domain 
)

Creates a logger with the given source name connected to the log domain with the given name. If the domain doesn't exists it is created

Parameters
sourceThe name of the source
domainThe name of the log domain
Returns
The logger instance

◆ create_rotating_file_sink()

OOS_LOGGER_API std::shared_ptr< rotating_file_sink > matador::create_rotating_file_sink ( const std::string &  logfile,
size_t  max_size,
size_t  file_count 
)

Shortcut to create a rotating file log sink with the given path, max log files and max log file size. If the path doesn't exists it is created.

Parameters
logfilePath to the log file
max_sizeMax log file size
file_countMax number of log files
Returns
A shared_ptr to the rotating_file_sink

◆ create_stderr_sink()

OOS_LOGGER_API std::shared_ptr< stderr_sink > matador::create_stderr_sink ( )

Shortcut to create a stderr log sink.

Returns
A shared_ptr to the stderr_sink

◆ create_stdout_sink()

OOS_LOGGER_API std::shared_ptr< stdout_sink > matador::create_stdout_sink ( )

Shortcut to create a stdout log sink.

Returns
A shared_ptr to the stdout_sink

◆ default_max_log_level()

OOS_LOGGER_API void matador::default_max_log_level ( log_level  max_lvl)

Sets the default max log level.

Parameters
max_lvlDefault max log level

◆ default_min_log_level()

OOS_LOGGER_API void matador::default_min_log_level ( log_level  min_lvl)

Sets the default min log level.

Parameters
min_lvlDefault min log level

◆ domain_max_log_level()

OOS_LOGGER_API void matador::domain_max_log_level ( const std::string &  name,
log_level  max_lvl 
)

Sets the default max log level for the domain with the given name.

Parameters
nameLog domain name
max_lvlDefault max log level

◆ domain_min_log_level()

OOS_LOGGER_API void matador::domain_min_log_level ( const std::string &  name,
log_level  min_lvl 
)

Sets the domain min log level for the domain with the given name.

Parameters
nameLog domain name
min_lvlDefault min log level

◆ equals()

condition< column, detail::basic_query > matador::equals ( const column col,
detail::basic_query q 
)

Condition equality method for a column and a query.

Creates a condition object of a column and a query checked on equality.

Parameters
colThe column object
qThe query to compare with
Returns
The condition object representing the equality operation

◆ for_each_equal()

template<class InputIterator , class Function , class T >
Function matador::for_each_equal ( InputIterator  first,
InputIterator  last,
const T &  value,
Function  f 
)

Applies a function if element is equal to the given value.

Applies given function for each element in the sequence if the element is equal to the given value,

Template Parameters
InputIteratorType of iterator to iterate with.
FunctionType of the function to call.
Parameters
firstThe initial iterator containing the starting position for the range.
lastThe final iterator containing the ending position for the range.
valueThe value to compare with.
fThe function called with each element which is equal to the value.
Returns
The called function.

◆ for_each_if()

template<class InputIterator , class Function , class Predicate >
Function matador::for_each_if ( InputIterator  first,
InputIterator  last,
Predicate  pred,
Function  f 
)

Applies a function if element is valid with given predicate.

Applies given function for each element in the sequence which returns true when called with the predicate,

Template Parameters
InputIteratorType of iterator to iterate with.
FunctionType of the function to call.
PredicateFunction or class which must be called with the element
Parameters
firstThe initial iterator containing the starting position for the range.
lastThe final iterator containing the ending position for the range.
predThe predicate called with each element
fThe function called with each element which returned true with the predicate.
Returns
The called function.

◆ get() [1/3]

template<typename O >
bool matador::get ( const O &  obj,
const std::string &  name,
char *  val,
size_t  size 
)

Gets the value of a member identified by the given name into a character array. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be get.
Parameters
objThe object to get the value from.
nameThe name of the member variable.
valThe pointer to a character array.
sizeThe size of the character array.
Returns
True if the operation succeeds.

◆ get() [2/3]

template<typename O , class T >
bool matador::get ( const O &  obj,
const std::string &  name,
T &  val 
)

Gets the value of a member identified by the given name. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be get.
TThe type of the value to retrieve.
Parameters
objThe object to get the value from.
nameThe name of the member variable.
valThe reference where the value is assigned to.
Returns
True if the operation succeeds.

◆ get() [3/3]

template<typename O , class T >
bool matador::get ( const O &  obj,
const std::string &  name,
T &  val,
size_t  precision 
)

Gets the value of a member identified by the given name. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be get.
TThe type of the value to retrieve.
Parameters
objThe object to get the value from.
nameThe name of the member variable.
valThe reference where the value is assigned to.
precisionThe precision of the value to get.
Returns
True if the operation succeeds.

◆ gettimeofday()

OOS_UTILS_API void matador::gettimeofday ( time_info &  ti)

Multi platform version of gettimeofday

Parameters
tpTimeval struct where the result ist stored
Returns
Returns 0 on success

◆ gmtime()

OOS_UTILS_API void matador::gmtime ( const time_t &  in,
struct tm &  out 
)

Multi platform version of gmtime

Parameters
intime_t value to be converted
outconverted value

◆ hmac() [1/2]

OOS_UTILS_API std::string matador::hmac ( const char *  key,
size_t  keylen,
const char *  message,
size_t  msglen 
)

Encodes the given string message with the given key and returns the encoded string.

Parameters
keyKey to be used for encoding.
keylenLength of the key.
messageMessage to be encoded.
msglenLength of the message.
Returns
The encoded message.

◆ hmac() [2/2]

OOS_UTILS_API std::string matador::hmac ( const std::string &  key,
const std::string &  message 
)

Encodes the given string message with the given key and returns the encoded string.

Parameters
keyKey to be used for encoding.
messageMessage to be encoded.
Returns
The encoded message.

◆ in() [1/2]

condition< column, detail::basic_query > matador::in ( const matador::column col,
detail::basic_query q 
)

Creates an IN condition for a given column and a query to be executed.

Parameters
colThe column to compare
qThe query to be executes as sub select
Returns
The condition object

◆ in() [2/2]

template<class V >
condition< column, std::initializer_list< V > > matador::in ( const matador::column col,
std::initializer_list< V >  args 
)

Creates an IN condition for a given column and a list of values.

Template Parameters
VThe type of the list arguments
Parameters
colThe column to compare
argsThe list of values
Returns
The condition object

◆ is_eos()

OOS_UTILS_API bool matador::is_eos ( char  c)

Checks if the given character is end of string.

Parameters
cCharacter to check
Returns
True if character is end of string

◆ is_event_type_set()

bool matador::is_event_type_set ( event_type  source,
event_type  needle 
)
inline

Checks if a specific event_type is set in a given event type mask. If type is set true is returned.

Parameters
sourceEvent type mask to check.
needleRequested event type
Returns
True if event type is set

◆ join() [1/4]

template<class R >
std::string matador::join ( R &  range,
const std::string &  delim 
)

Joins a range of elements as string within a list with a given delimiter and writes it to the given stream

Template Parameters
RType og the range (e.g. map, list, vector, etc)
Parameters
rangeThe range with the elements to join
delimThe delimiter for the elements
Returns
The ostream reference

◆ join() [2/4]

template<class R >
std::ostream & matador::join ( R &  range,
std::ostream &  out,
const std::string &  delim 
)

Joins a range of elements as string within a list with a given delimiter and writes it to the given stream

Template Parameters
RType of the range (e.g. map, list, vector, etc)
Parameters
rangeThe range with the elements to join
outThe stream to write on
delimThe delimiter for the elements
Returns
The ostream reference

◆ join() [3/4]

template<class K , class V >
std::string matador::join ( std::map< K, V > &  range,
const std::string &  delim 
)

Joins a map of key value pairs as string within a list with a given delimiter and writes it to the given stream.

The key value pairs will be written in a json style: ("key": value)

Template Parameters
KType of key
VType of value
Parameters
rangeThe range with the elemets to join
delimThe delimiter for the elements
Returns
The ostream reference

◆ join() [4/4]

template<class K , class V >
std::ostream & matador::join ( std::map< K, V > &  range,
std::ostream &  out,
const std::string &  delim 
)

Joins a map of key value pairs as string within a list with a given delimiter and writes it to the given stream.

The key value pairs will be written in a json style: ("key": value)

Template Parameters
KType of key
VType of value
Parameters
rangeThe range with the elemets to join
outThe stream to write on
delimThe delimiter for the elements
Returns
The ostream reference

◆ like()

condition< column, std::string > matador::like ( const matador::column col,
const std::string &  val 
)

Creates a like condition.

Creates a like condition for the given column and the given value string.

Parameters
colThe column for the like condition
valThe value to the like operator
Returns
The like condition object

◆ localtime()

OOS_UTILS_API void matador::localtime ( const time_t &  in,
struct tm &  out 
)

Multi platform version of localtime

Parameters
intime_t value to be converted
outconverted value

◆ log()

template<typename... ARGS>
void matador::log ( log_level  lvl,
const std::string &  source,
const char *  what,
ARGS const &...  args 
)

Log the given message with source and log level to the default domain. The message will be created from the what argument and the args while the preprocessed message uses the printf style to add the arguments.

Template Parameters
ARGSType of the arguments
Parameters
lvlLog level
sourceSource of the log message
whatThe printf style message
argsThe arguments for the message

◆ log_default()

OOS_LOGGER_API void matador::log_default ( log_level  lvl,
const std::string &  source,
const char *  message 
)

Logs the given message for the given source and log level to the default log domain.

Parameters
lvlLog level
sourceSource of the log message
messageMessage to log

◆ make_condition()

template<class L , class R >
std::shared_ptr< detail::basic_condition > matador::make_condition ( const condition< L, R > &  cond)

Creates a shared condition from a given condition object.

Template Parameters
LThe left hand type of the condition
RThe right hand type of the condition
Parameters
condThe condition to be copied
Returns
A shared condition pointer representing the given condition

◆ make_identifier()

template<class T >
identifier< T > matador::make_identifier ( val)

Creates an identifier object from the given value

Template Parameters
TType of the value
Parameters
valThe primary key value
Returns
The created identifier

◆ make_optional()

template<typename T >
optional< T > matador::make_optional ( const T &  v)
inline

Creates an optional from the given value.

Template Parameters
TType of optional value
Parameters
vValue for optional
Returns
The created optional.

◆ make_stream() [1/6]

template<class T , template< class U=T > class C>
stream< T > matador::make_stream ( C< T > &&  container)

Creates a stream from the given moved container.

Template Parameters
TType of the elements in the container
CType of the container
Parameters
containerThe container
Returns
Stream ready to iterate over the elements of the container

◆ make_stream() [2/6]

template<class T , template< class ... > class C, class Allocator = std::allocator<T>>
stream< T > matador::make_stream ( C< T, Allocator > &&  container)

Creates a new stream of the given container.

Template Parameters
TType of the stream elements
CType of the container
AllocatorType of the allocator
Parameters
containerContainer to create the stream from
Returns
The created stream

◆ make_stream() [3/6]

template<class T , template< class ... > class C, class Allocator >
stream< T > matador::make_stream ( const C< T, Allocator > &  container)

Creates a stream from the given container

Template Parameters
TType of the elements in the container
CType of the container
AllocatorType of the allocator class
Parameters
containerThe container
Returns
Stream ready to iterate over the elements of the container

◆ make_stream() [4/6]

template<typename T >
stream< T > matador::make_stream ( std::initializer_list< T >  elems)

Creates a stream fro an initializer list of elements

Template Parameters
TType of elements
Parameters
elemsElements to create the stream from
Returns
The created stream

◆ make_stream() [5/6]

template<typename T >
stream< T > matador::make_stream ( T &&  from,
T &&  to 
)

Creates a stream of given begin an end iterator.

Template Parameters
TType of the iterator
Parameters
frombegin iterator
toend iterator
Returns
The created stream

◆ make_stream() [6/6]

template<typename T , typename U >
stream< T > matador::make_stream ( T &&  from,
T &&  to,
const U &  increment 
)

Creates a stream range given limits from and to and an incrementing value. Once the to value is reached or exceeded the stream is finished.

Template Parameters
TType of elements
UType of increment value
Parameters
fromStarting value of stream
toClosing value of stream
incrementIncrementing value
Returns
The created stream

◆ make_stream_counter() [1/2]

template<typename T >
stream< T > matador::make_stream_counter ( T &&  from)

Creates a continuing stream source of type T. Value of T is increased with the ++ operator so T must provide this operator.

Template Parameters
TType of elements
Parameters
fromStarting value of elements
Returns
The created stream

◆ make_stream_counter() [2/2]

template<typename T , typename U >
stream< T > matador::make_stream_counter ( T &&  from,
const U &  increment 
)

Creates a continuing stream source of type T beginning with from and incremented by the given incrementing value.

Template Parameters
TType of elements
UType of increment value
Parameters
fromStarting value of elements
incrementIncrementing value
Returns
The created stream

◆ make_var() [1/4]

template<class R , class O , class O1 , class O2 , class O3 >
variable< R > matador::make_var ( O1(O::*)() const  mem_func,
O2(O1::object_type::*)() const  mem_func_1,
O3(O2::object_type::*)() const  mem_func_2,
R(O3::object_type::*)() const  mem_func_3 
)

Create a variable with depth two.

Template Parameters
RThe return value type
OThe proxy serializable type
O1The nested serializable type
O2The nested serializable type
O3The nested serializable type

Creates a variable with depth one. That means that a value of a nested serializable is requested.

Parameters
mem_funcA member function of the object_type.
mem_func_1A member function of the nested object_type.
mem_func_2A member function of the nested object_type.
mem_func_3A member function of the nested object_type.
Returns
A variable with return type R.

◆ make_var() [2/4]

template<class R , class O , class O1 , class O2 >
variable< R > matador::make_var ( O1(O::*)() const  mem_func,
O2(O1::object_type::*)() const  mem_func_1,
R(O2::object_type::*)() const  mem_func_2 
)

Create a variable with depth two.

Template Parameters
RThe return value type
OThe proxy serializable type
O1The nested serializable type
O2The nested serializable type

Creates a variable with depth one. That means that a value of a nested serializable is requested.

Parameters
mem_funcA member function of the object_type.
mem_func_1A member function of the nested object_type.
mem_func_2A member function of the nested object_type.
Returns
A variable with return type R.

◆ make_var() [3/4]

template<class R , class O , class O1 >
variable< R > matador::make_var ( O1(O::*)() const  mem_func,
R(O1::object_type::*)() const  mem_func_1 
)

Create a variable with depth one.

Template Parameters
RThe return value type
OThe proxy serializable type
O1The serializable type

Creates a variable with depth one. That means that a value of a nested serializable is requested.

Parameters
mem_funcA member function of the object_type.
mem_func_1A member function of the nested object_type.
Returns
A variable with return type R.

◆ make_var() [4/4]

template<class R , class O >
variable< R > matador::make_var ( R(O::*)() const  mem_func)

Create a variable with depth zero.

Template Parameters
RThe return value type
OThe serializable type

Creates a variable with depth zero. That means that the value is inside the serializable itself.

Parameters
mem_funcA member function of the object_type.
Returns
A variable with return type R.

◆ nullopt()

const detail::nullopt_t matador::nullopt ( (detail::nullopt_t::init())  )

Null value for optionals

◆ operator!()

template<class L , class R >
condition< condition< L, R >, void > matador::operator! ( const condition< L, R > &  c)

Negates a given condition.

Template Parameters
LThe left hand type of the condition
RThe right hand type of the condition
Parameters
cThe condition to negated
Returns
An condition object representing the NOT operation

◆ operator!=() [1/4]

template<class T >
condition< column, T > matador::operator!= ( const column col,
val 
)

Condition unequality operator for a column and a value.

Creates a condition condition object of a column and a value checked on unequality.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the unequality operation

◆ operator!=() [2/4]

template<typename T >
bool matador::operator!= ( detail::nullopt_t  ,
optional< T > const &  x 
)
inline

Not equal to null value for optionals

Template Parameters
TType of right optional
Parameters
xRight optional to compare
Returns
True if optional is not null

◆ operator!=() [3/4]

template<typename T >
bool matador::operator!= ( optional< T > const &  x,
detail::nullopt_t   
)
inline

Not equal to null value for optionals

Template Parameters
TType of left optional
Parameters
xLeft optional to compare
Returns
True if optional is not null

◆ operator!=() [4/4]

template<typename T , typename U >
bool matador::operator!= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Not equal compare operator for optionals.

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if optional are not equal

◆ operator""_col()

column matador::operator""_col ( const char *  name,
size_t  len 
)

User defined literal to have a shortcut creating a column object

Parameters
nameName of the column
lenLength of the column name
Returns
A column object with given name

◆ operator&()

event_type matador::operator& ( event_type  a,
event_type  b 
)
inline

event_type operator to concat to event types with and operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator&&()

template<class L1 , class R1 , class L2 , class R2 >
condition< condition< L1, R1 >, condition< L2, R2 > > matador::operator&& ( const condition< L1, R1 > &  l,
const condition< L2, R2 > &  r 
)

AND operation condition consisting of a left and right hand condition.

Template Parameters
L1Left hand type of left hand condition
R1Right hand type of left hand condition
L2Left hand type of right hand condition
R2Right hand type of right hand condition
Parameters
lLeft hand condition
rRight hand condition
Returns
An condition object representing the AND operation

◆ operator&=()

event_type & matador::operator&= ( event_type a,
event_type  b 
)
inline

event_type operator to assign event type with and operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator<() [1/4]

template<class T >
condition< column, T > matador::operator< ( const column col,
val 
)

Condition less operator for a column and a value.

Creates a condition object checking if the value of the given column is less than the given value.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the less operation

◆ operator<() [2/4]

template<class T >
bool matador::operator< ( const json a,
const T &  b 
)

Less operator with a json value with a scalar value

Template Parameters
TType of the scalar value
Parameters
aThe json value to compare
bThe scalar value to compare
Returns
True if the json value is less than the scalar value

◆ operator<() [3/4]

template<class T >
bool matador::operator< ( const T &  a,
const json b 
)

Less operator with a scalar value with a json value

Template Parameters
TType of the scalar value
Parameters
aThe scalar value to compare
bThe json value to compare
Returns
True if the scalar value is less than the json value

◆ operator<() [4/4]

template<typename T , typename U >
bool matador::operator< ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Less operator for optionals

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if left optional is less than right optional

◆ operator<<()

OOS_LOGGER_API std::ostream & matador::operator<< ( std::ostream &  os,
log_level  lvl 
)

Write log level in human readable string to a given std::ostream.

Parameters
osstd::stream to write to
lvlLog level to write
Returns
The std::ostream

◆ operator<=() [1/4]

template<class T >
condition< column, T > matador::operator<= ( const column col,
val 
)

Condition less or equal operator for a column and a value.

Creates a condition object checking if the value of the given column is less or equal than the given value.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the less or equal operation

◆ operator<=() [2/4]

template<class T >
bool matador::operator<= ( const json a,
const T &  b 
)

Less or equal to operator with a json value with a scalar value

Template Parameters
TType of the scalar value
Parameters
aThe json value to compare
bThe scalar value to compare
Returns
True if the json value is less or equal to than the scalar value

◆ operator<=() [3/4]

template<class T >
bool matador::operator<= ( const T &  a,
const json b 
)

Less or equal to operator with a scalar value with a json value

Template Parameters
TType of the scalar value
Parameters
aThe scalar value to compare
bThe json value to compare
Returns
True if the scalar value is less or equal to than the json value

◆ operator<=() [4/4]

template<typename T , typename U >
bool matador::operator<= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Less equal operator for optionals

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if left optional is less equal than right optional

◆ operator==() [1/4]

template<class T >
condition< column, T > matador::operator== ( const column col,
val 
)

Condition equality operator for a column and a value.

Creates a condition object of a column and a value checked on equality.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the equality operation

◆ operator==() [2/4]

template<typename T >
bool matador::operator== ( detail::nullopt_t  ,
optional< T > const &  x 
)
inline

Equal to null value for optionals

Template Parameters
TType of right optional
Parameters
xRight optional to compare
Returns
True if optional is null

◆ operator==() [3/4]

template<typename T >
bool matador::operator== ( optional< T > const &  x,
detail::nullopt_t   
)
inline

Equal to null value for optionals

Template Parameters
TType of left optional
Parameters
xLeft optional to compare
Returns
True if optional is null

◆ operator==() [4/4]

template<typename T , typename U >
bool matador::operator== ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Equal compare operator for optionals.

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if optional are equal

◆ operator>() [1/4]

template<class T >
condition< column, T > matador::operator> ( const column col,
val 
)

Condition greater operator for a column and a value.

Creates a condition object checking if the value of the given column is greater than the given value.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the greater operation

◆ operator>() [2/4]

template<class T >
bool matador::operator> ( const json a,
const T &  b 
)

Greater operator with a json value with a scalar value

Template Parameters
TType of the scalar value
Parameters
aThe json value to compare
bThe scalar value to compare
Returns
True if the json value is greater than the scalar value

◆ operator>() [3/4]

template<class T >
bool matador::operator> ( const T &  a,
const json b 
)

Greater operator with a scalar value with a json value

Template Parameters
TType of the scalar value
Parameters
aThe scalar value to compare
bThe json value to compare
Returns
True if the scalar value is greater than the json value

◆ operator>() [4/4]

template<typename T , typename U >
bool matador::operator> ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Greater operator for optionals

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if left optional is greater than right optional

◆ operator>=() [1/4]

template<class T >
condition< column, T > matador::operator>= ( const column col,
val 
)

Condition greater or equal operator for a column and a value.

Creates a condition object checking if the value of the given column is greater or equal than the given value.

Template Parameters
TThe type of the value
Parameters
colThe column object
valThe value to compare with
Returns
The condition object representing the greater or equal operation

◆ operator>=() [2/4]

template<class T >
bool matador::operator>= ( const json a,
const T &  b 
)

Greater or equal to operator with a json value with a scalar value

Template Parameters
TType of the scalar value
Parameters
aThe json value to compare
bThe scalar value to compare
Returns
True if the json value is greater or equal to than the scalar value

◆ operator>=() [3/4]

template<class T >
bool matador::operator>= ( const T &  a,
const json b 
)

Greater or equal to operator with a scalar value with a json value

Template Parameters
TType of the scalar value
Parameters
aThe scalar value to compare
bThe json value to compare
Returns
True if the scalar value is greater or equal to than the json value

◆ operator>=() [4/4]

template<typename T , typename U >
bool matador::operator>= ( optional< T > const &  x,
optional< U > const &  y 
)
inline

Greater equal operator for optionals

Template Parameters
TType of left optional
UType of right optional
Parameters
xLeft optional to compare
yRight optional to compare
Returns
True if left optional is greater equal than right optional

◆ operator^()

event_type matador::operator^ ( event_type  a,
event_type  b 
)
inline

event_type operator to concat to event types with xor operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator^=()

event_type & matador::operator^= ( event_type a,
event_type  b 
)
inline

event_type operator to assign event type with xor operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator|()

event_type matador::operator| ( event_type  a,
event_type  b 
)
inline

event_type operator to concat to event types with or operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator|=()

event_type & matador::operator|= ( event_type a,
event_type  b 
)
inline

event_type operator to assign event type with or operator

Parameters
aLeft event_type
bRight event_type
Returns
The combined result

◆ operator||()

template<class L1 , class R1 , class L2 , class R2 >
condition< condition< L1, R1 >, condition< L2, R2 > > matador::operator|| ( const condition< L1, R1 > &  l,
const condition< L2, R2 > &  r 
)

OR operation condition consisting of a left and right hand condition.

Template Parameters
L1Left hand type of left hand condition
R1Right hand type of left hand condition
L2Left hand type of right hand condition
R2Right hand type of right hand condition
Parameters
lLeft hand condition
rRight hand condition
Returns
An condition object representing the OR operation

◆ operator~()

event_type matador::operator~ ( event_type  a)
inline

event_type not operator

Parameters
aLeft event_type
Returns
The combined result

◆ read_as_text()

OOS_UTILS_API std::string matador::read_as_text ( const file f)

Reads a given file as text and returns its content as string

Parameters
fFile to read in
Returns
The content of the file as string

◆ remove() [1/2]

template<typename O , class T >
bool matador::remove ( O &  obj,
const std::string &  name,
const T &  val 
)

Removes a value from an object member container identified by the given name. The object is passed by reference. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be removed.
TThe type of the value to be removed.
Parameters
objThe object reference to remove the value from.
nameThe name of the member variable.
valThe value to remove.
Returns
True if the operation succeeds.

◆ remove() [2/2]

template<typename O , class T >
bool matador::remove ( O *  obj,
const std::string &  name,
const T &  val 
)

Removes a value from an object member container identified by the given name. The object is passed as pointer. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be removed.
TThe type of the value to be removed.
Parameters
objThe object pointer to remove the value from.
nameThe name of the member variable.
valThe value to remove.
Returns
True if the operation succeeds.

◆ replace_all()

OOS_UTILS_API void matador::replace_all ( std::string &  in,
const std::string &  from,
const std::string &  to 
)

Replaces all occurrences of string from in given string with string to.

Parameters
inSource string where the replacement takes place
fromThe string to be replaced
toThe new string

◆ select() [1/2]

query< row > matador::select ( columns  cols)

Creates a query for given columns.

Parameters
colsThe rows to select
Returns
A select query for anonymous rows.

◆ select() [2/2]

template<class T >
query< T > matador::select ( const std::string &  table)

Creates a select query for type T.

Template Parameters
TThe type of the query.
Parameters
tableThe table name
Returns
A select query for type T.

◆ set() [1/3]

template<typename O >
bool matador::set ( O &  obj,
const std::string &  name,
const char *  val 
)

Sets string value of a member identified by the given name. The value is passed as a character array. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be set.
Parameters
objThe object to set the value into.
nameThe name of the member variable.
valPointer to the character array containing the new string value
Returns
True if the operation succeeds.

◆ set() [2/3]

template<typename O , class T >
bool matador::set ( O &  obj,
const std::string &  name,
const T &  val 
)

Sets a value of an object member identified by the given name. The object is passed by reference. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be set.
TThe type of the value to set.
Parameters
objThe object reference to set the value into.
nameThe name of the member variable.
valThe new value for the member.
Returns
True if the operation succeeds.

◆ set() [3/3]

template<typename O , class T >
bool matador::set ( O *  obj,
const std::string &  name,
const T &  val 
)

Sets a value of an object member identified by the given name. The object is passed as a pointer. If the operation succeeds true is returned.

Template Parameters
OThe object for which the value should be set.
TThe type of the value to set.
Parameters
objThe pointer object to set the value into.
nameThe name of the member variable.
valThe new value for the member.
Returns
True if the operation succeeds.

◆ skip_ws()

OOS_UTILS_API const char * matador::skip_ws ( const char *  str)

Skip all whitespace characters (tab, spaces, etc.) for the given string and return the new position

Parameters
strString to skip whitespace characters in
Returns
First non whitespace positon of string

◆ split() [1/2]

OOS_UTILS_API size_t matador::split ( const std::string &  str,
char  delim,
std::list< std::string > &  values 
)

Splits a string by a delimiter and add the string tokens to a list. The size of the list is returned.

Parameters
strThe string to split.
delimThe delimiter character.
valuesThe result list.
Returns
The size of the list.

◆ split() [2/2]

OOS_UTILS_API size_t matador::split ( const std::string &  str,
char  delim,
std::vector< std::string > &  values 
)

Splits a string by a delimiter and add the string tokens to a vector. The size of the vector is returned.

Parameters
strThe string to split.
delimThe delimiter character.
valuesThe result vector.
Returns
The size of the vector.

◆ strftime()

OOS_UTILS_API size_t matador::strftime ( char *  buffer,
size_t  size,
const char *  format,
const time_info &  ti 
)

Formats a given timeval struct as a string within the given buffer. It is possible to format the string with fractional seconds using the format token 'f'.

Parameters
bufferBuffer to write the time string to
sizeSize of the buffer
formatFormat of the time string
tvtimeval struct containing the time to format
Returns
The length of the buffer string

◆ to_string() [1/4]

OOS_JSON_API std::string matador::to_string ( const json j)

Converts a json object into a string.

Parameters
jJson object to convert
Returns
The string representation of the json object

◆ to_string() [2/4]

OOS_UTILS_API std::string matador::to_string ( const matador::date x,
const char *  format = date_format::ISO8601 
)

Converts a date object with a given format to a string

Parameters
xDate object to convert.
formatThe format string

◆ to_string() [3/4]

OOS_UTILS_API std::string matador::to_string ( const matador::time x,
const char *  format = time_format::ISO8601 
)

Converts a time object with a given format to a string

Parameters
xTime object to convert.
formatThe format string

◆ to_string() [4/4]

template<class T >
std::string matador::to_string ( x,
size_t  precision = 0,
typename std::enable_if< std::is_floating_point< T >::value >::type *  = 0 
)

Convert any floating point values into a string with a given precision.

Template Parameters
TThe floating point type
Parameters
xThe value to be converted.
precisionThe precision to use for converting
Returns
The floating point value as string

◆ trim()

std::string matador::trim ( const std::string &  str,
const std::string &  whitespace = " \t" 
)

Trims a string by removing leading and trailing characters The default characters are spaces and tabs

Parameters
strThe string to be trimmed
whitespaceThe trimming characters
Returns
the trimmed string