oos Namespace Reference

The Open Object Store namespace. More...

Classes

class  condition
 Represents a sql query condition. More...
 
class  database_exception
 An object exception class. More...
 
class  query
 Creates a SQL query. More...
 
class  session
 Frontend class to make the objects persistent. More...
 
class  transaction
 The transaction class. More...
 
struct  type_traits
 Type traits for database types. More...
 
class  generic_json_parser
 An generic json parser base class. More...
 
class  json_array
 Class representing the json array type. More...
 
class  json_bool
 Class representing the json bool type. More...
 
class  json_null
 Class representing the json null type. More...
 
class  json_number
 Representing json number type. More...
 
class  json_object
 Class representing the json object type. More...
 
class  json_parser
 Parse a json formatted stream or string. More...
 
class  json_string
 Class representing the json string type. More...
 
class  json_type
 Base class for all json types. More...
 
class  json_value
 Wrapper class for a concrete value. More...
 
class  attribute_counter
 Counts the number of attributes within an object. More...
 
class  attribute_reader
 Set an attribute value of an object. More...
 
class  attribute_writer
 Retrieve an attribute value from an object. More...
 
class  linked_object_list
 An linked object list class. More...
 
class  object
 The base class for all objects. More...
 
class  object_atomizable
 Base class for all serializable objects. More...
 
class  object_writer
 Base class for all object writer. More...
 
class  generic_object_writer
 Generic base class for all object writer. More...
 
class  object_reader
 Base class for all object reader. More...
 
class  generic_object_reader
 Generic base class for all object readre. More...
 
class  value_item
 Holder class for the value type. More...
 
class  container_item
 Base class for all container items. More...
 
class  object_exception
 An object exception class. More...
 
class  variable
 Holds the functor to a method. More...
 
class  object_list_base
 Base class for all object list classes. More...
 
class  object_list
 List class mapping items via relation table. More...
 
class  object_observer
 Base class for object observer classes. More...
 
class  object_base_ptr
 Base class for the object pointer and reference class. More...
 
class  object_ptr
 The object_ptr holds a pointer to an object. More...
 
class  object_ref
 The object_ref holds a pointer to an object. More...
 
class  object_base_producer
 Base class for object producer classes. More...
 
class  object_producer
 Produces a new object of type T. More...
 
class  object_store
 A class that stores all kind of objects. More...
 
class  object_vector_base
 Base class for all object vector classes. More...
 
class  object_vector
 Object vector class without relation table. More...
 
class  generic_view
 Creates a generic view of a concrete object type. More...
 
class  object_view
 Create a view for a concrete object type. More...
 
struct  prototype_node
 Holds the prototype of a concrete object. More...
 
class  factory
 A generic factory class. More...
 
class  library
 Helps to load and unload external libraries. More...
 
class  sequencer
 Interface to create and get unique sequence numbers. More...
 
class  singleton
 Provides only one instance of a type. More...
 
class  varchar
 A simple varchar class. More...
 
class  test_suite
 The container for all unit tests. More...
 
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...
 

Typedefs

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

Enumerations

enum  data_type_t {
  type_char = 0, type_short, type_int, type_long,
  type_unsigned_char, type_unsigned_short, type_unsigned_int, type_unsigned_long,
  type_float, type_double, type_bool, type_char_pointer,
  type_varchar, type_text, type_blob
}
 

Functions

OOS_API condition cond (const std::string &column)
 
template<class R , class O >
variable< R > make_var (R(O::*mem_func)() const)
 Create a variable with depth zero. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<class T , class U >
void convert (const T &from, U &to)
 
template<class T , class U , class S >
void convert (const T &from, U &to, S size)
 
template<class T , class U , class S , class P >
void convert (const T &from, U &to, S size, P precision)
 
size_t split (const std::string &str, char delim, std::vector< std::string > &values)
 
std::string trim (const std::string &str, const std::string &whitespace=" \t")
 
template<unsigned int C1, unsigned int C2>
bool operator== (const varchar< C1 > &l, const varchar< C2 > &r)
 
template<unsigned int C>
bool operator== (const varchar< C > &l, const char *r)
 
