diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2014-05-11 15:53:51 -0700 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2014-05-11 15:53:51 -0700 |
commit | 322f02e91e2ec716b5064d7cb3069beb1d2c44a4 (patch) | |
tree | f092e9a66a6200458c0037d52590d2a40a0248af | |
parent | 16e73947858754de5bfcbd91f8f6ce021e99c673 (diff) |
Remove unused constructors, accessors/modifiers to shorten examples
-rw-r--r-- | examples/inheritance/position.hxx | 53 | ||||
-rw-r--r-- | examples/persistence/position.hxx | 26 |
2 files changed, 7 insertions, 72 deletions
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<position> 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<elevation> 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<object> simple_objects_type; typedef std::vector<elevated_object> 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<position> 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. // |