DCMTK  Version 3.6.7
OFFIS DICOM Toolkit
OFdefault_optional_traits< T > Class Template Reference

Default storage traits of OFoptional<T>. More...

Detailed Description

template<typename T>
class OFdefault_optional_traits< T >

Default storage traits of OFoptional<T>.

OFdefault_optional_traits manages the state and storage of the contained object in a portable manner. You may use this class as base when defining custom traits for a specific type T, so you won't have to re-implement this functionality entirely.

Template Parameters
Tthe content type of the respective OFoptional instance.
See also
OFoptional
OFoptional_traits

Example

This example shows how to override the is_default_constructible attribute of OFoptional_traits for the custom class Test.

// Note: Test's default constructor is private
// which leads to errors when being used within
// OFoptional, since a default constructor exists
// but can't be accessed.
class Test
{
Test() {}
public:
static OFoptional<T> instance();
.
.
.
};
// Override OFoptional's behavior to fix this problem
template<>
struct OFoptional_traits<Test>
: OFdefault_optional_traits<Test> // derived from default traits
{
// Tell OFoptional that it can't default-construct
// a Test object.
typedef OFfalse_type is_default_constructible;
};
Default storage traits of OFoptional<T>.
Definition: ofoption.h:126
The class template OFoptional manages an optional contained value, i.e. a value tagged with a state t...
Definition: ofoption.h:501
Manages storage and state of the object contained in OFoptional<T>.
Definition: ofoption.h:259

The documentation for this class was generated from the following file:


Generated on Thu Apr 28 2022 for DCMTK Version 3.6.7 by Doxygen 1.9.1