Public Types | Public Member Functions | Private Attributes

creaImageIO::tree::LevelDescriptor Class Reference
[Attributed tree management]

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

#include <creaImageIOTreeLevelDescriptor.h>

List of all members.

Public Types

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

Public Member Functions

 LevelDescriptor (const std::string &name)
 Ctor with name.
 ~LevelDescriptor ()
 Destructor.
const std::string & GetName () const
 Returns the name of the level.
unsigned int GetNumberOfAttributes () const
 Returns the number of attributes of the level.
void Add (const AttributeDescriptor &)
 Adds the AttributeDescriptor to the list.
const AttributeDescriptorListTypeGetAttributeDescriptorList (int type=0) const
 type = 1 without ID and PATIENT_ID
void CopyAttributeDescriptorList ()
 Copy the original list of attributes.
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.
std::vector< std::string > mLabelList
 The list of attributes with flag LABEL set.

Detailed Description

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

Definition at line 17 of file creaImageIOTreeLevelDescriptor.h.


Member Typedef Documentation

The type of attribute container.

Definition at line 36 of file creaImageIOTreeLevelDescriptor.h.


Constructor & Destructor Documentation

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

Ctor with name.

Definition at line 21 of file creaImageIOTreeLevelDescriptor.h.

: mName(name) {}

creaImageIO::tree::LevelDescriptor::~LevelDescriptor (  )  [inline]

Destructor.

Definition at line 23 of file creaImageIOTreeLevelDescriptor.h.

{} 


Member Function Documentation

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

Adds the AttributeDescriptor to the list.

Definition at line 10 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.

    {
      GimmickMessage(5,"Adding Attribute Descriptor '"<<a.GetKey()
                     <<"' to LevelDescriptor"
                     <<std::endl);
      mAttributeDescriptorList.push_back(a);
      if ( a.GetFlags() & AttributeDescriptor::IDENTIFIER )
        {
          GimmickMessage(6,"Is an IDENTIFIER"<<std::endl);
          mIdentifierList.push_back(a.GetKey());
        }
      if ( a.GetFlags() & AttributeDescriptor::LABEL )
        {
          GimmickMessage(6,"Is a LABEL"<<std::endl);
          mLabelList.push_back(a.GetKey());
        }
    }

Here is the call graph for this function:

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

Copy the original list of attributes.

Definition at line 29 of file creaImageIOTreeLevelDescriptor.cpp.

References mAttributeDescriptorList, and mAttributeDescriptorListWID.

      { 
                  mAttributeDescriptorListWID = mAttributeDescriptorList; 
                  for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
                          it != mAttributeDescriptorListWID.end(); it++)
                  {
                          if((*it).GetKey() == "ID")
                          {
                                        mAttributeDescriptorListWID.erase(it);
                                        break;
                          }
                  }

                  for(AttributeDescriptorListType::iterator it = mAttributeDescriptorListWID.begin();
                          it != mAttributeDescriptorListWID.end(); it++)
                  {
                          if((*it).GetKey() == "PARENT_ID")
                          {
                                        mAttributeDescriptorListWID.erase(it);
                                        break;
                          }
                  }
         }

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 41 of file creaImageIOTreeLevelDescriptor.h.

References mAttributeDescriptorList, and mAttributeDescriptorListWID.

      { if (type == 0)
                  return mAttributeDescriptorList; 
                else 
                        return mAttributeDescriptorListWID;
          }

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

Definition at line 52 of file creaImageIOTreeLevelDescriptor.h.

References mIdentifierList.

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

      { 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 55 of file creaImageIOTreeLevelDescriptor.h.

References mLabelList.

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

      { return mLabelList; }

Here is the caller graph for this function:

const std::string& creaImageIO::tree::LevelDescriptor::GetName (  )  const [inline]
unsigned int creaImageIO::tree::LevelDescriptor::GetNumberOfAttributes (  )  const [inline]

Returns the number of attributes of the level.

Definition at line 29 of file creaImageIOTreeLevelDescriptor.h.

References mAttributeDescriptorList.

      { return mAttributeDescriptorList.size(); }


Member Data Documentation

std::vector<std::string> creaImageIO::tree::LevelDescriptor::mIdentifierList [private]

The list of attributes with flag IDENTIFIER set.

Definition at line 65 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 67 of file creaImageIOTreeLevelDescriptor.h.

Referenced by Add(), and GetLabelList().

Definition at line 59 of file creaImageIOTreeLevelDescriptor.h.

Referenced by GetName().


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