Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

EnableMgr.H

Go to the documentation of this file.
00001 
00010 #ifndef ENABLEMGR_H
00011 #define ENABLEMGR_H
00012 
00013 #include "EnableObj.H"
00014 
00015 // Gluebase includes
00016 #define OUTSIDE_GLUE_CORE
00017 #include <std/list.H>
00018 #include <std/strings.H>
00019 
00020 
00021 class ENABLEMGR
00022 {
00023  public:
00024 
00025   static void addEnableObj(EnableObj *o) { 
00026     if (!_objs.contains(o))
00027       _objs += o;
00028   }
00029 
00030   static void removeEnableObj(EnableObj *o) {
00031     _objs -= o;
00032   }
00033 
00034 
00035   // returns false if the interactor has not been added to the mgr
00036 
00037   static bool getEnabled(str_ptr eObjName) {
00038     for (int i=0;i<_objs.num();i++) {
00039       if (_objs[i]->name() == eObjName) {
00040     return getEnabled(_objs[i]);
00041       }
00042     }
00043     return false;
00044   }
00045 
00046   static bool getEnabled(EnableObj *o) {
00047     if (_objs.contains(o))
00048       return _objs[_objs.get_index(o)]->enabled();
00049     else
00050       return false;
00051   }
00052   
00053   static void setEnabled(str_ptr eObjName, bool enabled) {
00054     for (int i=0;i<_objs.num();i++) {
00055       if (_objs[i]->name() == eObjName) {
00056     setEnabled(_objs[i],enabled);
00057       }
00058     }
00059   }
00060 
00061   static void setEnabled(EnableObj *o, bool enabled) {
00062     if (_objs.contains(o))
00063       _objs[_objs.get_index(o)]->setEnabled(enabled);
00064   }
00065 
00066   
00067   
00068  protected:
00069 
00070   static ARRAY<EnableObj*> _objs;
00071 
00072 };
00073 
00074 
00075 #endif

Generated on Mon Sep 15 16:27:55 2003 for inspace by doxygen1.2.18