00001
00002
00003
00004
00005
00006
00007
00008 #ifndef COMMODITY_H_
00009 #define COMMODITY_H_
00010
00011 #include "../core/Quantity.h"
00012 #include "Bandwidth.h"
00013 #include "RealLatency.h"
00014
00015 namespace cosi {
00016
00017 class Commodity : public cosi::Quantity {
00018 std::string mSourceName;
00019 std::string mDestName;
00020 int mSourceId;
00021 int mDestId;
00022 Bandwidth mAverageBandwidth;
00023 RealLatency mMaximumLatency ;
00024 public:
00025 Commodity();
00026 virtual ~Commodity();
00027
00028 void Set(Commodity C);
00029 Commodity Get();
00030
00031 void SetValue(std::string SourceName, std::string DestName, int SourceId,
00032 int DestId, Bandwidth AverageBandwidth , RealLatency L );
00033
00034 void SetValue(std::string SourceName, std::string DestName, int SourceId,
00035 int DestId, double AverageBandwidthValue , double Lvalue);
00036
00037 std::string GetSourceName()const ;
00038 std::string GetDestName()const ;
00039 int GetSourceId()const ;
00040 int GetDestId()const ;
00041 Bandwidth GetAverageBandwidth()const ;
00042 RealLatency GetMaximumLatency() const ;
00043 double GetAverageBandwidthValue();
00044 double GetMaximumLatencyValue() ;
00045
00046 bool operator<(const Commodity &pC) const ;
00047
00048 bool operator==(const Commodity &pC)const ;
00049
00050 Commodity operator+(Commodity pC);
00051
00052 friend std::ostream& operator <<(std::ostream &pOs, const Commodity &pC);
00053
00054 static std::string sQuantityName;
00055 static std::string sQuantityType;
00056
00057 };
00058
00059 }
00060
00061 #endif