Go to the documentation of this file.00001
00021 #ifndef TASK_RESOURCE_FILE_H
00022 #define TASK_RESOURCE_FILE_H
00023
00024 #include <string>
00025 #include "device.h"
00026
00027 class TaskResourceFile {
00028
00029 protected:
00030
00031 static double STATIC_RESOURCES_MARGIN;
00032
00033 string name;
00034 string deviceID;
00035 DeviceClass deviceClass;
00036 Device *device;
00037 map<RBType, int> physicalResources;
00038 map<RBType, int> staticResources;
00039
00040 double resourceMargin;
00041
00042
00043 public:
00044
00045 TaskResourceFile(std::string n) : name(n), deviceID("undef"), deviceClass(UNDEF), resourceMargin(-1) {}
00046 TaskResourceFile() {}
00047
00048 TaskResourceFile(const TaskResourceFile& other) {
00049 name = other.name;
00050 deviceID = other.deviceID;
00051 deviceClass = other.deviceClass;
00052 device = new Device();
00053 physicalResources = other.physicalResources;
00054 staticResources = other.staticResources;
00055 resourceMargin = other.resourceMargin;
00056 }
00057
00058
00059 string getName(void);
00060 string getDeviceID(void);
00061 DeviceClass getDeviceClass(void);
00062 Device* getDevicePtr(void);
00063 map<RBType, int> getPhysicalResources(void);
00064 map<RBType, int> getStaticResources(void);
00065
00066
00067 static double getStaticResourceMargin(void);
00068 static void setStaticResourcesMargin(double);
00069 void setResourcesMargin(double);
00070
00071
00072 void info(void);
00073
00074
00075 virtual int readResourceFile(void) = 0;
00076
00077 protected:
00078 void setDeviceID(string dev);
00079 void inferDeviceClass(void);
00080
00081 void convertResourceMap(map<RBType, int>&);
00082 void convertAllResourceMaps(void);
00083 };
00084
00085 #endif