GDCM 3.0.24
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
20namespace gdcm
21{
28{
29public:
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
57protected:
58};
59//-----------------------------------------------------------------------------
60inline 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
Class to represent a Command DataSet.
Definition gdcmCommandDataSet.h:28
std::ostream & Write(std::ostream &os) const
Write.
void Insert(const DataElement &de)
Definition gdcmCommandDataSet.h:36
std::istream & Read(std::istream &is)
Read.
void Replace(const DataElement &de)
Definition gdcmCommandDataSet.h:46
~CommandDataSet()=default
CommandDataSet()=default
Class to represent a Data Element either Implicit or Explicit.
Definition gdcmDataElement.h:59
const Tag & GetTag() const
Get Tag.
Definition gdcmDataElement.h:67
Class to represent a Data Set (which contains Data Elements)
Definition gdcmDataSet.h:56
void Print(std::ostream &os, std::string const &indent="") const
Definition gdcmDataSet.h:79
uint16_t GetGroup() const
Returns the 'Group number' of the given Tag.
Definition gdcmTag.h:55
#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
#define GDCM_EXPORT
Definition gdcmWin32.h:34
Definition gdcmASN1.h:21
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88