GDCM 3.2.1

gdcmCommandDataSet.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: GDCM (Grassroots DICOM). A DICOM library
4
5 Copyright (c) 2006-2011 Mathieu Malaterre
6 All rights reserved.
7 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
8
9 This software is distributed WITHOUT ANY WARRANTY; without even
10 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11 PURPOSE. See the above copyright notice for more information.
12
13=========================================================================*/
14#ifndef GDCMCOMMANDDATASET_H
15#define GDCMCOMMANDDATASET_H
16
17#include "gdcmDataSet.h"
18#include "gdcmDataElement.h"
19
20 namespace gdcm
21{
27 class GDCM_EXPORT CommandDataSet : public DataSet
28{
29 public:
30 CommandDataSet() = default;
31 ~CommandDataSet() = default;
32
33 friend std::ostream &operator<<(std::ostream &_os, const CommandDataSet &_val);
34
35 // FIXME: no virtual function means: duplicate code...
36 void Insert(const DataElement& de) {
37 if( de.GetTag().GetGroup() == 0x0000 )
38 {
39 InsertDataElement( de );
40 }
41 else
42 {
43 gdcmErrorMacro( "Cannot add element with group != 0x0000 in the command dataset : " << de );
44 }
45 }
46 void Replace(const DataElement& de) {
47 Remove(de.GetTag());
48 Insert(de);
49 }
50
52 std::istream &Read(std::istream &is);
53
55 std::ostream &Write(std::ostream &os) const;
56
57 protected:
58};
59//-----------------------------------------------------------------------------
60 inline std::ostream& operator<<(std::ostream &os, const CommandDataSet &val)
61{
62 val.Print( os );
63 return os;
64}
65
66} // end namespace gdcm
67
68#endif //GDCMFILEMETAINFORMATION_H
gdcm::CommandDataSet::Write
std::ostream & Write(std::ostream &os) const
Write.
gdcm::CommandDataSet::Insert
void Insert(const DataElement &de)
Definition gdcmCommandDataSet.h:36
gdcm::CommandDataSet::Read
std::istream & Read(std::istream &is)
Read.
gdcm::CommandDataSet::operator<<
friend std::ostream & operator<<(std::ostream &_os, const CommandDataSet &_val)
Definition gdcmCommandDataSet.h:60
gdcm::CommandDataSet::Replace
void Replace(const DataElement &de)
Definition gdcmCommandDataSet.h:46
gdcm::CommandDataSet::~CommandDataSet
~CommandDataSet()=default
gdcm::CommandDataSet::CommandDataSet
CommandDataSet()=default
gdcm::DataElement
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
gdcm::DataElement::GetTag
const Tag & GetTag() const
Get Tag.
Definition gdcmDataElement.h:67
gdcm::DataSet
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
gdcm::DataSet::InsertDataElement
void InsertDataElement(const DataElement &de)
Definition gdcmDataSet.h:273
gdcm::DataSet::Remove
SizeType Remove(const Tag &tag)
Completely remove a dataelement from the dataset.
Definition gdcmDataSet.h:172
gdcm::DataSet::Print
void Print(std::ostream &os, std::string const &indent="") const
Definition gdcmDataSet.h:79
gdcm::Tag::GetGroup
uint16_t GetGroup() const
Returns the 'Group number' of the given Tag.
Definition gdcmTag.h:55
gdcmDataElement.h
gdcmDataSet.h
gdcmErrorMacro
#define gdcmErrorMacro(msg)
Error this is pretty bad, more than just warning It could mean lost of data, something not handle....
Definition gdcmTrace.h:165
GDCM_EXPORT
#define GDCM_EXPORT
Definition gdcmWin32.h:34
gdcm
Definition gdcmASN1.h:21
gdcm::operator<<
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88