MDSTk Libraries  1.1.0
Medical Data Segmentation Toolkit
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
mds::base Namespace Reference

Namespaces

namespace  Factory
namespace  PartedData
 

Namespace containing constants used by the CPartedData<> allocator.


namespace  smallobj
 

Namespace containing constants used by the small objects allocator.


Classes

class  CAbs
 Functor makes an absolute value. More...
class  CAdd
 Functor adds a given value. More...
struct  CBadStaticAlloc
 Exception thrown when you are trying increase size of a static memory block. More...
struct  CConstructorFailed
 Exception thrown from a failed constructor. More...
class  CCumulativeMult
 The functional object can be used to estimate multiplication of a sequence of numbers. More...
class  CCut
 Functor remains unchanged a specified interval of values. More...
class  CData
 Class template providing data allocation functions. More...
struct  CDataAllocator
 Base class for all filter response normalization policies. More...
class  CDiv
 Functor divides by a given value. More...
class  CError
 Class encapsulating an error origin and description. More...
struct  CException
 Base class for all MDSTk exceptions. More...
class  CFactory
 Implements a generic object factory. More...
class  CFill
 Functor changes observed value. More...
class  CFullException
 More complex exception class encapsulating information about its origin and description. More...
class  CFuncHandler
 Wraps pointers to functions. More...
struct  CFunctionFailed
 Sample exception thrown from a failed function. More...
class  CFunctor
 Generalized functor implementation. More...
struct  CFunctorBase
 Base class for all functors. More...
struct  CFunctorBase< R, P1, P2, P3, tNull >
 Partial specialization for functor with three parameters. More...
struct  CFunctorBase< R, P1, P2, tNull, tNull >
 Partial specialization for functor with two parameters. More...
struct  CFunctorBase< R, P1, tNull, tNull, tNull >
 Partial specialization for functor with one parameter. More...
struct  CFunctorBase< R, tNull, tNull, tNull, tNull >
 Partial specialization for functor with no parameters. More...
class  CGlobalLog
 Global application log. More...
class  CHasOptions
 Base class that encapsulates object-specific options (binary flags). More...
class  CIteratorBase
 Base class for all iterators. More...
struct  CLibraryLockableClass
 Class that comes to be mds::base::CLockableClass<T> if the multithreaded library is compiled and mds::base::CNoLocking<T> otherwise. More...
struct  CLibraryLockableObject
 Class that comes to be mds::base::CLockableClass<T> if the multithreaded library is compiled and mds::base::CNoLocking<T> otherwise. More...
class  CLimit
 Functor limits an observed value to a specified range. More...
class  CLockableClass
 Implements a class-level locking scheme. More...
class  CLockableObject
 Implements a object-level locking scheme. More...
class  CLog
 Class implementing logging interface. More...
class  CLogChannel
 Abstract class encapsulating log channel. More...
class  CLogChannelFStream
 Channel for logging to the file stream. More...
class  CLogChannelOStream
 Channel for logging to the output STL stream. More...
class  CMax
 Functional object which can be used to find maximal value. More...
class  CMeanValue
 The functional object can be used to estimate mean value of a sequence of numbers. More...
class  CMemFuncHandler
 Wraps pointers to member functions. More...
struct  CMetaDotProduct
 Calculates dot product of two vectors. More...
struct  CMetaDotProduct< 1, T >
 Calculates dot product of two vectors. More...
struct  CMetaDotProductImpl
 Calculates dot product of two vectors. More...
struct  CMetaDotProductImpl< false, N, T >
 Calculates dot product of two vectors. More...
struct  CMetaForEach
 Applies functor to a sequence of numbers. More...
struct  CMetaForEach< 1, T, F >
 Applies functor to a sequence of numbers. More...
struct  CMetaForEachImpl
 Applies functor to a sequence of numbers. More...
struct  CMetaForEachImpl< false, N, T, F >
 Applies functor to a sequence of numbers. More...
class  CMin
 Functional object which can be used to find minimal value. More...
class  CMult
 Functor multiplies by a given value. More...
