MeVisLab Toolbox Reference
DCMTree::TagId Class Reference

Class to wrap a tag ID. More...

#include <DCMTree_TagId.h>

Inheritance diagram for DCMTree::TagId:
DCMTree_Serialization::Serializable DCMTree_Serialization::Deserializable

Public Member Functions

 TagId ()
 Constructor - sets the ID to (0000,0000)
More...
 
 TagId (RawTagId rawid)
 Constructor - initialize to the given value. More...
 
 TagId (const TagId &other)
 Copy Constructor. More...
 
 TagId (unsigned short groupid, unsigned short elementid)
 Constructor that creates a new instance with ID (groupid,elementid) More...
 
 TagId (std::string tidstr)
 Constructor that creates a new instance by conversion from the given string. More...
 
 ~TagId () override
 Destructor. More...
 
TagIdoperator= (const TagId &other)
 Assignment operator (used by copy-ctor). More...
 
bool operator== (const TagId &other) const
 is-equal operator More...
 
bool operator!= (const TagId &other) const
 is-not-equal operator More...
 
bool operator> (const TagId &other) const
 is-bigger-than operator More...
 
bool operator< (const TagId &other) const
 is-less-than operator More...
 
bool operator>= (const TagId &other) const
 if-bigger-than-or-equal operator More...
 
bool operator<= (const TagId &other) const
 if-smaller-than-or-equal operator More...
 
 operator RawTagId () const
 Returns access to the raw ID using auto-conversion. More...
 
 operator RawTagId & ()
 Returns access to the raw ID using auto-conversion. More...
 
unsigned short groupId () const
 Returns the upper word of the ID -> group-identifier. More...
 
unsigned short elementId () const
 Returns the lower word of the ID -> element-identifier. More...
 
bool isPrivate () const
 Checks whether this ID identifies a private tag (groupid is odd) More...
 
bool isPrivateCreator () const
 Checks whether this ID identifies a private creator tag. More...
 
RawTagId privateTag (unsigned short slot) const
 Returns the tag ID of the corresponding private tag with the given slot. More...
 
RawTagId rawId () const
 Returns the raw value . More...
 
RawTagIdrawId ()
 Returns the raw value. More...
 
std::string toString () const
 Converts this to a string of the form (groupid, elementid). More...
 
void fromStream (std::istream &in)
 Extracts this instance from the given stream. More...
 
void toStream (std::ostream &out) const
 Copies this instance recursively into the given stream. More...
 
void serializeX (DCMTree_Serialization::Sink &sink) const override
 Writes data of this object to sink. More...
 
void deserializeX (DCMTree_Serialization::Source &source) override
 Overwrites data of this object with data from source. More...
 
- Public Member Functions inherited from DCMTree_Serialization::Serializable
virtual ~Serializable ()
 Empty. More...
 
- Public Member Functions inherited from DCMTree_Serialization::Deserializable
virtual ~Deserializable ()
 Empty. More...
 

Static Public Member Functions

static TagIdPtr create (RawTagId rawid)
 
static TagIdPtr create (const TagId &other)
 
static TagIdPtr create (unsigned short groupid, unsigned short elementid)
 
static TagIdPtr create (std::string tidstr)
 
static bool isPrivateTag (RawTagId id)
 Returns true if the given tag ID belongs to a private tag. More...
 

Detailed Description

Class to wrap a tag ID.

Definition at line 39 of file DCMTree_TagId.h.

Constructor & Destructor Documentation

◆ TagId() [1/5]

DCMTree::TagId::TagId ( )

Constructor - sets the ID to (0000,0000)

◆ TagId() [2/5]

DCMTree::TagId::TagId ( RawTagId  rawid)

Constructor - initialize to the given value.

◆ TagId() [3/5]

DCMTree::TagId::TagId ( const TagId other)

Copy Constructor.

◆ TagId() [4/5]

DCMTree::TagId::TagId ( unsigned short  groupid,
unsigned short  elementid 
)

Constructor that creates a new instance with ID (groupid,elementid)

◆ TagId() [5/5]

DCMTree::TagId::TagId ( std::string  tidstr)

Constructor that creates a new instance by conversion from the given string.

Accepts string of the form t*H*t*,t*H*t* t* : any number of non , and non digits (a-f,A-F,0-9) H* : any number of digits (a-f,A-F,0-9)

◆ ~TagId()

DCMTree::TagId::~TagId ( )
override

