soma-io  5.0.5
soma::XMLFormatReader Class Reference

#include <soma-io/reader/xmlformatreader.h>

Inheritance diagram for soma::XMLFormatReader:
Collaboration diagram for soma::XMLFormatReader:

Public Member Functions

virtual carto::GenericObjectcreateAndRead (carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
 Factory mode: creates an object and reads it. More...
 
virtual void read (carto::GenericObject &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
 Reads part or all of the object obj. More...
 
virtual FormatReader< carto::GenericObject > * clone () const
 Duplicate the FormatReader. More...
 
virtual std::string formatID () const
 Format identifier (abstract). More...
 
virtual carto::GenericObjectcreateAndRead (carto::Object header, carto::rc_ptr< DataSource > ds, const AllocatorContext &context, carto::Object options)
 
virtual void read (carto::GenericObject &obj, carto::Object header, const AllocatorContext &context, carto::Object options)
 
- Public Member Functions inherited from soma::FormatReader< carto::GenericObject >
virtual ~FormatReader ()
 
virtual void setupAndRead (carto::GenericObject &obj, carto::rc_ptr< DataSourceInfo > dsi, const AllocatorContext &context, carto::Object options)
 Full reading procedure, for an already existing object. More...
 
virtual carto::rc_ptr< DataSourceInfocheckDataSourceInfo (carto::rc_ptr< DataSourceInfo > dsi, carto::Object options)
 Checks that dsi has been identified with the matching format checker. More...
 
virtual carto::GenericObjectcreate (carto::Object header, const AllocatorContext &context, carto::Object options)
 create the object to be read, bind the allocation context. More...
 
virtual void setup (carto::GenericObject &obj, carto::Object header, const AllocatorContext &context, carto::Object options)
 setup an existing object (for resizing or reallocation for instance). More...
 

Detailed Description

Definition at line 48 of file xmlformatreader.h.

Member Function Documentation

◆ clone()

virtual FormatReader<carto::GenericObject>* soma::XMLFormatReader::clone ( ) const
virtual

Duplicate the FormatReader.

Some FormatReader can contain data describing the data source or storage buffer, so must be cloned for each read. Note that, for now, the cloned instance does not need to have the same bound internal data, since it is cloned precisely to work on a different source/buffer. It just needs to be another instance of the same exact type.

Implements soma::FormatReader< carto::GenericObject >.

◆ createAndRead() [1/2]

virtual carto::GenericObject* soma::XMLFormatReader::createAndRead ( carto::rc_ptr< DataSourceInfo dsi,
const AllocatorContext context,
carto::Object  options 
)
virtual

Factory mode: creates an object and reads it.

The returned object belongs to the calling layer and may be deleted by the standard delete

Reimplemented from soma::FormatReader< carto::GenericObject >.

◆ createAndRead() [2/2]

virtual carto::GenericObject* soma::XMLFormatReader::createAndRead ( carto::Object  header,
carto::rc_ptr< DataSource ds,
const AllocatorContext context,
carto::Object  options 
)
virtual

◆ formatID()

virtual std::string soma::XMLFormatReader::formatID ( ) const
inlinevirtual

Format identifier (abstract).

Used to match checker and reader

Implements soma::FormatReader< carto::GenericObject >.

Definition at line 63 of file xmlformatreader.h.

◆ read() [1/2]

virtual void soma::XMLFormatReader::read ( carto::GenericObject obj,
carto::rc_ptr< DataSourceInfo dsi,
const AllocatorContext context,
carto::Object  options 
)
virtual

Reads part or all of the object obj.

This read() method should be called after everything is setup and bound For objects supporting allocators, context should be the same as the context bound to the object, and reading is just a matter of calling the read methods of the DataSource bound to the context.

Parameters
objobject to read into
dsiDataSourceInfo containing pre-computed header, data source list and capabilities.
optionsmay specify a sub-object for partial reading

Reimplemented from soma::FormatReader< carto::GenericObject >.

◆ read() [2/2]

virtual void soma::XMLFormatReader::read ( carto::GenericObject obj,
carto::Object  header,
const AllocatorContext context,
carto::Object  options 
)
virtual

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