GDCM  2.2.6
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 {
28 {
29 public:
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
void Print(std::ostream &os, std::string const &indent="") const
Definition: gdcmDataSet.h:79
Class to represent a Data Set (which contains Data Elements) A Data Set represents an instance of a r...
Definition: gdcmDataSet.h:55
Class to represent a Command DataSet.
Definition: gdcmCommandDataSet.h:27
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
Class to represent a Data Element either Implicit or Explicit.
Definition: gdcmDataElement.h:58
void Insert(const DataElement &de)
Definition: gdcmCommandDataSet.h:36
const Tag & GetTag() const
Get Tag.
Definition: gdcmDataElement.h:67
#define gdcmErrorMacro(msg)
Error this is pretty bad, more than just warning It could mean lost of data, something not handle...
Definition: gdcmTrace.h:163
uint16_t GetGroup() const
Returns the &#39;Group number&#39; of the given Tag.
Definition: gdcmTag.h:55
CommandDataSet()
Definition: gdcmCommandDataSet.h:30
void Replace(const DataElement &de)
Definition: gdcmCommandDataSet.h:46
~CommandDataSet()
Definition: gdcmCommandDataSet.h:31

Generated on Sat Dec 21 2013 05:56:16 for GDCM by doxygen 1.8.5
SourceForge.net Logo