00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef KVL_T_H
00031 #define KVL_T_H
00032
00033 #include "w_defines.h"
00034
00035
00036
00037
00038
00039
00040
00041 #ifdef __GNUG__
00042 #pragma interface
00043 #endif
00044
00045 #ifndef STID_T_H
00046 #include "stid_t.h"
00047 #endif
00048 #ifndef VEC_T_H
00049 #include "vec_t.h"
00050 #endif
00051
00052
00053
00054
00055
00056
00057 struct kvl_t {
00058 stid_t stid;
00059 w_base_t::uint4_t h;
00060 w_base_t::uint4_t g;
00061
00062 static const cvec_t eof;
00063 static const cvec_t bof;
00064
00065
00066 NORET kvl_t();
00067
00068 NORET kvl_t(stid_t id, const cvec_t& v);
00069
00070 NORET kvl_t(
00071 stid_t _stid,
00072 const cvec_t& v1,
00073 const cvec_t& v2);
00074
00075 NORET ~kvl_t();
00076
00077 NORET kvl_t(const kvl_t& k);
00078
00079 kvl_t& operator=(const kvl_t& k);
00080
00081 kvl_t& set(stid_t s, const cvec_t& v);
00082 kvl_t& set(stid_t s,
00083 const cvec_t& v1,
00084 const cvec_t& v2);
00085 bool operator==(const kvl_t& k) const;
00086 bool operator!=(const kvl_t& k) const;
00087 friend ostream& operator<<(ostream&, const kvl_t& k);
00088 friend istream& operator>>(istream&, kvl_t& k);
00089 };
00090
00091 inline NORET
00092 kvl_t::kvl_t()
00093 : stid(stid_t::null), h(0), g(0)
00094 {
00095 }
00096
00097 inline NORET
00098 kvl_t::kvl_t(stid_t id, const cvec_t& v)
00099 : stid(id)
00100 {
00101
00102 v.calc_kvl(h), v.calc_kvl2(g);
00103 v.calc_kvl(h), v.calc_kvl2(g);
00104 }
00105
00106 inline NORET
00107 kvl_t::kvl_t(stid_t id, const cvec_t& v1, const cvec_t& v2)
00108 : stid(id)
00109 {
00110 v1.calc_kvl(h); v2.calc_kvl(g);
00111 }
00112
00113 inline NORET
00114 kvl_t::~kvl_t()
00115 {
00116 }
00117
00118 inline NORET
00119 kvl_t::kvl_t(const kvl_t& k)
00120 : stid(k.stid), h(k.h), g(k.g)
00121 {
00122 }
00123
00124 inline kvl_t&
00125 kvl_t::operator=(const kvl_t& k)
00126 {
00127 stid = k.stid;
00128 h = k.h, g = k.g;
00129 return *this;
00130 }
00131
00132
00133 inline kvl_t&
00134 kvl_t::set(stid_t s, const cvec_t& v)
00135 {
00136
00137 stid = s, v.calc_kvl(h), v.calc_kvl2(g);
00138 return *this;
00139 }
00140
00141 inline kvl_t&
00142 kvl_t::set(stid_t s, const cvec_t& v1, const cvec_t& v2)
00143 {
00144 stid = s, v1.calc_kvl(h), v2.calc_kvl(g);
00145 return *this;
00146 }
00147
00148 inline bool
00149 kvl_t::operator==(const kvl_t& k) const
00150 {
00151 return h == k.h && g == k.g;
00152 }
00153
00154 inline bool
00155 kvl_t::operator!=(const kvl_t& k) const
00156 {
00157 return ! (*this == k);
00158 }
00159
00160
00161
00162 #endif