00001 #ifndef defineVI_h
00002 #define defineVI_h
00003 00005
00006 <ul>
00007 <li> A derived class of defineVI can check at run-time if it has been already defined or not.
00008 If not, it can execute the \c define() method and define itself.
00009 <li> Lets consider the example of multialgorithms, that used other algorithms.
00010 At compile time maybe some algorithms are not beed defined yet. The class
00011 is therefore not defined at compile time. At run time, when the
00012 \c initialize() (of algorithmVI) method is executed the first time,
00013 the derived class will them execute its \c define() method and define its algorithms.
00014 Setting the \c setDefine() to true, the define() method will not be executed again.
00015 <li> This class is useful to retreive at one, pointers that will keep their address
00016 constant during the live of the class.
00017 </ul>
00018 */
00019
00020
00021
00022
00023 class defineVI
00024
00025 {
00026 protected:
00027
00029 defineVI() {setDefine(false);}
00031 virtual ~defineVI() {};
00032
00034 virtual void define() = 0;
00035
00037 void setDefine(bool t) {m_define = t;}
00039 bool defined() const {return m_define;}
00040
00041 private:
00042
00044 bool m_define;
00045 };
00046 #endif