Workspace 6.21.5
|
Traits class defining whether detection of serialization support for class T is permitted. More...
#include <Workspace/DataExecution/DataObjects/datafactorytraits.h>
Public Types | |
enum | { Allowed = 1 } |
If you want to enforce that T does not support serialization, then in the same header that defines T, specialize this class template as follows:
By doing this, all logic related to the detection of serialization support for T is disabled and T will be considered not serializable. This will result in the canSerialize(), load() and save() functions in TypedDataFactory being given appropriate function bodies without any further changes.
Normally, the default implementation is sufficient. It allows the code to work out what forms of serialization are available and use the best one, or to disable serialization support if no appropriate method is found. This all happens at compile time. There are some situations where the detection mechanisms can lead to compile errors, usually due to ambiguous overloads of the C++ streaming operators. In those cases, the developer may choose to supply their own overload for the streaming operators for their specific class T, or if they don't want serialization support, they can provide their own explicit specialization of SerializeDataType with Allowed
set to the value 0 as shown above.