fw4spl
core/fwDataIO/src/fwDataIO/reader/IObjectReader.cpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #include <fwData/location/ILocation.hpp>
8 
9 #include "fwDataIO/reader/IObjectReader.hpp"
10 
11 namespace fwDataIO
12 {
13 
14 namespace reader
15 {
16 
17 //------------------------------------------------------------------------------
18 
20 {
21 }
22 
23 //------------------------------------------------------------------------------
24 
26 {
27 }
28 
29 //------------------------------------------------------------------------------
30 
31 void IObjectReader::setObject( ::fwTools::Object::sptr _pObject )
32 {
33  m_object = _pObject;
34 }
35 
36 //------------------------------------------------------------------------------
37 
38 ::fwTools::Object::sptr IObjectReader::getObject()
39 {
40  auto object = m_object.lock();
41  SLM_ASSERT( "Object is null", object );
42  return object;
43 }
44 
45 //------------------------------------------------------------------------------
46 
47 void IObjectReader::setLocation( const ::fwData::location::ILocation::sptr _location )
48 {
49  m_location = _location;
50 }
51 
52 //------------------------------------------------------------------------------
53 
54 ::fwData::location::ILocation::sptr IObjectReader::getLocation()
55 {
56  return m_location;
57 }
58 
59 //------------------------------------------------------------------------------
60 
62 {
63  auto job = this->getJob();
64  if ( job )
65  {
66  job->cancel();
67  }
68 }
69 
70 
71 //------------------------------------------------------------------------------
72 
73 } // namespace reader
74 
75 } // namespace fwDataIO
This namespace fwDataIO contains reader and writer for several framework&#39;s data.
::fwTools::Object::wptr m_object
Object result of reading process.
virtual FWDATAIO_API void setLocation(const ::fwData::location::ILocation::sptr _location)
m_location setter.
virtual FWDATAIO_API std::shared_ptr< ::fwJobs::IJob > getJob() const
Returns the internal job.
virtual FWDATAIO_API::fwTools::Object::sptr getObject()
m_object getter.
virtual FWDATAIO_API void setObject(::fwTools::Object::sptr _pObject)
m_object setter.
FWDATAIO_API void cancel()
Requests reader abortion.
#define SLM_ASSERT(message, cond)
work like &#39;assert&#39; from &#39;cassert&#39;, with in addition a message logged by spylog (with FATAL loglevel) ...
Definition: spyLog.hpp:308
virtual FWDATAIO_API::fwData::location::ILocation::sptr getLocation()
m_location getter.
virtual FWDATAIO_API ~IObjectReader()
Destructor. Do nothing.
::fwData::location::ILocation::sptr m_location
Object location ( file path, directory path, url, etc )