ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
Child.h
Go to the documentation of this file.
00001 
00008 using namespace std;
00009 
00010 #ifndef NULL //!<Define if undefined.
00011 #define NULL 0
00012 #endif
00013 
00014 #ifndef CHILD_H
00015 #define CHILD_H //!<Inclusion guard.
00016 template <class T>
00021 class Child
00022 {
00023  public:
00024   Child(T * toSet)
00025     {
00026       myT = toSet;
00027       if(myT!=NULL)
00028         myT->addChild(this);
00029     } 
00030 
00031   ~Child()
00032     {
00033       if(myT!=NULL)
00034         myT->removeChild(this);
00035       myT=NULL;
00036     } 
00037 
00038   virtual T * getChildAddable() const
00039   {
00040     return myT;
00041   } 
00042   
00043   void parentDestroyed()
00044   {
00045     myT = NULL;
00046   } 
00047 
00048   bool operator== (const T& rhs) const
00049   {
00050     if((myT!=NULL) && rhs.myT==NULL)
00051       return false;
00052     if((myT==NULL) && rhs.myT!=NULL)
00053       return false;
00054     if(myT==NULL && rhs.myT==NULL)
00055       return true;
00056     if(myT!=NULL && rhs.myT!=NULL)
00057       return *myT==*(rhs.myT);
00058   } 
00059   
00060  private:
00061   T * myT; 
00062 };
00063 #endif
 All Classes Files Functions Variables Enumerations Enumerator Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark