fw4spl
writer/tid/TemplateID.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
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 #pragma once
8 
9 #include "fwGdcmIO/config.hpp"
10 #include "fwGdcmIO/container/DicomInstance.hpp"
11 
12 #include <fwData/Object.hpp>
13 
14 #include <gdcmWriter.h>
15 
16 namespace fwGdcmIO
17 {
18 namespace writer
19 {
20 namespace tid
21 {
22 
26 template< class DATATYPE >
27 class FWGDCMIO_CLASS_API TemplateID
28 {
29 
30 public:
37  FWGDCMIO_API TemplateID(const SPTR(::gdcm::Writer)& writer,
38  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
39  const CSPTR(DATATYPE)& object);
40 
42  FWGDCMIO_API virtual ~TemplateID();
43 
44 protected:
45 
47  SPTR(::gdcm::Writer) m_writer;
48 
50  SPTR(::fwGdcmIO::container::DicomInstance) m_instance;
51 
53  CSPTR(DATATYPE) m_object;
54 };
55 
56 //------------------------------------------------------------------------------
57 
58 template< class DATATYPE >
59 TemplateID<DATATYPE>::TemplateID(const SPTR(::gdcm::Writer)& writer,
60  const SPTR(::fwGdcmIO::container::DicomInstance)& instance,
61  const CSPTR(DATATYPE)& object) :
62  m_writer(writer),
63  m_instance(instance),
64  m_object(object)
65 {
66  SLM_ASSERT("Writer should not be null.", writer);
67  SLM_ASSERT("Instance should not be null.", instance);
68  SLM_ASSERT("Object should not be null.", object);
69 }
70 
71 //------------------------------------------------------------------------------
72 
73 template< class DATATYPE >
75 {
76 }
77 
78 //------------------------------------------------------------------------------
79 
80 } // namespace tid
81 } // namespace writer
82 } // namespace fwGdcmIO
#define SPTR(_cls_)
#define CSPTR(_cls_)
This class defines a DICOM SOP instance. It is useful during the whole writing process. This class allows to share data between module writers.
virtual FWGDCMIO_API ~TemplateID()
Destructor.
TemplateID base class used to write templates.
The namespace fwGdcmIO contains reader, writer and helper for dicom data.
#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