Destructor.

Member Function Documentation

◆ create() [1/4]

static TagIdPtr DCMTree::TagId::create ( const TagId other)
static

◆ create() [2/4]

static TagIdPtr DCMTree::TagId::create ( RawTagId  rawid)
static

◆ create() [3/4]

static TagIdPtr DCMTree::TagId::create ( std::string  tidstr)
static

◆ create() [4/4]

static TagIdPtr DCMTree::TagId::create ( unsigned short  groupid,
unsigned short  elementid 
)
static

◆ deserializeX()

void DCMTree::TagId::deserializeX ( DCMTree_Serialization::Source source)
overridevirtual

Overwrites data of this object with data from source.

All the rules stated for SCR::Serializable::serializeX apply correspondingly.

See also
SCR::Serializable::serializeX

Implements DCMTree_Serialization::Deserializable.

◆ elementId()

unsigned short DCMTree::TagId::elementId ( ) const

Returns the lower word of the ID -> element-identifier.

◆ fromStream()

void DCMTree::TagId::fromStream ( std::istream &  in)

Extracts this instance from the given stream.

Referenced by DCMTree::operator>>().

◆ groupId()

unsigned short DCMTree::TagId::groupId ( ) const

Returns the upper word of the ID -> group-identifier.

◆ isPrivate()

bool DCMTree::TagId::isPrivate ( ) const

Checks whether this ID identifies a private tag (groupid is odd)

◆ isPrivateCreator()

bool DCMTree::TagId::isPrivateCreator ( ) const

Checks whether this ID identifies a private creator tag.

◆ isPrivateTag()

bool DCMTree::TagId::isPrivateTag ( RawTagId  id)
inlinestatic

Returns true if the given tag ID belongs to a private tag.

Definition at line 147 of file DCMTree_TagId.h.

◆ operator RawTagId()

DCMTree::TagId::operator RawTagId ( ) const

Returns access to the raw ID using auto-conversion.

◆ operator RawTagId &()

DCMTree::TagId::operator RawTagId & ( )

Returns access to the raw ID using auto-conversion.

◆ operator!=()

bool DCMTree::TagId::operator!= ( const TagId other) const

is-not-equal operator

◆ operator<()

bool DCMTree::TagId::operator< ( const TagId other) const

is-less-than operator

◆ operator<=()

bool DCMTree::TagId::operator<= ( const TagId other) const

if-smaller-than-or-equal operator

◆ operator=()

TagId& DCMTree::TagId::operator= ( const TagId other)

Assignment operator (used by copy-ctor).

◆ operator==()

bool DCMTree::TagId::operator== ( const TagId other) const

is-equal operator

◆ operator>()

bool DCMTree::TagId::operator> ( const TagId other) const

is-bigger-than operator

◆ operator>=()

bool DCMTree::TagId::operator>= ( const TagId other) const

if-bigger-than-or-equal operator

◆ privateTag()

RawTagId DCMTree::TagId::privateTag ( unsigned short  slot) const

Returns the tag ID of the corresponding private tag with the given slot.

Parameters
slotThe slot of the private tag, e.g., the element ID of the corresponding private creator tag.

◆ rawId() [1/2]

RawTagId& DCMTree::TagId::rawId ( )

Returns the raw value.

◆ rawId() [2/2]

RawTagId DCMTree::TagId::rawId ( ) const

Returns the raw value .

◆ serializeX()

void DCMTree::TagId::serializeX ( DCMTree_Serialization::Sink sink) const
overridevirtual

Writes data of this object to sink.

Implementations of Serializable::serializeX should strictly follow this pattern:

class C: public SCR::Serializable { T1 _m1; T2 _m2; T3 _m3; public: void serializeX(SCR::Sink &sink) const { SCR::serializeX(sink, _m1); SCR::serializeX(sink, _m2); SCR::serializeX(sink, _m3); } };

That is, you should call some overloading of SCR::serializeX for every member.

If some of the types T1, T2, T3 are not serializable, you should make them serializable.

See also
SCR

Implements DCMTree_Serialization::Serializable.

◆ toStream()

void DCMTree::TagId::toStream ( std::ostream &  out) const

Copies this instance recursively into the given stream.

Referenced by DCMTree::operator<<().

◆ toString()

std::string DCMTree::TagId::toString ( ) const

Converts this to a string of the form (groupid, elementid).


The documentation for this class was generated from the following file: