Commit Graph

13 Commits

Author SHA1 Message Date
Andrew Heather
098aec4962 ENH: Function1's - added objectRegistry access 2021-11-26 11:22:36 +00:00
OpenFOAM bot
e9219558d7 GIT: Header file updates 2019-10-31 14:48:44 +00:00
OpenFOAM bot
154029ddd0 BOT: Cleaned up header files 2019-02-06 12:28:23 +00:00
Mark Olesen
660f3e5492 ENH: cleanup autoPtr class (issue #639)
Improve alignment of its behaviour with std::unique_ptr

  - element_type typedef
  - release() method - identical to ptr() method
  - get() method to get the pointer without checking and without releasing it.
  - operator*() for dereferencing

Method name changes

  - renamed rawPtr() to get()
  - renamed rawRef() to ref(), removed unused const version.

Removed methods/operators

  - assignment from a raw pointer was deleted (was rarely used).
    Can be convenient, but uncontrolled and potentially unsafe.
    Do allow assignment from a literal nullptr though, since this
    can never leak (and also corresponds to the unique_ptr API).

Additional methods

  - clone() method: forwards to the clone() method of the underlying
    data object with argument forwarding.

  - reset(autoPtr&&) as an alternative to operator=(autoPtr&&)

STYLE: avoid implicit conversion from autoPtr to object type in many places

- existing implementation has the following:

     operator const T&() const { return operator*(); }

  which means that the following code works:

       autoPtr<mapPolyMesh> map = ...;
       updateMesh(*map);    // OK: explicit dereferencing
       updateMesh(map());   // OK: explicit dereferencing
       updateMesh(map);     // OK: implicit dereferencing

  for clarity it may preferable to avoid the implicit dereferencing

- prefer operator* to operator() when deferenced a return value
  so it is clearer that a pointer is involve and not a function call
  etc    Eg,   return *meshPtr_;  vs.  return meshPtr_();
2018-02-26 12:00:00 +01:00
Mark Olesen
c0ba7bf05a STYLE: use Ostream writeEntry when writing key/value entries
- makes for clearer code

ENH: make writeIfDifferent part of Ostream
2017-11-06 00:49:24 +01:00
Henry Weller
3b3bb7173c variableHeightFlowRateInletVelocityFvPatchVectorField: Changed the flow-rate to a Function1
to support time-variation
2016-02-10 09:46:37 +00:00
Henry
2780df8365 multiphase: Update phase-naming to use the new convention e.g. alpha.water 2013-08-13 23:21:46 +01:00
andy
53df4289df ENH: Consistency updates - license text abnd code formatting 2013-03-12 15:40:03 +00:00
andy
04f044c14c ENH: Boundary condition doxygen documentation updates 2012-07-10 17:09:42 +01:00
Henry
2d2ad386a6 Updated support for clang-3.1 2012-06-06 17:45:18 +01:00
Henry
0c80f2fa9a variableHeightFlowRateInletVelocity BC: corrected to compile SP 2012-05-30 16:15:55 +01:00
Henry
c4bfeb6d39 Correct headers 2012-04-02 13:46:20 +01:00
Henry
917301d62b Corrected headers and formatting 2012-04-02 12:06:36 +01:00