00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _ATTRIBUTEH
00022 #define _ATTRIBUTEH
00023 #include <string>
00024
00025 class Attribute
00026 {
00027 public:
00028 Attribute(const std::string & name,
00029 int type_id,
00030 bool qualified = false,
00031 std::string defaultVal = "",
00032 std::string fixedVal = "",
00033 bool use = false);
00034 Attribute(void);
00035
00036 std::string getName() const;
00037 int getType() const;
00038 bool isRequired() const;
00039 std::string defaultVal()const;
00040 std::string fixedVal()const;
00041 bool isQualified()const ;
00042 Attribute & operator = (const Attribute & a);
00043
00044 private:
00045 std::string attName;
00046 std::string dval, fval;
00047 int attType;
00048 bool bQualified, attUse;
00049
00050 };
00051 #ifdef LOGGING
00052 ostream & operator << (ostream & stream, Attribute & a);
00053 #endif
00054
00055 inline
00056 Attribute::Attribute(const std::string & name,
00057 int type_id,
00058 bool qualified,
00059 std::string defaultVal,
00060 std::string fixedVal,
00061 bool use)
00062 :attName(name),
00063 dval(defaultVal),
00064 fval(fixedVal),
00065 attType(type_id),
00066 bQualified (qualified),
00067 attUse (use)
00068 {
00069 }
00070
00071 inline
00072 Attribute::Attribute(void)
00073 :attType(0),
00074 bQualified (false),
00075 attUse (false)
00076 {
00077 }
00078
00079 inline
00080 std::string
00081 Attribute::getName() const
00082 {
00083 return attName;
00084 }
00085
00086 inline
00087 int
00088 Attribute::getType() const
00089 {
00090 return attType;
00091 }
00092
00093 inline
00094 bool
00095 Attribute::isRequired() const
00096 {
00097 return attUse;
00098 }
00099
00100 inline
00101 std::string
00102 Attribute::defaultVal()const
00103 {
00104 return dval;
00105 }
00106
00107 inline
00108 std::string
00109 Attribute::fixedVal()const
00110 {
00111 return fval;
00112 }
00113
00114 inline
00115 bool
00116 Attribute::isQualified()const
00117 {
00118 return bQualified;
00119 }
00120
00121 inline
00122 Attribute &
00123 Attribute::operator = (const Attribute & a)
00124 {
00125 attName = a.attName;
00126 attType = a.attType;
00127 bQualified = a.isQualified();
00128 dval = a.dval;
00129 fval = a.fval;
00130 attUse = a.attUse;
00131 return *this;
00132 }
00133
00134 #endif