class  CNoLocking
 A single-threaded model with no locking. More...
struct  CNotImplemented
 Exception thrown from a failed constructor. More...
class  CObject
 Base class providing intrusive reference counting model. More...
class  CPartedData
 Class template managing references to a block of memory that is allocated in parts as a sequence of smaller memory blocks. More...
class  CRefData
 Class template managing references to a block of memory. More...
class  CReplace
 Functor changes value of an observed variable. More...
class  CScopedPtr
 Base smart pointer which transfers ownership of a handled object. More...
class  CSharedPtr
 Smart pointer to a shared object providing intrusive reference counting. More...
class  CSHMData
 Class template managing references to a block of allocated memory. More...
class  CSingleton
 Class from which an singleton must be derived. More...
class  CSingletonDestroyer
 Concrete singleton destroyer which is used to delete a singleton instance. More...
class  CSingletonHolder
 Provides singleton amenities for a type T. More...
class  CSingletonLifetime
 Singleton lifetime. More...
class  CSmallObject
 Base class for polymorphic small objects providing fast allocations and deallocations. More...
class  CSmallObjectAllocator
 Offers services for allocating small objects. More...
class  CSmallObjectBase
 Base class for small object allocation classes. More...
class  CSmallValueObject
 Base class for small objects with value-type semantics - offers fast allocations and deallocations. More...
class  CStaticData
 Class template providing data allocation. More...
class  CSTLIterator
 STL iterator wrapper. More...
class  CSub
 Functor subtracts a given value. More...
class  CSum
 The functional object can be used to estimate sum of a sequence of numbers. More...
class  CSumOfSquares
 Estimates sum of squares of a sequence of numbers. More...
class  CVariance
 The functional object estimates variance of a sequence of numbers. More...
class  CWarning
 Class encapsulating an exception origin and description. More...

Typedefs

typedef CSingleton< SL_DEFAULTCDefaultSingleton
 Default singleton class.
typedef CSingleton< SL_LIBRARYCLibrarySingleton
 Singleton having 'mds::SL_LIBRARY' system longevity.
typedef
CLogChannelFStream::tSmartPtr 
CLogChannelFStreamPtr
 Smart pointer to the log channel.
typedef
CLogChannelOStream::tSmartPtr 
CLogChannelOStreamPtr
 Smart pointer to the log channel.
typedef CLogChannel::tSmartPtr CLogChannelPtr
 Smart pointer to the log channel.
typedef CLog::tSmartPtr CLogPtr
 Smart pointer to the log.
typedef std::list
< CSingletonLifetime * > 
tSingletonTracker
 Vector of all created singleton instances.
typedef void(* tVoidFunction )()
 Pointer to a void function.

Enumerations

enum  ESingletonLongevity {
  SL_DEFAULT = 0x0000, SL_SHORT = 0x0100, SL_MIDDLE = 0x0200, SL_LONG = 0x0400,
  SL_LIBRARY = 0x0800, SL_ALLOCATOR = 0xffff
}
 Default singleton longevity values. More...

Functions

void atExitFunction ()
 The number of elements in the array.
template<typename Iterator , typename Function >
Function forEach (Iterator First, Iterator Last, Function Func)
 Applies a given function object to all items (STL-like version).
template<typename Derived , typename Function >
Function forEach (CIteratorBase< Derived > It, Function Func)
 Applies a given function object to all items.
tSize getOffset (tSize NumBytes, tSize Alignment)
 Calculates index into array where a CFixedAllocator of NumBytes is located.
template<typename T , typename U >
void memAdd (T *pMem, const U &Value, tSize Count)
 Adds Value to all memory elements.
template<typename T >
T * memAlloc (tSize Count)
 Allocates memory.
template<typename T >
void memCopy (T *pDst, const T *pSrc, tSize Count)
 Copies memory.
template<typename T , typename U >
void memDiv (T *pMem, const U &Value, tSize Count)
 Divides memory elements by Value.
template<typename T >
void memFree (T *pMem)
 De-allocates memory.
template<typename T >
void memLoopCopy (T *pDst, const T *pSrc, tSize Count)
 Copies memory.
