creaImageIO_lib
creaImageIO::tree::LevelDescriptor Class Reference

Descriptor of a level of a Tree (name, attributes, ...) More...

#include <creaImageIOTreeLevelDescriptor.h>

Public Types

typedef std::vector
< AttributeDescriptor
AttributeDescriptorListType
 The type of attribute container. More...
 

Public Member Functions

 LevelDescriptor (const std::string &name)
 Ctor with name. More...
 
 ~LevelDescriptor ()
 Destructor. More...
 
const std::string & GetName () const
 Returns the name of the level. More...
 
unsigned int GetNumberOfAttributes () const
 Returns the number of attributes of the level. More...
 
void Add (const AttributeDescriptor &)
 Adds the AttributeDescriptor to the list. More...
 
const AttributeDescriptorListTypeGetAttributeDescriptorList (int type=0) const
 type = 1 without ID and PATIENT_ID More...
 
void CopyAttributeDescriptorList ()
 Copy the original list of attributes. More...
 
const std::vector< std::string > & GetIdentifierList () const
 
const std::vector< std::string > & GetLabelList () const
 

Private Attributes

std::string mName
 
AttributeDescriptorListType mAttributeDescriptorList
 
AttributeDescriptorListType mAttributeDescriptorListWID
 
std::vector< std::string > mIdentifierList
 The list of attributes with flag IDENTIFIER set. More...
 
std::vector< std::string > mLabelList
 The list of attributes with flag LABEL set. More...
 

Detailed Description

Descriptor of a level of a Tree (name, attributes, ...)

Definition at line 44 of file creaImageIOTreeLevelDescriptor.h.

Member Typedef Documentation

The type of attribute container.

Definition at line 63 of file creaImageIOTreeLevelDescriptor.h.

Constructor & Destructor Documentation

creaImageIO::tree::LevelDescriptor::LevelDescriptor ( const std::string &  name)
inline

Ctor with name.

Definition at line 48 of file creaImageIOTreeLevelDescriptor.h.

48 : mName(name) {}
creaImageIO::tree::LevelDescriptor::~LevelDescriptor ( )
inline

Destructor.

Definition at line 50 of file creaImageIOTreeLevelDescriptor.h.

50 {}

Member Function Documentation

void creaImageIO::tree::LevelDescriptor::Add ( const AttributeDescriptor a)

Adds the AttributeDescriptor to the list.

Definition at line 37 of file creaImageIOTreeLevelDescriptor.cpp.

References creaImageIO::tree::AttributeDescriptor::GetFlags(), creaImageIO::tree::AttributeDescriptor::GetKey(), GimmickMessage, creaImageIO::tree::AttributeDescriptor::IDENTIFIER, creaImageIO::tree::AttributeDescriptor::LABEL, mAttributeDescriptorList, mIdentifierList, and mLabelList.

38  {
39  GimmickMessage(5,"Adding Attribute Descriptor '"<<a.GetKey()
40  <<"' to LevelDescriptor"
41  <<std::endl);
42  mAttributeDescriptorList.push_back(a);
43  if ( a.GetFlags() & AttributeDescriptor::IDENTIFIER )
44  {
45  GimmickMessage(6,"Is an IDENTIFIER"<<std::endl);
46  mIdentifierList.push_back(a.GetKey());
47  }
48  if ( a.GetFlags() & AttributeDescriptor::LABEL )
49  {
50  GimmickMessage(6,"Is a LABEL"<<std::endl);
51  mLabelList.push_back(a.GetKey());
52  }
53  }

Here is the call graph for this function:

void creaImageIO::tree::LevelDescriptor::CopyAttributeDescriptorList ( )

Copy the original list of attributes.

Definition at line 56 of file creaImageIOTreeLevelDescriptor.cpp.

References mAttributeDescriptorList, and mAttributeDescriptorListWID.

57  {
59  for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
60  it != mAttributeDescriptorListWID.end(); it++)
61  {
62  if((*it).GetKey() == "ID")
63  {
65  break;
66  }
67  }
68 
69  for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
70  it != mAttributeDescriptorListWID.end(); it++)
71  {
72  if((*it).GetKey() == "PARENT_ID")
73  {
75  break;
76  }
77  }
78  }
const AttributeDescriptorListType& creaImageIO::tree::LevelDescriptor::GetAttributeDescriptorList ( int  type = 0) const
inline

type = 1 without ID and PATIENT_ID

Returns the list of AttributeDescriptor (const) type = 0 all attributes

Definition at line 68 of file creaImageIOTreeLevelDescriptor.h.

References mAttributeDescriptorList, and mAttributeDescriptorListWID.

Referenced by creaImageIO::tree::Descriptor::GetAttributeDescriptorList().

69  { if (type == 0)
71  else
73  }

Here is the caller graph for this function:

const std::vector<std::string>& creaImageIO::tree::LevelDescriptor::GetIdentifierList ( ) const
inline
Returns
The list of attributes with flag IDENTIFIER set

Definition at line 79 of file creaImageIOTreeLevelDescriptor.h.

References mIdentifierList.

Referenced by creaImageIO::tree::Node::Matches().

80  { return mIdentifierList; }

Here is the caller graph for this function:

const std::vector<std::string>& creaImageIO::tree::LevelDescriptor::GetLabelList ( ) const
inline
Returns
The list of attributes with flag LABEL set

Definition at line 82 of file creaImageIOTreeLevelDescriptor.h.

References mLabelList.

Referenced by creaImageIO::tree::Node::GetLabel().

83  { return mLabelList; }

Here is the caller graph for this function:

unsigned int creaImageIO::tree::LevelDescriptor::GetNumberOfAttributes ( ) const
inline

Returns the number of attributes of the level.

Definition at line 56 of file creaImageIOTreeLevelDescriptor.h.

References mAttributeDescriptorList.

57  { return (int)mAttributeDescriptorList.size(); }

Member Data Documentation

AttributeDescriptorListType creaImageIO::tree::LevelDescriptor::mAttributeDescriptorList
private
AttributeDescriptorListType creaImageIO::tree::LevelDescriptor::mAttributeDescriptorListWID
private
std::vector<std::string> creaImageIO::tree::LevelDescriptor::mIdentifierList
private

The list of attributes with flag IDENTIFIER set.

Definition at line 92 of file creaImageIOTreeLevelDescriptor.h.

Referenced by Add(), and GetIdentifierList().

std::vector<std::string> creaImageIO::tree::LevelDescriptor::mLabelList
private

The list of attributes with flag LABEL set.

Definition at line 94 of file creaImageIOTreeLevelDescriptor.h.

Referenced by Add(), and GetLabelList().

std::string creaImageIO::tree::LevelDescriptor::mName
private

Definition at line 86 of file creaImageIOTreeLevelDescriptor.h.

Referenced by GetName().


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