libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Modules | Namespaces | Classes | Macros | Typedefs | Functions
Base classes
+ Collaboration diagram for Base classes:

Modules

 Exceptions
 
 Strings
 

Namespaces

 crn
 
 crn::traits
 

Classes

class  crn::Savable
 complex base abstract class More...
 
struct  crn::TypeInfo< T >
 A class containing informations on a type. More...
 
class  crn::ScalarRange< S >
 A class that represents scalar values in [[b, e[[. More...
 

Macros

#define CRN_SERIALIZATION_CONSTRUCTOR(classname)   public: classname(crn::xml::Element &el) { Deserialize(el); }
 Defines a default constructor from xml element. More...
 
#define CRN_DECLARE_CLASS_CONSTRUCTOR(classname)
 Declares a class constructor. More...
 
#define CRN_BEGIN_CLASS_CONSTRUCTOR(classname)
 Defines a class constructor. More...
 
#define CRN_END_CLASS_CONSTRUCTOR(classname)
 Defines a class constructor. More...
 

Typedefs

template<typename T >
using crn::SumType = typename TypeInfo< T >::SumType
 
template<typename T >
using crn::DiffType = typename TypeInfo< T >::DiffType
 
template<typename T >
using crn::DecimalType = typename TypeInfo< T >::DecimalType
 

Functions

template<typename P , typename std::enable_if< traits::IsDereferenceable< P >::value, int >::type = 0>
std::pointer_traits< P >
::element_type & 
crn::Dereference (const P &p)
 
template<typename P , typename std::enable_if<!traits::IsDereferenceable< P >::value, int >::type = 0>
P & crn::Dereference (P &p)
 
template<typename T , typename std::enable_if< std::is_constructible< T, int >::value, int >::type = 0>
crn::Zero (const T &)
 Returns an object of the same type that represents 0. More...
 
template<class T >
auto crn::Size (const T &cont) noexcept(noexcept(cont.size())) -> decltype(cont.size())
 Returns the size of a container. More...
 
template<typename T >
ScalarRange< T > crn::Range (T b, T e)
 Creates a range [[b, e[[. More...
 
template<typename T >
auto crn::Range (const T &cont) -> ScalarRange< decltype(Size(cont))>
 Creates a range [[0, cont.size()[[. More...
 
template<typename T >
ScalarRange< int64_t > crn::ReverseRange (const T &cont)
 Creates a range ]]cont.size(), 0]]. More...
 

Detailed Description

Macro Definition Documentation

#define CRN_BEGIN_CLASS_CONSTRUCTOR (   classname)
Value:
void classname::Initialize()\
{\
static bool init_done = false;\
if (!init_done)\
{\
init_done = true;

Defines a class constructor.

Defines a class constructor. Add this to a class definition file.

Parameters
[in]classnamethe name of the current class

Definition at line 185 of file CRNObject.h.

#define CRN_DECLARE_CLASS_CONSTRUCTOR (   classname)
Value:
public:\
static void Initialize();\
private:\
struct Init { Init() { classname::Initialize(); } };\
static Init init;

Declares a class constructor.

Declares a class constructor. Add this to a class declaration.

Parameters
[in]classnamethe name of the current class

Definition at line 173 of file CRNObject.h.

#define CRN_END_CLASS_CONSTRUCTOR (   classname)
Value:
}\
}\
classname::Init classname::init;

Defines a class constructor.

Defines a class constructor. Add this to a class definition file.

Parameters
[in]classnamethe name of the current class

Definition at line 198 of file CRNObject.h.

#define CRN_SERIALIZATION_CONSTRUCTOR (   classname)    public: classname(crn::xml::Element &el) { Deserialize(el); }

Defines a default constructor from xml element.

Parameters
[in]classnamethe class in which the constructor is added

Definition at line 165 of file CRNObject.h.

Typedef Documentation

template<typename T >
using crn::DecimalType = typedef typename TypeInfo<T>::DecimalType

Definition at line 187 of file CRNType.h.

template<typename T >
using crn::DiffType = typedef typename TypeInfo<T>::DiffType

Definition at line 186 of file CRNType.h.

template<typename T >
using crn::SumType = typedef typename TypeInfo<T>::SumType

Definition at line 185 of file CRNType.h.

Function Documentation

template<typename P , typename std::enable_if< traits::IsDereferenceable< P >::value, int >::type = 0>
std::pointer_traits<P>::element_type& crn::Dereference ( const P &  p)

Definition at line 193 of file CRNType.h.

template<typename P , typename std::enable_if<!traits::IsDereferenceable< P >::value, int >::type = 0>
P& crn::Dereference ( P &  p)

Definition at line 205 of file CRNType.h.

template<typename T >
ScalarRange<T> crn::Range ( b,
e 
)
inline

Creates a range [[b, e[[.

Parameters
[in]bthe first value
[in]ethe value after the last value

Definition at line 257 of file CRNType.h.

template<typename T >
auto crn::Range ( const T &  cont) -> ScalarRange<decltype(Size(cont))>
inline

Creates a range [[0, cont.size()[[.

Parameters
[in]conta container that define a method size()

Definition at line 261 of file CRNType.h.

template<typename T >
ScalarRange<int64_t> crn::ReverseRange ( const T &  cont)
inline

Creates a range ]]cont.size(), 0]].

Parameters
[in]conta container that define a method size()

Definition at line 269 of file CRNType.h.

template<class T >
auto crn::Size ( const T &  cont) -> decltype(cont.size())
inlinenoexcept

Returns the size of a container.

Parameters
[in]conta container
Returns
the number of elements in the container

Definition at line 251 of file CRNType.h.

template<typename T , typename std::enable_if< std::is_constructible< T, int >::value, int >::type = 0>
T crn::Zero ( const T &  val)

Returns an object of the same type that represents 0.

Definition at line 212 of file CRNType.h.