DCMTK Version 3.6.9
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. | |
#define | OFalignas <unspecified> |
Align object or class like another type or as specified by an integral expression. | |
#define | OFalign <unspecified> |
Align a variable or data member. | |
#define | OFalign_typename OFTypename <unspecified> |
Alternate version of OFalign to be used within templates. | |
Implements platform independent alignment, if possible similar to C++11's alignof / alignas functionality.
#define OFalign <unspecified> |
Align a variable or data member.
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 a type with a corresponding alignment modifier (either included in the type definition or as a modifier put next to it).
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 dependent 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 alignment (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.
OFalign_typename is an alternate version of OFalign that internally uses keywords like OFTypename so it can be used inside a dependent scope. See OFalign for more information.
#define OFalignas <unspecified> |
Align object or class like another type or as specified by an integral expression.
OFalignas behaves similar to C++11's alignas when it's supported.
#define OFalignof <unspecified> |
Determine the alignment of a type T.
OFalignof behaves similar to C++11's alignof when it's supported.