server/aging.h

Go to the documentation of this file.
00001 /* $Id:aging.h $ */
00002 /*
00003    Copyright (C) 2007 by Jurjen Stellingwerff <jurjen@stwerff.xs4all.nl>
00004    Part of the Moros Project http://moros.sourceforge.net/
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License version 3.
00008    This program is distributed in the hope that it will be useful,
00009    but WITHOUT ANY WARRANTY.
00010 
00011    See the COPYING file for more details.
00012 */
00013 
00014 #ifndef __AGING_H
00015 #define __AGING_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "category.h"
00023 
00024 #define loopAgingCategories(r,v) loopSingle((r)->listCategories(),v,class category,list)
00025 
00026 class aging {
00027     string name;
00028     map<string,class category> categories;
00029     int maxCategories;
00030 public:
00031     aging();
00032 
00033     // Field : name
00034     const string getName() const;
00035     void setName(const string v);
00036 
00037     // Field : categories
00038     class category& getCategories(const string v);
00039     list<class category>& listCategories();
00040     void setCategories(class category &v);
00041     void delCategories(const string v);
00042     const bool isCategories(const string v) const;
00043 
00044     void save(class channel &ch);
00045     void load(class channel &ch);
00046     void xml(ofstream &f, int l=0, int r=0);
00047 };
00048 
00049 // Repository
00050 
00051 #define loopAgings(v) loopMap(aging_repo.listAging(),v,class aging)
00052 
00053 class agingRepository {
00054     map<string,aging> agings;
00055 public:
00056     class aging& getAging(const string v);
00057     void setAging(class aging& v);
00058     map<string,class aging>& listAging();
00059     void delAging(const string v);
00060     const bool isAging(const string v) const;
00061     multimap<string, sigc::signal<void, class aging& > > relations;
00062     bool load(class channel &ch);
00063     void save(class channel &ch);
00064 };
00065 
00066 extern agingRepository aging_repo;
00067 
00068 #endif // __AGING_H


Generated on Tue Jan 1 17:30:00 2008 for server/aging.h Source File by  doxygen   Visit the project page on SourceForge.net Logo