From f2f9fae27b67413a1d6f10bec15c61baa83ba36a Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 26 Nov 2019 20:05:32 +0000 Subject: [PATCH] thermophysicalFunction: Moved the operator<< to thermophysicalFunction.C --- .../thermophysicalFunction.C | 9 +++++++++ .../thermophysicalFunction.H | 14 +++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C index c406271fb6..a31166200b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.C @@ -94,4 +94,13 @@ void Foam::thermophysicalFunction::write(Ostream& os, const word& name) const } +// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * // + +Foam::Ostream& Foam::operator<<(Ostream& os, const thermophysicalFunction& f) +{ + f.write(os); + return os; +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.H b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.H index b787b9c200..ac0b6452e5 100644 --- a/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.H +++ b/src/thermophysicalModels/thermophysicalProperties/thermophysicalFunctions/thermophysicalFunction/thermophysicalFunction.H @@ -44,6 +44,10 @@ Description namespace Foam { +// Forward declaration of friend functions and operators +class thermophysicalFunction; +Ostream& operator<<(Ostream& os, const thermophysicalFunction& l); + /*---------------------------------------------------------------------------*\ Class thermophysicalFunction Declaration \*---------------------------------------------------------------------------*/ @@ -102,11 +106,11 @@ public: // Ostream Operator - friend Ostream& operator<<(Ostream& os, const thermophysicalFunction& f) - { - f.write(os); - return os; - } + friend Ostream& operator<< + ( + Ostream& os, + const thermophysicalFunction& f + ); };