From d8f2d1a627160a47f028ebfb58e8bf1317a36b98 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 13 Jan 2011 11:32:49 +0200 Subject: Cosmetic changes --- container/driver.cxx | 6 +++--- container/person.hxx | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 14 deletions(-) (limited to 'container') diff --git a/container/driver.cxx b/container/driver.cxx index 07b3bd9..109fec0 100644 --- a/container/driver.cxx +++ b/container/driver.cxx @@ -23,7 +23,7 @@ print (const person& p) // Print nicknames. // - for (person::name_list::const_iterator i (p.nicknames ().begin ()); + for (names::const_iterator i (p.nicknames ().begin ()); i != p.nicknames ().end (); ++i) { cout << " nickname: " << *i << endl; @@ -31,7 +31,7 @@ print (const person& p) // Print emails. // - for (person::email_set::const_iterator i (p.emails ().begin ()); + for (emails::const_iterator i (p.emails ().begin ()); i != p.emails ().end (); ++i) { cout << " email: " << *i << endl; @@ -39,7 +39,7 @@ print (const person& p) // Print weights. // - for (person::age_weight_map::const_iterator i (p.age_weight ().begin ()); + for (age_weight_map::const_iterator i (p.age_weight ().begin ()); i != p.age_weight ().end (); ++i) { cout << " weight at " << i->first << ": " << i->second << endl; diff --git a/container/person.hxx b/container/person.hxx index f9160b8..941bfc6 100644 --- a/container/person.hxx +++ b/container/person.hxx @@ -12,6 +12,10 @@ #include +typedef std::vector names; +typedef std::set emails; +typedef std::map age_weight_map; + #pragma db object class person { @@ -35,15 +39,13 @@ public: // Nicknames. // - typedef std::vector name_list; - - const name_list& + const names& nicknames () const { return nicknames_; } - name_list& + names& nicknames () { return nicknames_; @@ -51,15 +53,15 @@ public: // Emails. // - typedef std::set email_set; + typedef ::emails emails_type; - const email_set& + const emails_type& emails () const { return emails_; } - email_set& + emails_type& emails () { return emails_; @@ -67,8 +69,6 @@ public: // Age-to-weight map. // - typedef std::map age_weight_map; - const age_weight_map& age_weight () const { @@ -92,8 +92,8 @@ private: std::string first_; std::string last_; - name_list nicknames_; - email_set emails_; + names nicknames_; + emails_type emails_; age_weight_map age_weight_; }; -- cgit v1.1