From 322f02e91e2ec716b5064d7cb3069beb1d2c44a4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 11 May 2014 15:53:51 -0700 Subject: Remove unused constructors, accessors/modifiers to shorten examples --- examples/inheritance/position.hxx | 53 ++++----------------------------------- examples/persistence/position.hxx | 26 ++----------------- 2 files changed, 7 insertions(+), 72 deletions(-) (limited to 'examples') diff --git a/examples/inheritance/position.hxx b/examples/inheritance/position.hxx index 9be93a1..d86995d 100644 --- a/examples/inheritance/position.hxx +++ b/examples/inheritance/position.hxx @@ -13,13 +13,7 @@ class position { public: - position (float lat = 0, float lon = 0): lat_ (lat), lon_ (lon) {} - - float - lat () const {return lat_;} - - float - lon () const {return lon_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // @@ -37,21 +31,9 @@ private: class object { public: - object (const std::string& name, unsigned int id): name_ (name), id_ (id) {} - - const std::string& - name () const {return name_;} - - unsigned int - id () const {return id_;} - typedef std::vector positions_type; - positions_type& - positions () {return positions_;} - - const positions_type& - positions () const {return positions_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // @@ -80,10 +62,7 @@ private: class elevation { public: - elevation (float value = 0): value_ (value) {} - - float - value () const {return value_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // @@ -100,21 +79,9 @@ private: class elevated_object: public object { public: - elevated_object (const std::string& name, - const std::string& units, - unsigned int id) - : object (name, id), units_ (units) {} - - const std::string& - units () const {return units_;} - typedef std::vector elevations_type; - elevations_type& - elevations () {return elevations_;} - - const elevations_type& - elevations () const {return elevations_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // @@ -145,17 +112,7 @@ public: typedef std::vector simple_objects_type; typedef std::vector elevated_objects_type; - simple_objects_type& - simple_objects () {return simple_objects_;} - - const simple_objects_type& - simple_objects () const {return simple_objects_;} - - elevated_objects_type& - elevated_objects () {return elevated_objects_;} - - const elevated_objects_type& - elevated_objects () const {return elevated_objects_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // diff --git a/examples/persistence/position.hxx b/examples/persistence/position.hxx index 3025a29..26b04f5 100644 --- a/examples/persistence/position.hxx +++ b/examples/persistence/position.hxx @@ -25,13 +25,7 @@ operator>> (std::istream&, object_type&); class position { public: - position (float lat = 0, float lon = 0): lat_ (lat), lon_ (lon) {} - - float - lat () const {return lat_;} - - float - lon () const {return lon_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // @@ -49,25 +43,9 @@ private: class object { public: - object (const std::string& name, object_type type, unsigned int id) - : name_ (name), type_ (type), id_ (id) {} - - const std::string& - name () const {return name_;} - - object_type - type () const {return type_;} - - unsigned int - id () const {return id_;} - typedef std::vector positions_type; - positions_type& - positions () {return positions_;} - - const positions_type& - positions () const {return positions_;} + // Constructors as well as accessor and modifiers not shown. // XML persistence. // -- cgit v1.1