From da9f37e292c9f490e0c0e9b467114d5df70a9a53 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 15 Aug 2012 11:46:00 +0200 Subject: Add support for member accessors/modifiers New pragmas: get, set, access. New test: common/access. --- common/polymorphism/test.hxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'common/polymorphism/test.hxx') diff --git a/common/polymorphism/test.hxx b/common/polymorphism/test.hxx index d0a6ed5..9994fdd 100644 --- a/common/polymorphism/test.hxx +++ b/common/polymorphism/test.hxx @@ -984,7 +984,7 @@ namespace test11 }; } -// Test polymorphic classes with auto id. +// Test polymorphic classes with private auto id. // #pragma db namespace table("t12_") namespace test12 @@ -994,17 +994,20 @@ namespace test12 { virtual ~root () = 0; // Auto-abstract. - #pragma db id auto - unsigned long id; - virtual bool compare (const root& r, bool tc = true) const { if (tc && typeid (r) != typeid (root)) return false; - return id == r.id; + return id_ == r.id_; } + + unsigned long id () const {return id_;} + void id (unsigned long id) {id_ = id;} + private: + #pragma db id auto access(id) + unsigned long id_; }; inline root:: -- cgit v1.1