server_new/job.h

Go to the documentation of this file.
00001 /* $Id:job.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 __JOB_H
00015 #define __JOB_H
00016 
00017 #include <string>
00018 #include <map>
00019 #include <list>
00020 using namespace std;
00021 
00022 #include "material.h"
00023 
00024 #define loopJobSpecial(r,v) loopSingle((r)->listSpecial(),v,class material,list)
00025 
00026 class job {
00027     string name;
00028     string description;
00029     map<string,class material> special;
00030     int status;
00031 public:
00032     job();
00033 
00034     // Field : name
00035     const string getName() const;
00036     void setName(const string v);
00037 
00038     // Field : description
00039     const string getDescription() const;
00040     void setDescription(const string v);
00041 
00042     // Field : special
00043     class material& getSpecial(const string v);
00044     list<class material>& listSpecial();
00045     void setSpecial(class material &v);
00046     void delSpecial(const string v);
00047     const bool isSpecial(const string v) const;
00048 
00049     // Field : status
00050     const int getStatus() const;
00051     void setStatus(const int v);
00052 
00053     void save(class channel &ch);
00054     void load(class channel &ch);
00055     void xml(ofstream &f, int l=0, int r=0);
00056 };
00057 
00058 // Repository
00059 
00060 #define loopJobs(v) loopMap(job_repo.listJob(),v,class job)
00061 
00062 class jobRepository {
00063     map<string,job> jobs;
00064 public:
00065     class job& getJob(const string v);
00066     void setJob(class job& v);
00067     map<string,class job>& listJob();
00068     void delJob(const string v);
00069     const bool isJob(const string v) const;
00070     multimap<string, sigc::signal<void, class job& > > relations;
00071     bool load(class channel &ch);
00072     void save(class channel &ch);
00073 };
00074 
00075 extern jobRepository job_repo;
00076 
00077 #endif // __JOB_H


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