GDCM 2.2.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files
- Examples

- File List
- File Members

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() {}
31 ~CommandDataSet() {}
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