Diffpack Documentation


Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Search  

HandleElmDefs.h

Go to the documentation of this file.
00001 
00005 class HandleElmDefs
00006 
00007 {
00008 protected:
00009 
00010   String      elm_tp;
00011   ElementType et_enum;
00012   int         nsd;
00013 
00014   Handle(ElmDef_prm) elm_prm;
00015 
00016 public:
00017 
00018   Handle(ElmDef)     elmdef;
00019 
00020   HandleElmDefs () { detach(); elm_prm = ElmDef_prm ::construct(); }
00021  ~HandleElmDefs () {}
00022 
00023   bool refill (const String& elm_tp, int nsd);
00024   bool refill (const String& elm_tp);
00025   bool refill (const ElementType et_enum, int nsd); 
00026   bool refill (const ElementType et_enum);          
00027 
00028  
00029   
00030 
00031   void rebind (const ElmDef* p) { elmdef.rebind (p); }
00032   void rebind (const ElmDef& p) { elmdef.rebind (p); }
00033   
00034   void detach () {
00035     rebind(NULL); elm_tp="dummy"; et_enum = NO_ELEMENT; nsd = 0; 
00036   }
00037 
00038   bool ok () const                    { return elmdef.ok(); }
00039   bool ok (const char* message) const { return elmdef.ok(message); }
00040 
00041   const ElmDef* operator -> () const { return elmdef.getPtr(); }
00042   const ElmDef& operator () () const { return elmdef.getRef(); }
00043   const ElmDef& operator *  () const { return elmdef.getRef(); }
00044 
00045   const ElmDef* getPtr () const { return elmdef.getPtr(); }
00046   const ElmDef& getRef () const { return elmdef.getRef(); }
00047 
00048   ElmDef* operator -> () { return elmdef.getPtr(); }
00049   ElmDef& operator () () { return elmdef.getRef(); }
00050   ElmDef& operator *  () { return elmdef.getRef(); }
00051 
00052   ElmDef* getPtr () { return elmdef.getPtr(); }
00053   ElmDef& getRef () { return elmdef.getRef(); }
00054 
00055 
00056   void operator= (const HandleElmDefs& h) { 
00057     rebind(h.getRef()); nsd=h.nsd; et_enum=h.et_enum; elm_tp=h.elm_tp; 
00058   }
00059 };
00060 
00061 

Copyright © 2003 inuTech GmbH. All rights reserved.