anatomist  5.1.2
3D neuroimaging data viewer
anatomist::ObjectReader Class Reference

Object reader. More...

#include <anatomist/object/oReader.h>

Classes

class  LoadFunctionClass
 

Public Types

typedef std::vector< std::pair< AObject *, bool > > PostRegisterList
 
typedef std::list< AObject * >(* LoadFunction) (const std::string &filename, PostRegisterList &subObjectsToRegister, carto::Object options)
 

Public Member Functions

 ObjectReader ()
 
virtual ~ObjectReader ()
 
virtual std::list< AObject * > load (const std::string &filename, PostRegisterList &subObjectsToRegister, bool notifyFail=true, carto::Object options=carto::none(), void *clientid=0) const
 
virtual bool reload (AObject *object, bool notifyFail=true, bool onlyoutdated=false) const
 
virtual AObjectreadAims (const std::string &filename, PostRegisterList &subObjectsToRegister, carto::Object options=carto::none()) const
 

Static Public Member Functions

static ObjectReaderreader ()
 singleton access More...
 
static void registerLoader (const std::string &extension, LoadFunction newFunc)
 Register a new extension and a loader function. More...
 
static void registerLoader (const std::string &extension, LoadFunctionClass *newFunc)
 same as the above function but takes a class loader instead. More...
 
static std::string allSupportedFileExtensions ()
 
static std::string anatomistSupportedFileExtensions ()
 
static std::string supportedFileExtensions (const std::string &objtype)
 
static std::string supportedFileExtensions (const std::set< std::string > &objtypes)
 
static std::set< std::string > supportedFileExtensionsSet (const std::string &objtype)
 
static std::set< std::string > anatomistSupportedFileExtensionsSet ()
 
static void cleanup ()
 unregister all loaders (called when exiting) More...
 

Protected Member Functions

std::list< AObject * > load_internal (const std::string &filename, PostRegisterList &subObjectsToRegister, carto::Object options) const
 

Detailed Description

Object reader.

Replacement for static AObject::Load functions. Can be replaced by a derived class to include support for new objects. In addition, a registration procedure allows to add or replace readers functions for a given filename extension.

Definition at line 56 of file oReader.h.

Member Typedef Documentation

◆ LoadFunction

typedef std::list<AObject *>(* anatomist::ObjectReader::LoadFunction) (const std::string &filename, PostRegisterList &subObjectsToRegister, carto::Object options)

Definition at line 60 of file oReader.h.

◆ PostRegisterList

typedef std::vector<std::pair<AObject*,bool> > anatomist::ObjectReader::PostRegisterList

Definition at line 59 of file oReader.h.

Constructor & Destructor Documentation

◆ ObjectReader()

anatomist::ObjectReader::ObjectReader ( )

◆ ~ObjectReader()

virtual anatomist::ObjectReader::~ObjectReader ( )
virtual

Member Function Documentation

◆ allSupportedFileExtensions()

static std::string anatomist::ObjectReader::allSupportedFileExtensions ( )
static

◆ anatomistSupportedFileExtensions()

static std::string anatomist::ObjectReader::anatomistSupportedFileExtensions ( )
static

◆ anatomistSupportedFileExtensionsSet()

static std::set<std::string> anatomist::ObjectReader::anatomistSupportedFileExtensionsSet ( )
static

◆ cleanup()

static void anatomist::ObjectReader::cleanup ( )
static

unregister all loaders (called when exiting)

◆ load()

virtual std::list<AObject *> anatomist::ObjectReader::load ( const std::string &  filename,
PostRegisterList subObjectsToRegister,
bool  notifyFail = true,
carto::Object  options = carto::none(),
void *  clientid = 0 
) const
virtual

◆ load_internal()

std::list<AObject *> anatomist::ObjectReader::load_internal ( const std::string &  filename,
PostRegisterList subObjectsToRegister,
carto::Object  options 
) const
protected

◆ readAims()

virtual AObject* anatomist::ObjectReader::readAims ( const std::string &  filename,
PostRegisterList subObjectsToRegister,
carto::Object  options = carto::none() 
) const
virtual

◆ reader()

static ObjectReader* anatomist::ObjectReader::reader ( )
static

singleton access

◆ registerLoader() [1/2]

static void anatomist::ObjectReader::registerLoader ( const std::string &  extension,
LoadFunction  newFunc 
)
static

Register a new extension and a loader function.

◆ registerLoader() [2/2]

static void anatomist::ObjectReader::registerLoader ( const std::string &  extension,
LoadFunctionClass newFunc 
)
static

same as the above function but takes a class loader instead.

Parameters
newFuncwill be owned by ObjectReader

◆ reload()

virtual bool anatomist::ObjectReader::reload ( AObject object,
bool  notifyFail = true,
bool  onlyoutdated = false 
) const
virtual

◆ supportedFileExtensions() [1/2]

static std::string anatomist::ObjectReader::supportedFileExtensions ( const std::set< std::string > &  objtypes)
static

◆ supportedFileExtensions() [2/2]

static std::string anatomist::ObjectReader::supportedFileExtensions ( const std::string &  objtype)
static

◆ supportedFileExtensionsSet()

static std::set<std::string> anatomist::ObjectReader::supportedFileExtensionsSet ( const std::string &  objtype)
static

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