Simple Application Framework  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Namespaces | Classes | Functions
Saf::Algo Namespace Reference

Generic data handling algorithms and structures. More...

Namespaces

namespace  Predicate
 Basic predicate functors.
namespace  Range
 Algorithms and functions that execute on a range of elements.
namespace  Selection
 Selection algorithms.
namespace  Selector
 Functors for selecting individual members of from pair or triplet collections.
namespace  Sort
 Sorting algorithms.
namespace  Struct
 Generic data structures.

Classes

struct  BinaryFunction
 Generic binary function. More...
class  Binder1st
 Create a unary function from a binary one by fixing its first parameter. More...
class  Binder2nd
 Create a unary function from a binary one by fixing its second parameter. More...
struct  Hash
 Generic hash functor for basic data types. More...
struct  Identity
 Identity functor. More...
struct  SwapFunc
 Swap functor. More...
struct  UnaryFunction
 Generic unary function. More...

Functions

template<class Func , class Arg1Type >
Binder1st< Func, Arg1Type > Bind1st (const Func &func, const Arg1Type &arg1)
 Create a unary function from a binary one by fixing its first parameter.
template<class Func , class Arg2Type >
Binder2nd< Func, Arg2Type > Bind2nd (const Func &func, const Arg2Type &arg2)
 Create a unary function from a binary one by fixing its second parameter.
SAF_DLL_EXPORT Size HashBytes (const Uint8 *data, Size sz)
 Hash a byte sequence.
template<class T >
void Swap (T &x, T &y)
 Swap the content of two variables.

Detailed Description

Generic data handling algorithms and structures.


Function Documentation

template<class Func , class Arg1Type >
Binder1st<Func,Arg1Type> Saf::Algo::Bind1st ( const Func &  func,
const Arg1Type &  arg1 
) [inline]

Create a unary function from a binary one by fixing its first parameter.

This function simplifies the use of Binder1st.

template<class Func , class Arg2Type >
Binder2nd<Func,Arg2Type> Saf::Algo::Bind2nd ( const Func &  func,
const Arg2Type &  arg2 
) [inline]

Create a unary function from a binary one by fixing its second parameter.

This function simplifies the use of Binder2n.

SAF_DLL_EXPORT Size Saf::Algo::HashBytes ( const Uint8 *  data,
Size  sz 
)

Hash a byte sequence.

Implemented using a Shift-Add-Xor hash method.

template<class T >
void Saf::Algo::Swap ( T &  x,
T &  y 
) [inline]

Swap the content of two variables.

To implement a custom swap functionality for your class specialize the Saf::Algo::SwapFunc functor.

See also:
SwapFunc.