quantities/Commodity.h

Go to the documentation of this file.
00001 //============================================================================
00002 // Author      : Alessandro Pinto <apinto@eecs.berkeley.edu>
00003 //               University of California, Berkeley
00004 //               545 Cory Hall, Berkeley, CA 94720
00005 // Copyright   : See COPYING file that comes with this distribution
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 /*COMMODITY_H_*/

Generated on Sun Sep 7 18:37:43 2008 for COSI by  doxygen 1.5.4
Contact 
©2002-2018 U.C. Regents