core/Quantity.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 
00009 #ifndef QUANTITY_H_
00010 #define QUANTITY_H_
00011 
00012 #include <iostream>
00013 #include <string>
00014 
00015 namespace cosi {
00016 
00036 class Quantity {
00038         bool mAny;
00040         bool mBot;
00043         bool mOrdered;
00044 public:
00050         Quantity();
00052         virtual ~Quantity();
00054         bool IsAny() const;
00056         void IsAny(bool pAny);
00058         bool IsBot() const;
00060         void IsBot(bool pBot);
00062         bool IsOrdered() const ;
00065         void IsOrdered(bool pOrdered);
00066 
00067 
00068 };
00069 
00070 
00085 class RealQuantity : public Quantity {
00086 protected:
00087         double mValue;
00088 public:
00089         RealQuantity();
00090         RealQuantity(double pValue);
00091         static std::string QuantityType();
00092         RealQuantity Get() ;
00093         void Set(RealQuantity pValue) ;
00094         double GetValue() const;
00095         void SetValue(double pValue);
00096         friend std::ostream& operator<<(std::ostream &pOs , const RealQuantity &pL) ;
00097 
00098         static std::string sQuantityType;
00099         static std::string sQuantityName;
00100 };
00101 
00102 
00103 
00104 class IntQuantity : public Quantity {
00105 protected:
00106         int mValue;
00107 public:
00108         IntQuantity();
00109         IntQuantity(int pValue);
00110         static std::string QuantityType();
00111         int GetValue() const;
00112         void SetValue(int pValue);
00113         static std::string sQuantityType;
00114 };
00115 
00116 
00117 
00118 class StringQuantity : public Quantity {
00119 protected:
00120         std::string mValue;
00121 public:
00122         StringQuantity();
00123         StringQuantity(std::string pValue);
00124         static std::string QuantityType();
00125         std::string GetValue() const;
00126         void SetValue(std::string pValue);
00127         static std::string sQuantityType;
00128 };
00129 
00130 
00131 
00132 }
00133 #endif /*QUANTITY_H_*/

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