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_ptr > | t_action_vector |
typedef std::shared_ptr< detail::token > | token_ptr |
typedef std::list< token_ptr > | token_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_sink > | create_file_sink (const std::string &logfile) |
OOS_LOGGER_API std::shared_ptr< stderr_sink > | create_stderr_sink () |
OOS_LOGGER_API std::shared_ptr< stdout_sink > | create_stdout_sink () |
OOS_LOGGER_API std::shared_ptr< rotating_file_sink > | create_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_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 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< column > | make_column (const std::string &name, const field_attributes &attr=null_attributes, const matador::any &val={}) |
std::shared_ptr< column > | make_column (const std::string &name, data_type type, size_t index, const field_attributes &attr=null_attributes) |
template<typename Type > | |
std::shared_ptr< column > | make_column (const std::string &name, const field_attributes &attr=null_attributes) |
template<typename Type > | |
std::shared_ptr< column > | make_column (const std::string &name, const Type &val, const field_attributes &attr=null_attributes) |
std::shared_ptr< column > | make_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< column > | make_pk_column (const std::string &name, size_t max_size=0) |
template<> | |
std::shared_ptr< column > | make_pk_column< std::string > (const std::string &name, size_t max_size) |
std::shared_ptr< column > | make_pk_column (const std::string &name, data_type type, size_t index, size_t max_size=0) |
std::shared_ptr< column > | make_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_query > | in (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_query > | equals (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< row > | select (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_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) |
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 {} |
The Open Object Store namespace.
This is the namespace where all OOS related classes, function and code should be put into.
typedef std::shared_ptr<action> matador::action_ptr |
Shortcut to an action shared pointer
typedef std::shared_ptr<sequencer_impl> matador::sequencer_impl_ptr |
Shortcut for sequencer implementation pointer
using matador::sink_ptr = typedef std::shared_ptr<log_sink> |
Shortcut to log sink shared pointer
typedef std::vector<action_ptr> matador::t_action_vector |
Shortcut to a vector of action shared pointer
typedef std::list<token_ptr> matador::token_list_t |
Shortcut to a list of token shared pointer
typedef std::shared_ptr<detail::token> matador::token_ptr |
Shortcut to a token shared pointer
|
strong |
|
strong |
Enumeration type of all supported builtin data types.
|
strong |
Enumeration of database data types.
|
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 (
|
strong |
Represents all available log levels
|
strong |
OOS_UTILS_API std::size_t matador::acquire_thread_index | ( | std::thread::id | id | ) |
Returns the current unique number for the given thread id.
id | Thread id for which a unique is acquired. |
OOS_LOGGER_API void matador::add_log_sink | ( | sink_ptr | sink | ) |
Adds a log sink to the default log domain
sink | The log sink to add |
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.
sink | The log sink to add |
domain | The log domain name to add |
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.
O | The object for which the value should be appended. |
T | The type of the value to be appended. |
obj | The object reference to append the value to. |
name | The name of the member variable. |
val | The value to append. |
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.
O | The object for which the value should be appended. |
T | The type of the value to be appended. |
obj | The object pointer to append the value to. |
name | The name of the member variable. |
val | The value to append. |
const B * matador::base_class | ( | const D * | derived | ) |
Safely casts a given derived class to its base class.
B | The base class type |
D | The class type of the derived class |
derived | The derived object |
B * matador::base_class | ( | D * | derived | ) |
Safely casts a given derived class to its base class.
B | The base class type |
D | The class type of the derived class |
derived | The derived object |
condition< column, std::pair< T, T > > matador::between | ( | const matador::column & | col, |
T | low, | ||
T | high | ||
) |
Creates a between condition.
Creates a between condition for the given column with the given range consisting of a low and high value
T | The type of the column and range |
col | The column for the between condition |
low | The low value of the range |
high | The high value of the range |
OOS_LOGGER_API void matador::clear_all_log_sinks | ( | ) |
Removes all sinks from the default domain
OOS_LOGGER_API void matador::clear_all_log_sinks | ( | const std::string & | domain | ) |
Removes all sinks from the log domain with given domain name
domain | Domain name to clear all sinks |
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.
logfile | Path to the logfile |
OOS_LOGGER_API logger matador::create_logger | ( | std::string | source | ) |
Creates a logger with the given source name connected to the default log domain.
source | The name of the source |
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
source | The name of the source |
domain | The name of the log domain |
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.
logfile | Path to the log file |
max_size | Max log file size |
file_count | Max number of log files |
OOS_LOGGER_API std::shared_ptr< stderr_sink > matador::create_stderr_sink | ( | ) |
Shortcut to create a stderr log sink.
OOS_LOGGER_API std::shared_ptr< stdout_sink > matador::create_stdout_sink | ( | ) |
Shortcut to create a stdout log sink.
OOS_LOGGER_API void matador::default_max_log_level | ( | log_level | max_lvl | ) |
Sets the default max log level.
max_lvl | Default max log level |
OOS_LOGGER_API void matador::default_min_log_level | ( | log_level | min_lvl | ) |
Sets the default min log level.
min_lvl | Default min 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.
name | Log domain name |
max_lvl | Default max 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.
name | Log domain name |
min_lvl | Default min log level |
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.
col | The column object |
q | The query to compare with |
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,
InputIterator | Type of iterator to iterate with. |
Function | Type of the function to call. |
first | The initial iterator containing the starting position for the range. |
last | The final iterator containing the ending position for the range. |
value | The value to compare with. |
f | The function called with each element which is equal to the value. |
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,
InputIterator | Type of iterator to iterate with. |
Function | Type of the function to call. |
Predicate | Function or class which must be called with the element |
first | The initial iterator containing the starting position for the range. |
last | The final iterator containing the ending position for the range. |
pred | The predicate called with each element |
f | The function called with each element which returned true with the predicate. |
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.
O | The object for which the value should be get. |
obj | The object to get the value from. |
name | The name of the member variable. |
val | The pointer to a character array. |
size | The size of the character array. |
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.
O | The object for which the value should be get. |
T | The type of the value to retrieve. |
obj | The object to get the value from. |
name | The name of the member variable. |
val | The reference where the value is assigned to. |
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.
O | The object for which the value should be get. |
T | The type of the value to retrieve. |
obj | The object to get the value from. |
name | The name of the member variable. |
val | The reference where the value is assigned to. |
precision | The precision of the value to get. |
OOS_UTILS_API void matador::gettimeofday | ( | time_info & | ti | ) |
Multi platform version of gettimeofday
tp | Timeval struct where the result ist stored |
OOS_UTILS_API void matador::gmtime | ( | const time_t & | in, |
struct tm & | out | ||
) |
Multi platform version of gmtime
in | time_t value to be converted |
out | converted value |
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.
key | Key to be used for encoding. |
keylen | Length of the key. |
message | Message to be encoded. |
msglen | Length of the message. |
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.
key | Key to be used for encoding. |
message | Message to be encoded. |
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.
col | The column to compare |
q | The query to be executes as sub select |
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.
V | The type of the list arguments |
col | The column to compare |
args | The list of values |
OOS_UTILS_API bool matador::is_eos | ( | char | c | ) |
Checks if the given character is end of string.
c | Character to check |
|
inline |
Checks if a specific event_type is set in a given event type mask. If type is set true is returned.
source | Event type mask to check. |
needle | Requested event type |
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
R | Type og the range (e.g. map, list, vector, etc) |
range | The range with the elements to join |
delim | The delimiter for the elements |
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
R | Type of the range (e.g. map, list, vector, etc) |
range | The range with the elements to join |
out | The stream to write on |
delim | The delimiter for the elements |
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)
K | Type of key |
V | Type of value |
range | The range with the elemets to join |
delim | The delimiter for the elements |
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)
K | Type of key |
V | Type of value |
range | The range with the elemets to join |
out | The stream to write on |
delim | The delimiter for the elements |
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.
col | The column for the like condition |
val | The value to the like operator |
OOS_UTILS_API void matador::localtime | ( | const time_t & | in, |
struct tm & | out | ||
) |
Multi platform version of localtime
in | time_t value to be converted |
out | converted value |
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.
ARGS | Type of the arguments |
lvl | Log level |
source | Source of the log message |
what | The printf style message |
args | The arguments for the message |
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.
lvl | Log level |
source | Source of the log message |
message | Message to log |
std::shared_ptr< detail::basic_condition > matador::make_condition | ( | const condition< L, R > & | cond | ) |
Creates a shared condition from a given condition object.
L | The left hand type of the condition |
R | The right hand type of the condition |
cond | The condition to be copied |
identifier< T > matador::make_identifier | ( | T | val | ) |
Creates an identifier object from the given value
T | Type of the value |
val | The primary key value |
|
inline |
Creates an optional from the given value.
T | Type of optional value |
v | Value for optional |
stream< T > matador::make_stream | ( | C< T > && | container | ) |
Creates a stream from the given moved container.
T | Type of the elements in the container |
C | Type of the container |
container | The container |
stream< T > matador::make_stream | ( | C< T, Allocator > && | container | ) |
Creates a new stream of the given container.
T | Type of the stream elements |
C | Type of the container |
Allocator | Type of the allocator |
container | Container to create the stream from |
stream< T > matador::make_stream | ( | const C< T, Allocator > & | container | ) |
Creates a stream from the given container
T | Type of the elements in the container |
C | Type of the container |
Allocator | Type of the allocator class |
container | The container |
stream< T > matador::make_stream | ( | std::initializer_list< T > | elems | ) |
Creates a stream fro an initializer list of elements
T | Type of elements |
elems | Elements to create the stream from |
stream< T > matador::make_stream | ( | T && | from, |
T && | to | ||
) |
Creates a stream of given begin an end iterator.
T | Type of the iterator |
from | begin iterator |
to | end iterator |
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.
T | Type of elements |
U | Type of increment value |
from | Starting value of stream |
to | Closing value of stream |
increment | Incrementing value |
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.
T | Type of elements |
from | Starting value of elements |
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.
T | Type of elements |
U | Type of increment value |
from | Starting value of elements |
increment | Incrementing value |
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.
R | The return value type |
O | The proxy serializable type |
O1 | The nested serializable type |
O2 | The nested serializable type |
O3 | The nested serializable type |
Creates a variable with depth one. That means that a value of a nested serializable is requested.
mem_func | A member function of the object_type. |
mem_func_1 | A member function of the nested object_type. |
mem_func_2 | A member function of the nested object_type. |
mem_func_3 | A member function of the nested object_type. |
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.
R | The return value type |
O | The proxy serializable type |
O1 | The nested serializable type |
O2 | The nested serializable type |
Creates a variable with depth one. That means that a value of a nested serializable is requested.
mem_func | A member function of the object_type. |
mem_func_1 | A member function of the nested object_type. |
mem_func_2 | A member function of the nested object_type. |
variable< R > matador::make_var | ( | O1(O::*)() const | mem_func, |
R(O1::object_type::*)() const | mem_func_1 | ||
) |
Create a variable with depth one.
R | The return value type |
O | The proxy serializable type |
O1 | The serializable type |
Creates a variable with depth one. That means that a value of a nested serializable is requested.
mem_func | A member function of the object_type. |
mem_func_1 | A member function of the nested object_type. |
variable< R > matador::make_var | ( | R(O::*)() const | mem_func | ) |
Create a variable with depth zero.
R | The return value type |
O | The serializable type |
Creates a variable with depth zero. That means that the value is inside the serializable itself.
mem_func | A member function of the object_type. |
const detail::nullopt_t matador::nullopt | ( | (detail::nullopt_t::init()) | ) |
Null value for optionals
condition< condition< L, R >, void > matador::operator! | ( | const condition< L, R > & | c | ) |
Negates a given condition.
L | The left hand type of the condition |
R | The right hand type of the condition |
c | The condition to negated |
condition< column, T > matador::operator!= | ( | const column & | col, |
T | val | ||
) |
Condition unequality operator for a column and a value.
Creates a condition condition object of a column and a value checked on unequality.
T | The type of the value |
col | The column object |
val | The value to compare with |
|
inline |
Not equal to null value for optionals
T | Type of right optional |
x | Right optional to compare |
|
inline |
Not equal to null value for optionals
T | Type of left optional |
x | Left optional to compare |
|
inline |
Not equal compare operator for optionals.
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
column matador::operator""_col | ( | const char * | name, |
size_t | len | ||
) |
User defined literal to have a shortcut creating a column object
name | Name of the column |
len | Length of the column name |
|
inline |
event_type operator to concat to event types with and operator
a | Left event_type |
b | Right event_type |
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.
L1 | Left hand type of left hand condition |
R1 | Right hand type of left hand condition |
L2 | Left hand type of right hand condition |
R2 | Right hand type of right hand condition |
l | Left hand condition |
r | Right hand condition |
|
inline |
event_type operator to assign event type with and operator
a | Left event_type |
b | Right event_type |
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.
T | The type of the value |
col | The column object |
val | The value to compare with |
bool matador::operator< | ( | const json & | a, |
const T & | b | ||
) |
Less operator with a json value with a scalar value
T | Type of the scalar value |
a | The json value to compare |
b | The scalar value to compare |
bool matador::operator< | ( | const T & | a, |
const json & | b | ||
) |
Less operator with a scalar value with a json value
T | Type of the scalar value |
a | The scalar value to compare |
b | The json value to compare |
|
inline |
Less operator for optionals
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
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.
os | std::stream to write to |
lvl | Log level to write |
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.
T | The type of the value |
col | The column object |
val | The value to compare with |
bool matador::operator<= | ( | const json & | a, |
const T & | b | ||
) |
Less or equal to operator with a json value with a scalar value
T | Type of the scalar value |
a | The json value to compare |
b | The scalar value to compare |
bool matador::operator<= | ( | const T & | a, |
const json & | b | ||
) |
Less or equal to operator with a scalar value with a json value
T | Type of the scalar value |
a | The scalar value to compare |
b | The json value to compare |
|
inline |
Less equal operator for optionals
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
Condition equality operator for a column and a value.
Creates a condition object of a column and a value checked on equality.
T | The type of the value |
col | The column object |
val | The value to compare with |
|
inline |
Equal to null value for optionals
T | Type of right optional |
x | Right optional to compare |
|
inline |
Equal to null value for optionals
T | Type of left optional |
x | Left optional to compare |
|
inline |
Equal compare operator for optionals.
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
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.
T | The type of the value |
col | The column object |
val | The value to compare with |
bool matador::operator> | ( | const json & | a, |
const T & | b | ||
) |
Greater operator with a json value with a scalar value
T | Type of the scalar value |
a | The json value to compare |
b | The scalar value to compare |
bool matador::operator> | ( | const T & | a, |
const json & | b | ||
) |
Greater operator with a scalar value with a json value
T | Type of the scalar value |
a | The scalar value to compare |
b | The json value to compare |
|
inline |
Greater operator for optionals
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
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.
T | The type of the value |
col | The column object |
val | The value to compare with |
bool matador::operator>= | ( | const json & | a, |
const T & | b | ||
) |
Greater or equal to operator with a json value with a scalar value
T | Type of the scalar value |
a | The json value to compare |
b | The scalar value to compare |
bool matador::operator>= | ( | const T & | a, |
const json & | b | ||
) |
Greater or equal to operator with a scalar value with a json value
T | Type of the scalar value |
a | The scalar value to compare |
b | The json value to compare |
|
inline |
Greater equal operator for optionals
T | Type of left optional |
U | Type of right optional |
x | Left optional to compare |
y | Right optional to compare |
|
inline |
event_type operator to concat to event types with xor operator
a | Left event_type |
b | Right event_type |
|
inline |
event_type operator to assign event type with xor operator
a | Left event_type |
b | Right event_type |
|
inline |
event_type operator to concat to event types with or operator
a | Left event_type |
b | Right event_type |
|
inline |
event_type operator to assign event type with or operator
a | Left event_type |
b | Right event_type |
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.
L1 | Left hand type of left hand condition |
R1 | Right hand type of left hand condition |
L2 | Left hand type of right hand condition |
R2 | Right hand type of right hand condition |
l | Left hand condition |
r | Right hand condition |
|
inline |
event_type not operator
a | Left event_type |
OOS_UTILS_API std::string matador::read_as_text | ( | const file & | f | ) |
Reads a given file as text and returns its content as string
f | File to read in |
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.
O | The object for which the value should be removed. |
T | The type of the value to be removed. |
obj | The object reference to remove the value from. |
name | The name of the member variable. |
val | The value to remove. |
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.
O | The object for which the value should be removed. |
T | The type of the value to be removed. |
obj | The object pointer to remove the value from. |
name | The name of the member variable. |
val | The value to remove. |
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.
in | Source string where the replacement takes place |
from | The string to be replaced |
to | The new string |
Creates a query for given columns.
cols | The rows to select |
query< T > matador::select | ( | const std::string & | table | ) |
Creates a select query for type T.
T | The type of the query. |
table | The table name |
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.
O | The object for which the value should be set. |
obj | The object to set the value into. |
name | The name of the member variable. |
val | Pointer to the character array containing the new string value |
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.
O | The object for which the value should be set. |
T | The type of the value to set. |
obj | The object reference to set the value into. |
name | The name of the member variable. |
val | The new value for the member. |
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.
O | The object for which the value should be set. |
T | The type of the value to set. |
obj | The pointer object to set the value into. |
name | The name of the member variable. |
val | The new value for the member. |
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
str | String to skip whitespace characters in |
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.
str | The string to split. |
delim | The delimiter character. |
values | The result list. |
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.
str | The string to split. |
delim | The delimiter character. |
values | The result vector. |
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'.
buffer | Buffer to write the time string to |
size | Size of the buffer |
format | Format of the time string |
tv | timeval struct containing the time to format |
OOS_JSON_API std::string matador::to_string | ( | const json & | j | ) |
Converts a json object into a string.
j | Json object to convert |
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
x | Date object to convert. |
format | The format string |
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
x | Time object to convert. |
format | The format string |
std::string matador::to_string | ( | T | 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.
T | The floating point type |
x | The value to be converted. |
precision | The precision to use for converting |
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
str | The string to be trimmed |
whitespace | The trimming characters |