BaseBattery.h

00001 #ifndef BASE_BATTERY_H
00002 #define BASE_BATTERY_H
00003 
00004 #include <omnetpp.h>
00005 #include "BaseModule.h"
00006 
00022 class DrawAmount {
00023 public:
00025   enum PowerType {
00026     CURRENT,  
00027     ENERGY    
00028   };
00029 
00030 protected:
00032   int type;
00033 
00035   double value;
00036 
00037 public:
00039   DrawAmount(int type = CURRENT, double value = 0):
00040     type(type),
00041     value(value)
00042   {}
00043 
00045   virtual int getType() { return type; }
00047   virtual double getValue() { return value; }
00048 
00050   virtual void setType(int t) { type = t; }
00052   virtual void setValue(double v) { value = v; }
00053 };
00054 
00064 class BaseBattery : public BaseModule {
00065 public:
00077   virtual int registerDevice(const std::string& name, int numAccounts) = 0;
00078 
00090   virtual void draw(int drainID, DrawAmount& amount, int account) = 0;
00091 
00101   virtual double getVoltage() = 0;
00105   virtual double estimateResidualRelative() = 0;
00107   virtual double estimateResidualAbs() = 0;
00109 };
00110 
00111 
00112 
00113 #endif
00114