]> Creatis software - creaImageIO.git/blob - src2/creaImageIOTreeLevelDescriptor.h
b73c249d787e577e321e6e29b30993843f04a920
[creaImageIO.git] / src2 / creaImageIOTreeLevelDescriptor.h
1 #ifndef __creaImageIOTreeLevelDescriptor_h_INCLUDED__
2 #define __creaImageIOTreeLevelDescriptor_h_INCLUDED__
3
4 #include <creaImageIOTreeAttributeDescriptor.h>
5 #include <vector>
6
7 namespace creaImageIO
8 {
9
10   namespace tree
11   {
12         /**
13         * \ingroup Tree
14         */
15     //=====================================================================
16     /// Descriptor of a level of a Tree (name, attributes, ...)
17     class LevelDescriptor
18     {
19     public:
20       /// Ctor with name
21       LevelDescriptor(const std::string& name) : mName(name) {}
22       /// Destructor
23       ~LevelDescriptor() {} 
24
25       /// Returns the name of the level
26       const std::string& GetName() { return mName; }
27
28       /// Returns the number of attributes of the level
29       unsigned int GetNumberOfAttributes() 
30       { return mAttributeDescriptorList.size(); }
31
32       /// Adds the AttributeDescriptor to the list
33       /// WARNING : You MUST use this method and NOT push_back directly in list
34       /// ad IdentifierList and LabelList are also updated
35       void Add(AttributeDescriptor);
36
37       /// The type of attribute container
38       typedef std::vector<AttributeDescriptor> AttributeDescriptorListType;
39       /// Returns the list of AttributeDescriptor
40       //AttributeDescriptorListType& GetAttributeDescriptorList() 
41       //{ return mAttributeDescriptorList; }
42       /// Returns the list of AttributeDescriptor (const)
43       const AttributeDescriptorListType& GetAttributeDescriptorList() const 
44       { return mAttributeDescriptorList; }
45
46      /// \return The list of attributes with flag IDENTIFIER set
47      const std::vector<std::string>& GetIdentifierList() const 
48       { return mIdentifierList; }
49       /// \return The list of attributes with flag LABEL set
50       const std::vector<std::string>& GetLabelList() const 
51       { return mLabelList; }
52
53     private:
54       std::string mName;
55       AttributeDescriptorListType mAttributeDescriptorList;
56       /// The list of attributes with flag IDENTIFIER set
57       std::vector<std::string> mIdentifierList;
58       /// The list of attributes with flag LABEL set
59       std::vector<std::string> mLabelList;
60
61     };
62     // EO class LevelDescriptor
63     //=====================================================================
64   }// EO namespace tree
65   
66
67 } // EO namespace creaImageIO
68
69 // EOF
70 #endif