template<typename T , typename U >
void memMult (T *pMem, const U &Value, tSize Count)
 Multiples memory elements by Value.
template<typename T >
T * memRealloc (T *pMem, tSize Count)
 Reallocates memory.
template<typename T >
void memSet (T *pMem, const T &Value, tSize Count)
 Initializes memory.
template<typename T , typename U >
void memSparseAdd (T *pMem, tSize Stride, const U &Value, tSize Count)
 Adds Value to all memory elements.
template<typename T >
void memSparseCopy (T *pDst, tSize DstStride, const T *pSrc, tSize SrcStride, tSize Count)
 Copies memory.
template<typename T , typename U >
void memSparseDiv (T *pMem, tSize Stride, const U &Value, tSize Count)
 Divides memory elements by Value.
template<typename T , typename U >
void memSparseMult (T *pMem, tSize Stride, const U &Value, tSize Count)
 Multiples memory elements by Value.
template<typename T >
void memSparseSet (T *pMem, tSize Stride, const T &Value, tSize Count)
 Initializes memory.
template<typename T , typename U >
void memSparseSub (T *pMem, tSize Stride, const U &Value, tSize Count)
 Subtracts Value from memory elements.
template<typename T >
void memSparseSwap (T *p1, tSize Stride1, const T *p2, tSize Stride2, tSize Count)
 Swaps content of two memory blocks.
template<typename T , typename U >
void memSub (T *pMem, const U &Value, tSize Count)
 Subtracts Value from memory elements.
template<typename T >
void memSwap (T *p1, T *p2, tSize Count)
 Swaps content of two memory blocks.
template<typename T , typename U >
void memVectAdd (T *pDst, const U *pSrc, tSize Count)
 Adds memory elements pointed to by pSrc to pDst.
template<typename T , typename U >
void memVectDiv (T *pDst, const U *pSrc, tSize Count)
 Divides memory elements pointed to by 'pDst' by 'pSrc' elements.
template<typename T , typename U >
void memVectMult (T *pDst, const U *pSrc, tSize Count)
 Multiples memory elements pointed to by 'pDst' by 'pSrc' elements.
template<typename T , typename U , typename V >
void memVectMultAdd (T *pDst, const U *pSrc, const V &Value, tSize Count)
 Adds memory elements pointed to by pSrc and multiplied by Value to pDst.
template<typename T , typename U >
void memVectSparseAdd (T *pDst, tSize DstStride, const U *pSrc, tSize SrcStride, tSize Count)
 Adds memory elements pointed to by 'pSrc' to 'pDst'.
template<typename T , typename U >
void memVectSparseDiv (T *pDst, tSize DstStride, const U *pSrc, tSize SrcStride, tSize Count)
 Divides memory elements pointed to by 'pDst' by 'pSrc' elements.
template<typename T , typename U >
void memVectSparseMult (T *pDst, tSize DstStride, const U *pSrc, tSize SrcStride, tSize Count)
 Multiples memory elements pointed to by 'pDst' by 'pSrc' elements.
template<typename T , typename U , typename V >
void memVectSparseMultAdd (T *pDst, tSize DstStride, const U *pSrc, tSize SrcStride, const V &Value, tSize Count)
 Adds memory elements pointed to by 'pSrc' and multiplied by Value to 'pDst'.
template<typename T , typename U >
void memVectSparseSub (T *pDst, tSize DstStride, const U *pSrc, tSize SrcStride, tSize Count)
 Subtracts memory elements pointed to by 'pSrc' from 'pDst'.
template<typename T , typename U >
void memVectSub (T *pDst, const U *pSrc, tSize Count)
 Subtracts memory elements pointed to by 'pSrc' from 'pDst'.
template<int N, typename T >
metaDotProduct (T *a, T *b)
 Calculates dot product of two vectors.
template<int N, typename T , class Function >
Function metaForEach (T *p, Function Func)
 Applies functor to a sequence of numbers.
std::ostream & operator<< (std::ostream &Stream, const CError &Error)
std::ostream & operator<< (std::ostream &Stream, const CWarning &Warning)
std::ostream & operator<< (std::ostream &Stream, const CFullException &Exception)

Variables

const std::string LOG_DEFAULT_EXT = ".log"
 Default log file extension.
tSingletonTrackerpSingletonTracker = 0
 Extern vector of all created singleton instances.

Typedef Documentation

Default singleton class.

Singleton having 'mds::SL_LIBRARY' system longevity.

typedef CLogChannelFStream::tSmartPtr mds::base::CLogChannelFStreamPtr

Smart pointer to the log channel.

typedef CLogChannelOStream::tSmartPtr mds::base::CLogChannelOStreamPtr

Smart pointer to the log channel.

typedef CLogChannel::tSmartPtr mds::base::CLogChannelPtr

Smart pointer to the log channel.

typedef CLog::tSmartPtr mds::base::CLogPtr

Smart pointer to the log.

Vector of all created singleton instances.

typedef void(* mds::base::tVoidFunction)()

Pointer to a void function.


Enumeration Type Documentation

Default singleton longevity values.

Enumerator:
SL_DEFAULT 
SL_SHORT 
SL_MIDDLE 
SL_LONG 
SL_LIBRARY 
SL_ALLOCATOR 

Function Documentation

The number of elements in the array.

Ensures proper destruction of objects with longevity

template<typename Iterator , typename Function >
Function mds::base::forEach ( Iterator  First,
Iterator  Last,
Function  Func 
)

Applies a given function object to all items (STL-like version).

template<typename Derived , typename Function >
Function mds::base::forEach ( CIteratorBase< Derived >  It,
Function  Func 
)

Applies a given function object to all items.

tSize mds::base::getOffset ( tSize  NumBytes,
tSize  Alignment 
)

Calculates index into array where a CFixedAllocator of NumBytes is located.

template<typename T , typename U >
void mds::base::memAdd ( T *  pMem,
const U &  Value,
tSize  Count 
)

Adds Value to all memory elements.

template<typename T >
T* mds::base::memAlloc ( tSize  Count)

Allocates memory.

  • Throws std::bad_alloc exception on failure.
template<typename T >
void mds::base::memCopy ( T *  pDst,
const T *  pSrc,
tSize  Count 
)

Copies memory.

template<typename T , typename U >
void mds::base::memDiv ( T *  pMem,
const U &  Value,
tSize  Count 
)

Divides memory elements by Value.

template<typename T >
void mds::base::memFree ( T *  pMem)

De-allocates memory.

template<typename T >
void mds::base::memLoopCopy ( T *  pDst,
const T *  pSrc,
tSize  Count 
)

Copies memory.

template<typename T , typename U >
void mds::base::memMult ( T *  pMem,
const U &  Value,
tSize  Count 
)

Multiples memory elements by Value.

template<typename T >
T* mds::base::memRealloc ( T *  pMem,
tSize  Count 
)

Reallocates memory.

  • Returns a valid pointer if the size is zero!
  • Throws std::bad_alloc exception on failure.
template<typename T >
void mds::base::memSet ( T *  pMem,
const T &  Value,
tSize  Count 
)

Initializes memory.

template<typename T , typename U >
void mds::base::memSparseAdd ( T *  pMem,
tSize  Stride,
const U &  Value,
tSize  Count 
)

Adds Value to all memory elements.

template<typename T >
void mds::base::memSparseCopy ( T *  pDst,
tSize  DstStride,
const T *  pSrc,
tSize  SrcStride,
tSize  Count 
)

Copies memory.

template<typename T , typename U >
void mds::base::memSparseDiv ( T *  pMem,
tSize  Stride,
const U &  Value,
tSize  Count 
)

Divides memory elements by Value.

template<typename T , typename U >
void mds::base::memSparseMult ( T *  pMem,
tSize  Stride,
const U &  Value,
tSize  Count 
)

Multiples memory elements by Value.

template<typename T >
void mds::base::memSparseSet ( T *  pMem,
tSize  Stride,
const T &  Value,
tSize  Count 
)

Initializes memory.

template<typename T , typename U >
void mds::base::memSparseSub ( T *  pMem,
tSize  Stride,
const U &  Value,
tSize  Count 
)

Subtracts Value from memory elements.

template<typename T >
void mds::base::memSparseSwap ( T *  p1,
tSize  Stride1,
const T *  p2,
tSize  Stride2,
tSize  Count 
)

Swaps content of two memory blocks.

template<typename T , typename U >
void mds::base::memSub ( T *  pMem,
const U &  Value,
tSize  Count 
)

Subtracts Value from memory elements.

template<typename T >
void mds::base::memSwap ( T *  p1,
T *  p2,
tSize  Count 
)

Swaps content of two memory blocks.

template<typename T , typename U >
void mds::base::memVectAdd ( T *  pDst,
const U *  pSrc,
tSize  Count 
)

Adds memory elements pointed to by pSrc to pDst.

template<typename T , typename U >
void mds::base::memVectDiv ( T *  pDst,
const U *  pSrc,
tSize  Count 
)

Divides memory elements pointed to by 'pDst' by 'pSrc' elements.

template<typename T , typename U >
void mds::base::memVectMult ( T *  pDst,
const U *  pSrc,
tSize  Count 
)

Multiples memory elements pointed to by 'pDst' by 'pSrc' elements.

template<typename T , typename U , typename V >
void mds::base::memVectMultAdd ( T *  pDst,
const U *  pSrc,
const V &  Value,
tSize  Count 
)

Adds memory elements pointed to by pSrc and multiplied by Value to pDst.

template<typename T , typename U >
void mds::base::memVectSparseAdd ( T *  pDst,
tSize  DstStride,
const U *  pSrc,
tSize  SrcStride,
tSize  Count 
)

Adds memory elements pointed to by 'pSrc' to 'pDst'.

template<typename T , typename U >
void mds::base::memVectSparseDiv ( T *  pDst,
tSize  DstStride,
const U *  pSrc,
tSize  SrcStride,
tSize  Count 
)

Divides memory elements pointed to by 'pDst' by 'pSrc' elements.

template<typename T , typename U >
void mds::base::memVectSparseMult ( T *  pDst,
tSize  DstStride,
const U *  pSrc,
tSize  SrcStride,
tSize  Count 
)

Multiples memory elements pointed to by 'pDst' by 'pSrc' elements.

template<typename T , typename U , typename V >
void mds::base::memVectSparseMultAdd ( T *  pDst,
tSize  DstStride,
const U *  pSrc,
tSize  SrcStride,
const V &  Value,
tSize  Count 
)

Adds memory elements pointed to by 'pSrc' and multiplied by Value to 'pDst'.

template<typename T , typename U >
void mds::base::memVectSparseSub ( T *  pDst,
tSize  DstStride,
const U *  pSrc,
tSize  SrcStride,
tSize  Count 
)

Subtracts memory elements pointed to by 'pSrc' from 'pDst'.

  • Result is stored in 'pDst'.
template<typename T , typename U >
void mds::base::memVectSub ( T *  pDst,
const U *  pSrc,
tSize  Count 
)

Subtracts memory elements pointed to by 'pSrc' from 'pDst'.

  • Result is stored in 'pDst'.
template<int N, typename T >
T mds::base::metaDotProduct ( T *  a,
T *  b 
)

Calculates dot product of two vectors.

  • Convenience function
template<int N, typename T , class Function >
Function mds::base::metaForEach ( T *  p,
Function  Func 
)

Applies functor to a sequence of numbers.

  • Convenience function.
std::ostream& mds::base::operator<< ( std::ostream &  Stream,
const CError &  Error 
)
std::ostream& mds::base::operator<< ( std::ostream &  Stream,
const CWarning &  Warning 
)
std::ostream& mds::base::operator<< ( std::ostream &  Stream,
const CFullException &  Exception 
)

Variable Documentation

const std::string mds::base::LOG_DEFAULT_EXT = ".log"

Default log file extension.

Extern vector of all created singleton instances.

Vector of all created singleton instances.