DCMTK
Version 3.6.1 20170228
OFFIS DICOM Toolkit
|
Implements platform independent alignment, if possible similar to C++11's alignof / alignas functionality. More...
Macros | |
#define | OFalignof <unspecified> |
Determine the alignment of a type T. More... | |
#define | OFalignas <unspecified> |
Align object or class like another type or as specified by an integral expression. More... | |
#define | OFalign <unspecified> |
Determine a type with modified alignment for a given type T. More... | |
#define | OFalign_typename OFTypename <unspecified> |
Alternate version of OFalign to be used within templates. More... | |
Implements platform independent alignment, if possible similar to C++11's alignof / alignas functionality.
#define OFalign <unspecified> |
Determine a type with modified alignment for a given type T.
#ifdef OFalign
to query availability. OFalign can be though of as the least common denominator of the alignment capabilities available on different platform / compiler combinations. Given a type T and an integral expression I, OFalign(T,I)
evaluates to an appropriately aligned type corresponding to T.
You may also use another type to specify the desired alignment, e.g. OFalign(T,int)
. OFalign will then calculate the alignment using OFalignof (if available) or use sizeof() as approximation.
To align arrays via OFalign, simply pass the array's extents within the parameter, e.g. OFalign(char[12],float)
to align an array containing 12 chars like a float.
When using OFalign inside a dependant scope (i.e. inside templates), you may need to use OFalign_typename instead, e.g.
OFalign should support alignments as any power of two <= 8192 (examine your compiler's manual when in doubt). Other alignments may also be supported, but may not be available on every platform. OFalign may simply ignore your request if you specify an unsupported aligment (won't output an error). You may want to check the alignment via OFalignof in case it is likely to fail. Using another type as alignment specifier should always work, as the required alignment is obviously supported in that case (at least when OFalignof is available).
#define OFalign_typename OFTypename <unspecified> |
Alternate version of OFalign to be used within templates.
#ifdef OFalign
or #ifdef OFalign_typename
to query availability. OFalign_typename is an alternate version of OFalign that internally uses keywords like OFTypename so it can be used inside a dependant scope. See OFalign for more information.
#define OFalignas <unspecified> |
Align object or class like another type or as specified by an integral expression.
#ifdef OFalignas
to query availability. See OFalign for an alternative with limited functionality that supports more platforms in return.OFalignas behaves similar to C++11's alignas when it's supported.
#define OFalignof <unspecified> |
Determine the alignment of a type T.
#ifdef OFalignof
to query availability.OFalignof behaves similar to C++11's alignof when it's supported.