Changes between Initial Version and Version 1 of CodingPatterns


Ignore:
Timestamp:
May 15, 2019, 12:11:14 PM (5 years ago)
Author:
mdavis
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CodingPatterns

    v1 v1  
     1= GEOS Coding Patterns =
     2
     3This page documents coding patterns followed in the GEOS codebase. 
     4
     5The patterns are intended to improve the following:
     6
     7 * Understandability
     8 * Performance
     9 * Memory safety
     10
     11Older GEOS code may not adhere to all patterns, but the goal is to update it when possible.  New code should follow the patterns given here, unless this is not possible for compatibility reasons.
     12
     13* Created objects should be returned as a `std::unique_ptr<Object>`
     14* Taking ownership of a returned object should be done as a `std::unique_ptr<Object>`
     15
     16== Investigations =
     17
     18=== Geometry Factory improvements
     19
     20 * Add `createXX` methods returning `std::unique_ptr<XX>`
     21 * Remove old create methods once all code is switched to using unique_ptr
     22
     23=== Unique_ptr typedefs?
     24
     25 * To reduce boilerplate perhaps define typedefs for common types:  `UP_Geometry`, `UP_CoordinateSequence`, etc
     26
     27=== Coordinate Sequence improvements
     28
     29**Goals:**
     30 * Improve performance by avoiding virtual function calls
     31 * Support immutable use of external coordinate sequence formats
     32
     33**Tasks**
     34 * Remove mutating methods where not strictly needed
     35 * Mark non-mutating methods as const to allow immutable use of external coordinate sequence formats
     36   * Will this work?
     37
     38
     39
     40
     41
     42
     43
     44
     45