gdcmCommandDataSet.h
Go to the documentation of this file.
/*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Copyright (c) 2006-2011 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
#ifndef GDCMCOMMANDDATASET_H
#define GDCMCOMMANDDATASET_H
#include "gdcmDataSet.h"
#include "gdcmDataElement.h"
namespace gdcm
{
class GDCM_EXPORT CommandDataSet : public DataSet
{
public:
CommandDataSet() = default;
~CommandDataSet() = default;
friend std::ostream &operator<<(std::ostream &_os, const CommandDataSet &_val);
// FIXME: no virtual function means: duplicate code...
void Insert(const DataElement& de) {
if( de.GetTag().GetGroup() == 0x0000 )
{
InsertDataElement( de );
}
else
{
gdcmErrorMacro( "Cannot add element with group != 0x0000 in the command dataset : " << de );
}
}
void Replace(const DataElement& de) {
Remove(de.GetTag());
Insert(de);
}
std::istream &Read(std::istream &is);
std::ostream &Write(std::ostream &os) const;
protected:
};
//-----------------------------------------------------------------------------
inline std::ostream& operator<<(std::ostream &os, const CommandDataSet &val)
{
val.Print( os );
return os;
}
} // end namespace gdcm
#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