GDCM  2.2.0
gdcmCommandDataSet.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program: GDCM (Grassroots DICOM). A DICOM library
00004 
00005   Copyright (c) 2006-2011 Mathieu Malaterre
00006   All rights reserved.
00007   See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
00008 
00009      This software is distributed WITHOUT ANY WARRANTY; without even
00010      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00011      PURPOSE.  See the above copyright notice for more information.
00012 
00013 =========================================================================*/
00014 #ifndef GDCMCOMMANDDATASET_H
00015 #define GDCMCOMMANDDATASET_H
00016 
00017 #include "gdcmDataSet.h"
00018 #include "gdcmDataElement.h"
00019 
00020 namespace gdcm
00021 {
00027 class GDCM_EXPORT CommandDataSet : public DataSet
00028 {
00029 public:
00030   CommandDataSet() {}
00031  ~CommandDataSet() {}
00032 
00033   friend std::ostream &operator<<(std::ostream &_os, const CommandDataSet &_val);
00034 
00035   // FIXME: no virtual function means: duplicate code...
00036   void Insert(const DataElement& de) {
00037     if( de.GetTag().GetGroup() == 0x0000 )
00038       {
00039       InsertDataElement( de );
00040       }
00041     else
00042       {
00043       gdcmErrorMacro( "Cannot add element with group != 0x0000 in the command dataset : " << de );
00044       }
00045   }
00046   void Replace(const DataElement& de) {
00047     Remove(de.GetTag());
00048     Insert(de);
00049   }
00050 
00052   std::istream &Read(std::istream &is);
00053 
00055   std::ostream &Write(std::ostream &os) const;
00056 
00057 protected:
00058 };
00059 //-----------------------------------------------------------------------------
00060 inline std::ostream& operator<<(std::ostream &os, const CommandDataSet &val)
00061 {
00062   val.Print( os );
00063   return os;
00064 }
00065 
00066 } // end namespace gdcm
00067 
00068 #endif //GDCMFILEMETAINFORMATION_H

Generated on Fri Mar 30 2012 12:44:01 for GDCM by doxygen 1.8.0
SourceForge.net Logo