JobCleaner Class Reference

#include <JobCleaner.h>

List of all members.

Classes

struct  Cleaner

Public Member Functions

 ~JobCleaner ()
void Add (JobC *j)
void Remove (JobC *j)
void Reap ()

Static Public Member Functions

static JobCleanerInstance ()

Private Member Functions

 JobCleaner ()

Private Attributes

std::vector< JobC * > fJobCList

Static Private Attributes

static JobCleanerfInstance = 0

Friends

struct Cleaner

Detailed Description

Definition at line 21 of file JobCleaner.h.


Constructor & Destructor Documentation

JobCleaner::~JobCleaner (  ) 

Definition at line 15 of file JobCleaner.cxx.

References Reap().

00015 { this->Reap(); }

JobCleaner::JobCleaner (  )  [private]

Definition at line 63 of file JobCleaner.cxx.

Referenced by Instance().

00063 { }


Member Function Documentation

void JobCleaner::Add ( JobC j  ) 

Definition at line 19 of file JobCleaner.cxx.

References fJobCList.

Referenced by JobC::JobC().

00019 { fJobCList.push_back(j); }

JobCleaner & JobCleaner::Instance (  )  [static]

Definition at line 51 of file JobCleaner.cxx.

References JobCleaner::Cleaner::ClassIsUsed(), fInstance, and JobCleaner().

Referenced by JobC::JobC(), and JobC::~JobC().

00052 {
00053   if (fInstance) return *fInstance;
00054 
00055   static JobCleaner::Cleaner c;
00056   c.ClassIsUsed();
00057   fInstance = new JobCleaner();
00058   return *fInstance;
00059 }

void JobCleaner::Reap (  ) 

Definition at line 38 of file JobCleaner.cxx.

References fJobCList.

Referenced by ~JobCleaner().

00038                       {
00039   std::vector<JobC*>::iterator itr(fJobCList.begin());
00040   std::vector<JobC*>::iterator itrEnd(fJobCList.end());
00041   for (; itr!=itrEnd; ++itr) {
00042     if (*itr) {
00043       delete *itr;
00044       *itr = 0;
00045     }
00046   }
00047 }

void JobCleaner::Remove ( JobC j  ) 

Definition at line 23 of file JobCleaner.cxx.

References fJobCList.

Referenced by JobC::~JobC().

00024 {
00025   // Remove the JobC object from the list of managed objects
00026   std::vector<JobC*>::iterator itr(fJobCList.begin());
00027   std::vector<JobC*>::iterator itrEnd(fJobCList.end());
00028   for (; itr!=itrEnd; ++itr) {
00029     if (*itr == j) {
00030       *itr = 0;
00031       return;
00032     }
00033   }
00034 }


Friends And Related Function Documentation

friend struct Cleaner [friend]

Definition at line 41 of file JobCleaner.h.


Member Data Documentation

JobCleaner * JobCleaner::fInstance = 0 [static, private]

Definition at line 46 of file JobCleaner.h.

Referenced by Instance(), and JobCleaner::Cleaner::~Cleaner().

std::vector<JobC*> JobCleaner::fJobCList [private]

Definition at line 47 of file JobCleaner.h.

Referenced by Add(), Reap(), and Remove().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1