]> Creatis software - creaImageIO.git/blob - src2/creaImageIOTreeLevelDescriptor.h
f9470346f62a4dd2bfc65b009a4cc021de528528
[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() const { return mName; }
27
28       /// Returns the number of attributes of the level
29       unsigned int GetNumberOfAttributes() const
30       { return mAttributeDescriptorList.size(); }
31
32       /// Adds the AttributeDescriptor to the list
33       void Add(const AttributeDescriptor&);
34
35           /// The type of attribute container
36       typedef std::vector<AttributeDescriptor> AttributeDescriptorListType;
37  
38       /// Returns the list of AttributeDescriptor (const)
39       const AttributeDescriptorListType& GetAttributeDescriptorList() const 
40       { return mAttributeDescriptorList; }
41
42       /// \return The list of attributes with flag IDENTIFIER set
43       const std::vector<std::string>& GetIdentifierList() const 
44       { return mIdentifierList; }
45       /// \return The list of attributes with flag LABEL set
46       const std::vector<std::string>& GetLabelList() const 
47       { return mLabelList; }
48
49     private:
50       std::string mName;
51       AttributeDescriptorListType mAttributeDescriptorList;
52       /// The list of attributes with flag IDENTIFIER set
53       std::vector<std::string> mIdentifierList;
54       /// The list of attributes with flag LABEL set
55       std::vector<std::string> mLabelList;
56
57     };
58     // EO class LevelDescriptor
59     //=====================================================================
60   }// EO namespace tree
61   
62
63 } // EO namespace creaImageIO
64
65 // EOF
66 #endif