template<unsigned int C1, unsigned int C2>
bool operator!= (const varchar< C1 > &l, const varchar< C2 > &r)
 
template<unsigned int C>
bool operator!= (const varchar< C > &l, const char *r)
 

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

typedef std::tr1::shared_ptr<sequencer_impl> oos::sequencer_impl_ptr

Shortcut for sequencer implementation pointer

Enumeration Type Documentation

Enumeration of database data types

Enumerator
type_char 

Data type char

type_short 

Data type short

type_int 

Data type int

type_long 

Data type 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_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_blob 

Data type blob

Function Documentation

OOS_API condition oos::cond ( const std::string &  column)

Creates a condition for the given column name.

Parameters
columnThe name of the column.
Returns
A new condition.
template<class T , class U >
void oos::convert ( const T &  from,
U &  to 
)

Convert a paramater of one type into another. If the conversion is not allowed an exception is thrown.

Template Parameters
TType of from parameter.
UType of to parameter.
Parameters
fromFrom value to convert.
toResult parameter.
Exceptions
std::bad_cast()exception.
template<class T , class U , class S >
void oos::convert ( const T &  from,
U &  to,
size 
)

Convert a paramater of one type into another. If the conversion is not allowed an exception is thrown.

Template Parameters
TType of from parameter.
UType of to parameter.
SSize of to parameter.
Parameters
fromFrom value to convert.
toResult parameter.
sizeSize of the result parameter
Exceptions
std::bad_cast()exception.
template<class T , class U , class S , class P >
void oos::convert ( const T &  from,
U &  to,
size,
precision 
)

Convert a paramater of one type into another. If the conversion is not allowed an exception is thrown.

Template Parameters
TType of from parameter.
UType of to parameter.
SSize of to parameter.
PPrecision of to parameter.
Parameters
fromFrom value to convert.
toResult parameter.
sizeSize of the result parameter
precisionPrecision of the result parameter
Exceptions
std::bad_cast()exception.
template<class InputIterator , class Function , class T >
Function oos::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.
template<class InputIterator , class Function , class Predicate >
Function oos::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.
template<class R , class O >
variable<R> oos::make_var ( R(O::*)() const  mem_func)

Create a variable with depth zero.

Template Parameters
RThe return value type
OThe object type Creates a variable with depth zero. That means that the value is inside the object itself.
Parameters
mem_funcA member function of the object_type.
Returns
A variable with return type R.
template<class R , class O , class O1 >
variable<R> oos::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 object type
O1The object type Creates a variable with depth one. That means that a value of a nested object 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.
template<class R , class O , class O1 , class O2 >
variable<R> oos::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 object type
O1The nested object type
O2The nested object type Creates a variable with depth one. That means that a value of a nested object 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.
template<class R , class O , class O1 , class O2 , class O3 >
variable<R> oos::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 object type
O1The nested object type
O2The nested object type
O3The nested object type Creates a variable with depth one. That means that a value of a nested object 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.
template<unsigned int C1, unsigned int C2>
bool oos::operator!= ( const varchar< C1 > &  l,
const varchar< C2 > &  r 
)

Compares if two varchars are not equal.

Template Parameters
C1Size of left hand varchar
C2Size of right hand varchar
Parameters
lLeft hand varchar to compare.
rRight hand varchar to compare.
template<unsigned int C>
bool oos::operator!= ( const varchar< C > &  l,
const char *  r 
)

Compares if a varchar and a character array are not equal.

Template Parameters
CSize of right hand varchar
Parameters
lLeft hand character array to compare.
rRight hand varchar to compare.
template<unsigned int C1, unsigned int C2>
bool oos::operator== ( const varchar< C1 > &  l,
const varchar< C2 > &  r 
)

Compares if two varchars are equal.

Template Parameters
C1Size of left hand varchar
C2Size of right hand varchar
Parameters
lLeft hand varchar to compare.
rRight hand varchar to compare.
template<unsigned int C>
bool oos::operator== ( const varchar< C > &  l,
const char *  r 
)

Compares if a varchar and a character array are equal.

Template Parameters
CSize of left hand varchar
Parameters
lLeft hand varchar to compare.
rRight hand character array to compare.
size_t oos::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.