fw4spl
fwDataIO::reader::IObjectReader Class Referenceabstract

Base class for all object readers. More...

#include <IObjectReader.hpp>

+ Inheritance diagram for fwDataIO::reader::IObjectReader:
+ Collaboration diagram for fwDataIO::reader::IObjectReader:

Classes

class  Registrar
 Class used to register a class factory in factory registry. This class defines also the object factory ( 'create' ) More...
 

Public Types

typedef std::function< void(std::uint64_t) > ProgressCallback
 
typedef std::function< void() > CancelCallback
 
typedef ::fwDataIO::reader::factory::Key Key
 

Public Member Functions

virtual bool isA (const std::string &type) const override
 
virtual FWDATAIO_API void read ()=0
 Defines an reader interface. More...
 
virtual FWDATAIO_API void setObject (::fwTools::Object::sptr _pObject)
 m_object setter. More...
 
virtual FWDATAIO_API::fwTools::Object::sptr getObject ()
 m_object getter. More...
 
virtual FWDATAIO_API void setLocation (const ::fwData::location::ILocation::sptr _location)
 m_location setter. More...
 
virtual FWDATAIO_API::fwData::location::ILocation::sptr getLocation ()
 m_location getter. More...
 
virtual FWDATAIO_API std::string extension ()=0
 
FWDATAIO_API void cancel ()
 Requests reader abortion.
 
virtual FWDATAIO_API std::shared_ptr< ::fwJobs::IJobgetJob () const
 Returns the internal job.
 
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwCore::BaseObject
static bool isTypeOf (const std::string &type)
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Protected Member Functions

FWDATAIO_API IObjectReader ()
 Constructor. Do nothing.
 
virtual FWDATAIO_API ~IObjectReader ()
 Destructor. Do nothing.
 

Protected Attributes

::fwTools::Object::wptr m_object
 Object result of reading process. More...
 
::fwData::location::ILocation::sptr m_location
 Object location ( file path, directory path, url, etc )
 

Demangling methods

virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
virtual const std::string & getClassname () const override
 return full object's classname with its namespace, i.e. fwCore::BaseObject
 
static const std::string & leafClassname ()
 return object's classname without its namespace, i.e. BaseObject
 
static const std::string & classname ()
 return object's classname without its namespace, i.e. BaseObject
 

Detailed Description

Base class for all object readers.

This class defines the API to use basic object readers. This reader is not service. Their equivalent exist as services see fwIO::IReader. To read an object with this class, use setLocation and setOject method before execute the method read. Reading modify the object given in parameter with the method setOject.

Definition at line 41 of file core/fwDataIO/include/fwDataIO/reader/IObjectReader.hpp.

Member Function Documentation

fwData::location::ILocation::sptr fwDataIO::reader::IObjectReader::getLocation ( )
virtual

m_location getter.

Returns
m_location

Definition at line 54 of file core/fwDataIO/src/fwDataIO/reader/IObjectReader.cpp.

References m_location.

fwTools::Object::sptr fwDataIO::reader::IObjectReader::getObject ( )
virtual

m_object getter.

Returns
m_object
Note
m_object is saved in reader with a weakptr

Definition at line 38 of file core/fwDataIO/src/fwDataIO/reader/IObjectReader.cpp.

References m_object, and SLM_ASSERT.

Referenced by fwDataIO::reader::GenericObjectReader< ::fwData::Tag >::getConcreteObject().

+ Here is the caller graph for this function:

void fwDataIO::reader::IObjectReader::setLocation ( const ::fwData::location::ILocation::sptr  _location)
virtual

m_location setter.

Parameters
[in]_locationset location where object will be read

Definition at line 47 of file core/fwDataIO/src/fwDataIO/reader/IObjectReader.cpp.

References m_location.

Member Data Documentation

::fwTools::Object::wptr fwDataIO::reader::IObjectReader::m_object
protected

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