soma-io
5.0.5
|
Object creation / resize or other setup factory. More...
#include <soma-io/utilities/creator.h>
Static Public Member Functions | |
static T * | create (carto::Object header, const AllocatorContext &context, carto::Object options) |
Create a new object according to the given header. More... | |
static void | setup (T &obj, carto::Object header, const AllocatorContext &context, carto::Object options) |
Setup (modify) an existing object according to the given header (maybe resize it etc.). More... | |
Object creation / resize or other setup factory.
Such factories are used by the IO system which has to create or setup new objects according to information provided in the file header.
Specific implementations for new object types may be specialized. It is suggested that their ObjectCreator implementation is defined along with the object definition itself, to avoid accidentally using the default (non-specialized) creator somewhere (just like DataTypeCode).
|
inlinestatic |
Create a new object according to the given header.
The default implementation just returns a new T.
Definition at line 76 of file creator.h.
References cartoCondMsg.
Referenced by soma::FormatReader< carto::GenericObject >::create().
|
inlinestatic |
Setup (modify) an existing object according to the given header (maybe resize it etc.).
The default implementation does nothing.
Definition at line 86 of file creator.h.
References cartoCondMsg.
Referenced by soma::FormatReader< carto::GenericObject >::setup().