Program: gdcm
Module: $RCSfile: gdcmTagKey.h,v $
Language: C++
- Date: $Date: 2005/10/26 15:34:33 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2007/08/22 16:14:05 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
=========================================================================*/
-#ifndef GDCMTAGKEY_H
-#define GDCMTAGKEY_H
+#ifndef _GDCMTAGKEY_H_
+#define _GDCMTAGKEY_H_
#include "gdcmCommon.h"
#include <iomanip> // for std::ios::left, ...
#include <stdio.h> // for ugly sprintf
-namespace gdcm
+namespace GDCM_NAME_SPACE
{
//-----------------------------------------------------------------------------
class TagKey
{
public :
- TagKey(const uint16_t &gr, const uint16_t &elt) { tag[0] = gr;tag[1] = elt;}
+ TagKey(uint16_t group, uint16_t elem) { tag[0] = group;tag[1] = elem;}
TagKey() { tag[0] = tag[1] = 0x0000;}
friend std::ostream& operator<<(std::ostream& _os, const TagKey &_val);
sprintf(res,"%04x|%04x",tag[0],tag[1]);
return std::string(res);
}
-
- void SetGroup(const uint16_t &group) { tag[0] = group; }
- uint16_t &GetGroup(void) { return tag[0]; } const
-
- void SetElement(const uint16_t &elem) { tag[1] = elem; }
- uint16_t GetElement(void) { return tag[1]; } const
-
+ ///\brief sets the Group Number for the TagKey
+ void SetGroup(uint16_t group) { tag[0] = group; }
+ uint16_t GetGroup() const { return tag[0]; }
+
+ ///\brief sets the Element Number for the TagKey
+ void SetElement(uint16_t elem) { tag[1] = elem; }
+ uint16_t GetElement() const { return tag[1]; }
+
+ ///\brief sets the Group Number and Element Number for the TagKey
+ void SetGroupElem(uint16_t group, uint16_t elem)
+ { tag[0] = group;tag[1] = elem; }
+
TagKey &operator=(const TagKey &_val)
{
tag[0] = _val.tag[0];
}
TagKey(const TagKey &_val)
- {
+ {
tag[0] = _val[0];
tag[1] = _val[1];
- }
+ }
- uint16_t &operator[](const unsigned int &_id) const
+ const uint16_t &operator[](const unsigned int &_id) const
{
assert(_id<2);
return tag[_id];
}
- uint16_t &operator[](const unsigned int &_id)
+ const uint16_t &operator[](const unsigned int &_id)
{
assert(_id<2);
return tag[_id];