Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

HxTagList.h File Reference

More...

#include "HxStd.h"
#include "HxIoFwd.h"
#include "HxString.h"
#include <list>
#include "HxTagTem.h"

Go to the source code of this file.

Compounds

class  HxTagList
 A list of tags. More...


Functions

std::ostream & operator<< (std::ostream &os, const HxTagList &tags)
template<class ValT> void HxAddTag (HxTagList &tags, HxString name, ValT v)
 Add a tag to the list of tags. More...

template<class ValT> ValT HxGetTag (const HxTagList &tags, HxString name)
 Get a tag from the list of tags. More...

template<class ValT> ValT HxGetTag (const HxTagList &tags, HxString name, ValT defV)
 Get a tag from the list of tags. More...

bool HxTagIsSet (const HxTagList &tags, HxString name)
 Check if tag is set. More...

HxTagListHxMakeTagList ()
 Function to return a reference to a garbage dump taglist. More...


Detailed Description


Function Documentation

template<class ValT>
void HxAddTag HxTagList   tags,
HxString    name,
ValT    v
[inline]
 

Add a tag to the list of tags.

00092 {
00093     typedef HxTagTem<ValT>  Tag;
00094     tags.addTag(new Tag(name, v));
00095 }

template<class ValT>
ValT HxGetTag const HxTagList   tags,
HxString    name
[inline]
 

Get a tag from the list of tags.

00102 {
00103     typedef HxTagTem<ValT>* TagPtr;
00104     TagPtr t = TagPtr(tags.getTag(name));
00105     ValT v;
00106     if (t)
00107         v = t->getValue();
00108     return v;
00109 }

template<class ValT>
ValT HxGetTag const HxTagList   tags,
HxString    name,
ValT    defV
[inline]
 

Get a tag from the list of tags.

If the tag is not set return the specified default value.

00117 {
00118     typedef HxTagTem<ValT>* TagPtr;
00119     TagPtr t = TagPtr(tags.getTag(name));
00120     return t ? t->getValue() : defV;
00121 }

bool HxTagIsSet const HxTagList   tags,
HxString    name
[inline]
 

Check if tag is set.

00127 {
00128     return tags.getTag(name) ? true : false;
00129 }

HxTagList& HxMakeTagList  
 

Function to return a reference to a garbage dump taglist.

ADB 14 Feb 2001

00126 {
00127     static HxTagList tl;
00128     tl.erase();
00129     return tl;
00130 }


Generated on Tue Feb 3 14:18:51 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001