aimstil  5.0.5
labels.h File Reference

Defines empty classes that serves as labels. More...

Include dependency graph for labels.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  til::PointerTraits< Pointer >
 Pointer traits. More...
 
class  til::is_ImagePointer< T >
 
struct  til::is_ImagePointer< T >::No
 
class  til::Neighborhood_label
 
class  til::is_Neighborhood< T >
 
struct  til::is_Neighborhood< T >::No
 

Namespaces

 til
 Belongs to package Box Do not include directly, include til/Box.h instead.
 

Macros

#define DEFINE_LABEL_CLASS(name)   DEFINE_LABEL_CLASS_WITH_INHERITANCE(name, )
 
#define DEFINE_LABEL_CLASS_WITH_INHERITANCE(name, inherit)
 
#define DEFINE_LABEL_CLASS_FULL(labelname, memtypename)   class labelname { public: typedef void memtypename; }; \
 
#define DEFINE_TEST_CLASS_FULL(testname, memtypename, inherit)
 

Functions

 til::DEFINE_TEST_CLASS_FULL (has_result_type, result_type,)
 
 til::DEFINE_LABEL_CLASS (ExtrapolableImage)
 Label for extrapolable images. More...
 
 til::DEFINE_LABEL_CLASS (Image)
 Label for all image classes. More...
 
 til::DEFINE_LABEL_CLASS (ImageExtrapolator)
 Label for image extrapolators. More...
 
 til::DEFINE_LABEL_CLASS (ImageFunctor)
 Label for image functors. More...
 
 til::DEFINE_LABEL_CLASS (ImageIterator)
 Label for all image iterator classes. More...
 
 til::DEFINE_LABEL_CLASS (Interpolator)
 Label for interpolator of a sequence of number. More...
 
 til::DEFINE_LABEL_CLASS (Mapping)
 Label for coordinate transforms. More...
 
 til::DEFINE_LABEL_CLASS_WITH_INHERITANCE (VolumetricImageIterator, :public ImageIterator_label)
 Label for TIL smart pointers. More...
 
 til::DEFINE_LABEL_CLASS (detemplated_functor)
 Label for neighborhoods. More...
 
 til::DEFINE_LABEL_CLASS (range)
 
 til::DEFINE_LABEL_CLASS (numeric_container)
 
 til::DEFINE_LABEL_CLASS (multi_array)
 
 til::DEFINE_LABEL_CLASS (line_minimization_algorithm)
 

Detailed Description

Defines empty classes that serves as labels.

Labels may have multiple purpose. They can be used to detect if a template argument is indeed of the expected type. They can also help collecting similar object together and create a hierarchy that help user browse through the library API (e.g. when using an automatically generated documentation). Basically, it replaces the standard inheritance scheme that is avoided in template programming for efficiency reasons, replaces namespaces to avoid the user having to jongle with potentially dozens of namespaces, and help the compiler having readable compiler errors when substitution fails.

Definition in file labels.h.

Macro Definition Documentation

◆ DEFINE_LABEL_CLASS

#define DEFINE_LABEL_CLASS (   name)    DEFINE_LABEL_CLASS_WITH_INHERITANCE(name, )

Definition at line 35 of file labels.h.

◆ DEFINE_LABEL_CLASS_FULL

#define DEFINE_LABEL_CLASS_FULL (   labelname,
  memtypename 
)    class labelname { public: typedef void memtypename; }; \

Definition at line 41 of file labels.h.

◆ DEFINE_LABEL_CLASS_WITH_INHERITANCE

#define DEFINE_LABEL_CLASS_WITH_INHERITANCE (   name,
  inherit 
)
Value:
DEFINE_LABEL_CLASS_FULL(name##_label, Is##name) \
DEFINE_TEST_CLASS_FULL(is_##name, Is##name, inherit) \
#define DEFINE_LABEL_CLASS_FULL(labelname, memtypename)
Definition: labels.h:41

Definition at line 37 of file labels.h.

◆ DEFINE_TEST_CLASS_FULL

#define DEFINE_TEST_CLASS_FULL (   testname,
  memtypename,
  inherit 
)
Value:
template <typename T> \
class testname inherit \
{ \
protected: \
typedef char Yes; \
struct No { char a[2]; }; \
template <typename U> static Yes testfunc (typename U:: memtypename const*); \
template <typename U> static No testfunc (...); \
public: \
enum { \
value = (sizeof(testname <T>::template testfunc <T>(0)) == sizeof(Yes)) \
}; \
};

Definition at line 65 of file labels.h.