00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __loaded__ao_tracker_cpp__
00021 #define __loaded__ao_tracker_cpp__
00022 using namespace std;
00023 #line 1 "ao-tracker.c++"
00024 #include "ao-tracker.h"
00025
00026 elementResult ActiveAoTracker::sunset(string s)
00027 {
00028 #ifdef SUNSET_CHECK
00029 cerr << "The sun is setting for " << s << "\n";
00030 #endif
00031 if (alive.find(s)==alive.end())
00032 {
00033 cerr << "sunset for unknown active object in " << (long)(void*)this << '\n';
00034 print();
00035 assert(0);
00036 }
00037 alive.erase(s);
00038 if (alive.empty())
00039 {
00040 #ifdef SUNSET_CHECK
00041 cerr << "No active objects left, deactivating pool\n";
00042 #endif
00043 deactivate();
00044 }
00045 return Done;
00046 }
00047
00048 elementResult ActiveAoTracker::sunrise(string s)
00049 {
00050 #ifdef SUNSET_CHECK
00051 cerr << "The sun is rising for " << s << " in " << (long)(void*)this << "\n";
00052 #endif
00053 if (alive.find(s)!=alive.end())
00054 {
00055 cerr << "Allocating second active object with name " << s
00056 << " in Active Object Tracker\n";
00057 exit(0);
00058 }
00059 alive.insert(s);
00060 return Done;
00061 }
00062
00063 elementResult ActiveAoTracker::print()
00064 {
00065
00066 set<string>::iterator sit=alive.begin();
00067 cerr << "Active Objects still alive:\n";
00068 while(sit!=alive.end())
00069 {
00070 cerr << *sit << "\n";
00071 sit++;
00072 }
00073 return Done;
00074 }
00075 #endif // __loaded__ao_tracker_cpp__