1 #ifndef _Gen_VTypes_h_
2 #define _Gen_VTypes_h_
3 
4 #include <Core/Core.h>
5 #include <CtrlCore/CtrlCore.h>
6 
7 NAMESPACE_UPP
8 
9 const dword LOGPOS_V    = 97;
ValueTypeNo(const Ctrl::LogPos *)10 template<> inline dword ValueTypeNo(const Ctrl::LogPos*)    { return LOGPOS_V; }
11 
IsNull(const Ctrl::LogPos & l)12 template<> inline bool IsNull(const Ctrl::LogPos& l) { return l.x.IsEmpty() || l.y.IsEmpty(); }
SetNull(Ctrl::LogPos & l)13 template<> inline void SetNull(Ctrl::LogPos& l) { l.x = l.y = Ctrl::Logc(); }
14 
Nvl(Ctrl::LogPos a,Ctrl::LogPos b)15 inline Ctrl::LogPos   Nvl(Ctrl::LogPos a, Ctrl::LogPos b)             { return IsNull(a) ? b : a; }
Nvl(Ctrl::LogPos a)16 inline Ctrl::LogPos   Nvl(Ctrl::LogPos a)                             { return Nvl(a, Ctrl::LogPos()); }
17 
ValueGetHashValue(const Ctrl::LogPos & l)18 template<> inline unsigned ValueGetHashValue(const Ctrl::LogPos& l) {
19 	CombineHash ch;
20 	ch << l.x.GetAlign() << l.x.GetA() << l.x.GetB();
21 	ch << l.y.GetAlign() << l.y.GetA() << l.y.GetB();
22 	return ch;
23 }
24 
25 inline bool operator==(const Value& v, const Ctrl::LogPos& x)   { return RichValue<Ctrl::LogPos>::Extract(v) == x; }
26 inline bool operator==(const Ctrl::LogPos& x, const Value& v)   { return RichValue<Ctrl::LogPos>::Extract(v) == x; }
27 inline bool operator!=(const Value& v, const Ctrl::LogPos& x)   { return RichValue<Ctrl::LogPos>::Extract(v) != x; }
28 inline bool operator!=(const Ctrl::LogPos& x, const Value& v)   { return RichValue<Ctrl::LogPos>::Extract(v) != x; }
29 
SgnCompare(const Ctrl::LogPos &,const Ctrl::LogPos &)30 inline int  SgnCompare(const Ctrl::LogPos&, const Ctrl::LogPos&)  { return 0; }
31 
PolyCompare(const Ctrl::LogPos &,const Value &)32 template<> inline int  PolyCompare(const Ctrl::LogPos&, const Value&) { return 0; }
33 
34 template<> String AsString(const Ctrl::LogPos& pos);
35 
36 template<> Stream& operator%(Stream& s, Ctrl::LogPos& pos);
37 template<> void Xmlize(XmlIO& xml, Ctrl::LogPos& pos);
38 template<> void Jsonize(JsonIO& jio, Ctrl::LogPos& pos);
39 
40 END_UPP_NAMESPACE
41 
42 #endif
43