1 /***********************************************************************/
2 /* Open Visualization Data Explorer                                    */
3 /* (C) Copyright IBM Corp. 1989,1999                                   */
4 /* ALL RIGHTS RESERVED                                                 */
5 /* This code licensed under the                                        */
6 /*    "IBM PUBLIC LICENSE - Open Visualization Data Explorer"          */
7 /***********************************************************************/
8 
9 #include <dxconfig.h>
10 #include "../base/defines.h"
11 
12 
13 
14 
15 #ifndef _ActiveItemDictionary_h
16 #define _ActiveItemDictionary_h
17 
18 
19 #include "Dictionary.h"
20 
21 
22 //
23 // Class name definition:
24 //
25 #define ClassActiveItemDictionary	"ActiveItemDictionary"
26 
27 
28 //
29 // ActiveItemDictionary class definition:
30 //
31 class ActiveItemDictionary : public Dictionary
32 {
33     friend class DictionaryIterator;
34 
35   private:
36     //
37     // Private member data:
38     //
39     Symbol active;		// The 'active' item in the Dictionary.
40 
41   protected:
42     //
43     // Protected member data:
44     //
45 
46 
47   public:
48     //
49     // Constructor:
50     //
ActiveItemDictionary()51     ActiveItemDictionary() { active = 0; }
52 
53     //
54     // Destructor:
55     //
~ActiveItemDictionary()56     ~ActiveItemDictionary() {}
57 
setActiveItem(Symbol s)58     void setActiveItem(Symbol s)
59 		{ ASSERT(this->findDefinition(s)); this->active = s;}
getActiveItem()60     Symbol getActiveItem() { return this->active; }
isActive()61     int isActive() { return this->active != 0; }
62 
getActiveDefinition()63     void *getActiveDefinition() { return this->findDefinition(this->active); }
64 
65     //
66     // Returns a pointer to the class name.
67     //
getClassName()68     const char* getClassName()
69     {
70 	return ClassActiveItemDictionary;
71     }
72 };
73 
74 
75 #endif // _ActiveItemDictionary_h
76