fw4spl
fwDataIO::reader::GenericObjectReader< DATATYPE > Class Template Reference

generic class for all object readers. More...

#include <GenericObjectReader.hpp>

+ Inheritance diagram for fwDataIO::reader::GenericObjectReader< DATATYPE >:
+ Collaboration diagram for fwDataIO::reader::GenericObjectReader< DATATYPE >:

Public Types

typedef DATATYPE DataType
 the object type related
 
- Public Types inherited from fwDataIO::reader::IObjectReader
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
 
 GenericObjectReader ()
 Constructor. Do nothing.
 
virtual std::string extension () override
 
virtual ~GenericObjectReader ()
 Destructor. Do nothing.
 
virtual void setObject (::fwTools::Object::sptr obj) override
 m_object setter. More...
 
virtual std::shared_ptr< DataTypegetConcreteObject ()
 m_object getter. More...
 
- Public Member Functions inherited from fwDataIO::reader::IObjectReader
virtual FWDATAIO_API void read ()=0
 Defines an reader interface. 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...
 
FWDATAIO_API void cancel ()
 Requests reader abortion.
 
virtual FWDATAIO_API std::shared_ptr< ::fwJobs::IJobgetJob () const
 Returns the internal job.
 
virtual const std::string & getLeafClassname () const override
 return object's classname without its namespace, i.e. BaseObject
 
- Public Member Functions inherited from fwCore::BaseObject

Static Public Member Functions

static bool isTypeOf (const std::string &type)
 
- Static Public Member Functions inherited from fwDataIO::reader::IObjectReader
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
 
- 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
 

Demangling methods

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

Additional Inherited Members

- Protected Member Functions inherited from fwDataIO::reader::IObjectReader
FWDATAIO_API IObjectReader ()
 Constructor. Do nothing.
 
virtual FWDATAIO_API ~IObjectReader ()
 Destructor. Do nothing.
 
- Protected Attributes inherited from fwDataIO::reader::IObjectReader
::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 )
 

Detailed Description

template<class DATATYPE>
class fwDataIO::reader::GenericObjectReader< DATATYPE >

generic class for all object readers.

This class adds 2 methods to the API of IObjectReader. This generic reader test the object type given to the method setObject. And add a new get method getConcreteObject() that returns an object already cast.

Definition at line 29 of file GenericObjectReader.hpp.

Member Function Documentation

template<class DATATYPE>
virtual std::shared_ptr< DataType > fwDataIO::reader::GenericObjectReader< DATATYPE >::getConcreteObject ( )
inlinevirtual

m_object getter.

Returns
m_object

This method automatic cast object in correct DataType.

Definition at line 74 of file GenericObjectReader.hpp.

template<class DATATYPE>
virtual void fwDataIO::reader::GenericObjectReader< DATATYPE >::setObject ( ::fwTools::Object::sptr  obj)
inlineoverridevirtual

m_object setter.

Parameters
[out]objreplace weakptr m_object of the instance reader

This method overload setObject to ensure that given object correspond to DATATYPE

Reimplemented from fwDataIO::reader::IObjectReader.

Definition at line 62 of file GenericObjectReader.hpp.


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