From 011630e0e843958c50fb35a9850abb7ba45ec1d9 Mon Sep 17 00:00:00 2001 From: cxl Date: Sun, 3 Nov 2013 19:28:23 +0000 Subject: [PATCH] Core: Ref changes temporarily reverted git-svn-id: svn://ultimatepp.org/upp/trunk@6524 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Value.h | 2 +- uppsrc/Core/ValueUtil.cpp | 13 ++++--- uppsrc/Core/ValueUtil.h | 68 ++++++++++++++++------------------- uppsrc/Geom/Coords/coords.cpp | 10 +++--- uppsrc/Sql/SqlSchema.h | 2 +- 5 files changed, 44 insertions(+), 51 deletions(-) diff --git a/uppsrc/Core/Value.h b/uppsrc/Core/Value.h index 5088b9f26..6960d73c9 100644 --- a/uppsrc/Core/Value.h +++ b/uppsrc/Core/Value.h @@ -63,7 +63,7 @@ public: bool operator==(const T&) const { NEVER(); return false; } String ToString() const { return typeid(T).name(); } -// operator ValueTypeRef(); + operator ValueTypeRef(); }; template // Backward compatiblity diff --git a/uppsrc/Core/ValueUtil.cpp b/uppsrc/Core/ValueUtil.cpp index afd402609..264944294 100644 --- a/uppsrc/Core/ValueUtil.cpp +++ b/uppsrc/Core/ValueUtil.cpp @@ -6,13 +6,12 @@ static String sAsString(const Vector& v); #define LTIMING(x) // RTIMING(x) -/* struct Ref::ValueRef : public RefManager { - virtual int GetType() const { return VALUE_V; } - virtual Value GetValue(const void *ptr) const { return *(Value *) ptr; } - virtual bool IsNull(const void *ptr) const { return UPP::IsNull(*(Value *) ptr); } - virtual void SetValue(void *ptr, const Value& v) const { *(Value *) ptr = v; } - virtual void SetNull(void *ptr) const { *(Value *) ptr = Null; } + virtual int GetType() { return VALUE_V; } + virtual Value GetValue(const void *ptr) { return *(Value *) ptr; } + virtual bool IsNull(const void *ptr) { return UPP::IsNull(*(Value *) ptr); } + virtual void SetValue(void *ptr, const Value& v) { *(Value *) ptr = v; } + virtual void SetNull(void *ptr) { *(Value *) ptr = Null; } }; Ref::Ref(String& s) { ptr = &s; m = &Single< StdRef >(); } @@ -24,7 +23,7 @@ Ref::Ref(bool& b) { ptr = &b; m = &Single< StdRef >(); } Ref::Ref(Date& d) { ptr = &d; m = &Single< StdRef >(); } Ref::Ref(Time& t) { ptr = &t; m = &Single< StdRef