aboutsummaryrefslogtreecommitdiff
path: root/common/polymorphism/test.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-08-15 11:46:00 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-08-15 11:46:00 +0200
commitda9f37e292c9f490e0c0e9b467114d5df70a9a53 (patch)
tree5144d8fb71bd4cf910956dcecb7a50060f909771 /common/polymorphism/test.hxx
parentae6dd84a3b61063a595efb2cd02eff01b0185546 (diff)
Add support for member accessors/modifiers
New pragmas: get, set, access. New test: common/access.
Diffstat (limited to 'common/polymorphism/test.hxx')
-rw-r--r--common/polymorphism/test.hxx13
1 files changed, 8 insertions, 5 deletions
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::