diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.C index 982cfec4a4..6d677dd175 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.C @@ -33,10 +33,10 @@ template Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy>& p + const InfoProxy>& iproxy ) { - const CGAL::indexedCell& iv = p.t_; + const auto& iv = *iproxy; os << "Cell: "; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H index 8c0c4aa351..4204698777 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedCell/indexedCell.H @@ -249,9 +249,9 @@ public: // Info - //- Return info proxy. - // Used to print indexedCell information to a stream - Foam::InfoProxy> info() const + //- Return info proxy, + //- used to print information to a stream + Foam::InfoProxy> info() const noexcept { return *this; } @@ -261,7 +261,6 @@ public: Foam::Ostream&, const Foam::InfoProxy>& ); - }; diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.C index 3fe2c9b2be..8aed0c418a 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.C @@ -156,10 +156,10 @@ template Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy>& p + const InfoProxy>& iproxy ) { - const CGAL::indexedVertex& iv = p.t_; + const auto& iv = *iproxy; const Foam::point pt ( diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H index 320144f3b3..55277a708b 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/indexedVertex/indexedVertex.H @@ -313,8 +313,9 @@ public: // IOstream Operators - //- Info proxy, to print information to a stream - Foam::InfoProxy> info() const + //- Return info proxy, + //- used to print information to a stream + Foam::InfoProxy> info() const noexcept { return *this; } diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C index 0bdd2ea866..b416c08ed6 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.C @@ -654,7 +654,7 @@ Foam::Ostream& Foam::operator<< const InfoProxy& iproxy ) { - const PDRobstacle& obs = iproxy.t_; + const auto& obs = *iproxy; switch (obs.typeId) { diff --git a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H index d0dede5418..f9ffd85653 100644 --- a/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H +++ b/applications/utilities/preProcessing/PDR/pdrFields/obstacles/PDRobstacle.H @@ -37,8 +37,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef PDRobstacle_H -#define PDRobstacle_H +#ifndef Foam_PDRobstacle_H +#define Foam_PDRobstacle_H #include "InfoProxy.H" #include "labelPair.H" @@ -290,8 +290,9 @@ public: // IOstream Operators - //- Return info proxy. - InfoProxy info() const + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H index 872911dfe6..0ff679b541 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H @@ -510,8 +510,9 @@ public: // IOstream Operators - //- Return info proxy. - InfoProxy> info() const + //- Return info proxy, + //- used to print information to a stream + InfoProxy> info() const noexcept { return *this; } diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C b/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C index 03943c5e3f..d7cf404f04 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedListIO.C @@ -271,7 +271,7 @@ Foam::Ostream& Foam::operator<< const InfoProxy>& iproxy ) { - const PackedList& list = iproxy.t_; + const auto& list = *iproxy; os << "PackedList<" << Width << "> size=" << list.size() << "/" << list.capacity() diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H index b6f11d469c..75b7477744 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H @@ -604,8 +604,9 @@ public: // IOstream Operators - //- Return info proxy - InfoProxy info() const + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } @@ -634,7 +635,7 @@ template<> struct Hash : bitSet::hasher {}; Ostream& operator<<(Ostream& os, const bitSet& bitset); //- Output bitset information -Ostream& operator<<(Ostream& os, const InfoProxy& info); +Ostream& operator<<(Ostream& os, const InfoProxy& iproxy); //- Bitset complement, returns a copy of the bitset with all its bits flipped diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C b/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C index a8a59d263f..b5465e815c 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSetIO.C @@ -42,10 +42,10 @@ Foam::Ostream& Foam::operator<< const InfoProxy& iproxy ) { - const bitSet& bitset = iproxy.t_; + const auto& bitset = *iproxy; os << "bitSet<" << bitSet::elem_per_block - << "> size=" << bitset.size() << "/" << bitset.capacity() + << "> size=" << bitset.size() << '/' << bitset.capacity() << " count=" << bitset.count() << nl; diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index 016032a180..6510da3c78 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -101,8 +101,8 @@ SourceFiles #include "fileName.H" #include "typeInfo.H" #include "autoPtr.H" -#include "InfoProxy.H" #include "Enum.H" +#include "InfoProxy.H" #include "IOobjectOption.H" #include "IOstreamOption.H" @@ -115,6 +115,11 @@ namespace Foam class Time; class dictionary; class objectRegistry; +class IOobject; + +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class IOobject Declaration @@ -646,11 +651,9 @@ public: // Info - //- Return info proxy, for printing information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- for printing information to a stream + InfoProxy info() const noexcept { return *this; } // Member Operators @@ -668,10 +671,6 @@ inline bool IOobject::isHeaderClass() const } -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - //- Template function for obtaining global vs. local status template inline bool typeGlobal() diff --git a/src/OpenFOAM/db/IOobject/IOobjectIO.C b/src/OpenFOAM/db/IOobject/IOobjectIO.C index 2a190537eb..f81501358c 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectIO.C +++ b/src/OpenFOAM/db/IOobject/IOobjectIO.C @@ -31,9 +31,13 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<> -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - const IOobject& io = ip.t_; + const auto& io = *iproxy; os << "IOobject: " << io.type() << ' ' << io.name() diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C index 983c3a7275..a627e382bf 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.C @@ -138,9 +138,13 @@ void Foam::IOstream::print(Ostream& os, const int streamState) const // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // template<> -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - ip.t_.print(os); + (*iproxy).print(os); return os; } diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H index 58d3d6a88a..b05e073cb3 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/IOstream.H @@ -73,6 +73,13 @@ using std::cout; namespace Foam { +// Forward Declarations +class IOstream; + +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + + /*---------------------------------------------------------------------------*\ Class IOstream Declaration \*---------------------------------------------------------------------------*/ @@ -405,21 +412,12 @@ public: // Info - //- Return info proxy. - // Used to print IOstream information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print IOstream information to a stream + InfoProxy info() const noexcept { return *this; } }; -// Ostream Operator - -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // -------------------------------------------------------------------- // ------ Manipulators (not taking arguments) // -------------------------------------------------------------------- diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 70a22c1b97..ec2fa135be 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -583,11 +583,9 @@ public: // Info - //- Return info proxy for printing token information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- for printing token information to a stream + InfoProxy info() const noexcept { return *this; } // Member Operators @@ -658,7 +656,7 @@ public: friend Ostream& operator<<(Ostream& os, const punctuationToken& pt); friend ostream& operator<<(ostream& os, const punctuationToken& pt); - friend ostream& operator<<(ostream& os, const InfoProxy& ct); + friend ostream& operator<<(ostream& os, const InfoProxy& ip); // Housekeeping diff --git a/src/OpenFOAM/db/IOstreams/token/tokenIO.C b/src/OpenFOAM/db/IOstreams/token/tokenIO.C index a37a37cec3..31eabb4e49 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenIO.C +++ b/src/OpenFOAM/db/IOstreams/token/tokenIO.C @@ -260,16 +260,24 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token::compound& ct) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -ostream& Foam::operator<<(ostream& os, const InfoProxy& ip) +ostream& Foam::operator<< +( + ostream& os, + const InfoProxy& iproxy +) { - return printTokenInfo(os, ip.t_); + return printTokenInfo(os, *iproxy); } template<> -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - return printTokenInfo(os, ip.t_); + return printTokenInfo(os, *iproxy); } diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H index 1380f427d6..fd35fd2b9d 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H @@ -42,8 +42,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef dictionaryEntry_H -#define dictionaryEntry_H +#ifndef Foam_dictionaryEntry_H +#define Foam_dictionaryEntry_H #include "entry.H" #include "dictionary.H" @@ -54,10 +54,13 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations class dictionaryEntry; Ostream& operator<<(Ostream& os, const dictionaryEntry& e); +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class dictionaryEntry Declaration @@ -68,14 +71,14 @@ class dictionaryEntry public entry, public dictionary { - // Private Member Functions +public: + + // Generated Methods //- No copy construct dictionaryEntry(const dictionaryEntry&) = delete; -public: - // Constructors //- Construct from the parent dictionary and Istream. @@ -158,24 +161,17 @@ public: //- Write virtual void write(Ostream& os) const; - //- Return info proxy. - // Used to print token information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print token information to a stream + InfoProxy info() const noexcept { return *this; } - // Ostream Operator + // Ostream Operators friend Ostream& operator<<(Ostream& os, const dictionaryEntry& e); }; -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C index 383d0603df..00fd3b5d4c 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C @@ -68,7 +68,11 @@ void Foam::dictionaryEntry::write(Ostream& os) const // * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryEntry& e) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const dictionaryEntry& e +) { e.write(os); return os; @@ -79,10 +83,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const dictionaryEntry& e = ip.t_; + const auto& e = *iproxy; os << " dictionaryEntry '" << e.keyword() << "'" << endl; diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H index a5b0e7fa08..f605257f0f 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H @@ -42,8 +42,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef dictionaryListEntry_H -#define dictionaryListEntry_H +#ifndef Foam_dictionaryListEntry_H +#define Foam_dictionaryListEntry_H #include "dictionaryEntry.H" @@ -52,11 +52,14 @@ SourceFiles namespace Foam { -// Forward declaration of friend functions and operators +// Forward Declarations class dictionaryListEntry; Ostream& operator<<(Ostream& os, const dictionaryListEntry& e); +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class dictionaryListEntry Declaration @@ -66,14 +69,14 @@ class dictionaryListEntry : public dictionaryEntry { - // Private Member Functions +public: + + // Generated Methods //- No copy construct dictionaryListEntry(const dictionaryListEntry&) = delete; -public: - // Constructors //- Construct from the parent dictionary and Istream @@ -92,29 +95,22 @@ public: } - // Member functions + // Member Functions //- Write virtual void write(Ostream& os) const; - //- Return info proxy. - // Used to print token information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print token information to a stream + InfoProxy info() const noexcept { return *this; } - // Ostream operator + // Ostream Operator friend Ostream& operator<<(Ostream& os, const dictionaryListEntry& e); }; -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C index 72a06b2bb6..74aad8eacd 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C @@ -132,7 +132,11 @@ void Foam::dictionaryListEntry::write(Ostream& os) const // * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& e) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const dictionaryListEntry& e +) { e.write(os); return os; @@ -143,10 +147,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const dictionaryListEntry& e = ip.t_; + const auto& e = *iproxy; os << " dictionaryListEntry '" << e.keyword() << "'" << endl; diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H index 14e0dfb5ba..3e8236a330 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H @@ -42,8 +42,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef primitiveEntry_H -#define primitiveEntry_H +#ifndef Foam_primitiveEntry_H +#define Foam_primitiveEntry_H #include "entry.H" #include "ITstream.H" @@ -56,6 +56,11 @@ namespace Foam // Forward Declarations class dictionary; +class primitiveEntry; + +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class primitiveEntry Declaration @@ -193,19 +198,12 @@ public: //- Write, optionally with contents only (no keyword, etc) void write(Ostream& os, const bool contentsOnly) const; - //- Return info proxy. - // Used to print token information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- to print token information to a stream + InfoProxy info() const noexcept { return *this; } }; -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C index 713351dc12..5987f0b83a 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C @@ -313,14 +313,14 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const primitiveEntry& e = ip.t_; + const auto& e = *iproxy; e.print(os); - const label nPrintTokens = 10; + constexpr label nPrintTokens = 10; os << " primitiveEntry '" << e.keyword() << "' comprises "; diff --git a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C index a3d690ab94..8a52f4f806 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C +++ b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C @@ -611,10 +611,10 @@ bool Foam::dlLibraryTable::open Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const dlLibraryTable& tbl = ip.t_; + const auto& tbl = *iproxy; os << token::BEGIN_LIST << nl; diff --git a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.H b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.H index 8fa2f99a02..737d46c020 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.H +++ b/src/OpenFOAM/db/dynamicLibrary/dlLibraryTable/dlLibraryTable.H @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef dlLibraryTable_H -#define dlLibraryTable_H +#ifndef Foam_dlLibraryTable_H +#define Foam_dlLibraryTable_H #include "DynamicList.H" #include "fileName.H" @@ -55,7 +55,8 @@ namespace Foam // Forward Declarations class dlLibraryTable; -Ostream& operator<<(Ostream& os, const InfoProxy& info); +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class dlLibraryTable Declaration @@ -308,12 +309,9 @@ public: // Info - //- Return info proxy. - // Used to print library table information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print library table information to a stream + InfoProxy info() const noexcept { return *this; } }; diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C index 3ebbdb5c63..83a759352b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C @@ -407,9 +407,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const lduMatrix& ldum) } -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - const lduMatrix& ldum = ip.t_; + const auto& ldum = *iproxy; Switch hasLow = ldum.hasLower(); Switch hasDiag = ldum.hasDiag(); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H index 87a1ccd2e1..287f68fc6f 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H @@ -788,17 +788,14 @@ public: tmp> faceH(const tmp>&) const; - // Info + // Info - //- Return info proxy. - // Used to print matrix information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print matrix information to a stream + InfoProxy info() const noexcept { return *this; } - // Member operators + // Member Operators void operator=(const lduMatrix&); @@ -811,7 +808,7 @@ public: void operator*=(scalar); - // Ostream operator + // Ostream Operators friend Ostream& operator<<(Ostream&, const lduMatrix&); friend Ostream& operator<<(Ostream&, const InfoProxy&); diff --git a/src/OpenFOAM/meshes/lduMesh/lduMesh.C b/src/OpenFOAM/meshes/lduMesh/lduMesh.C index 5011b4f88f..16e73ddf7c 100644 --- a/src/OpenFOAM/meshes/lduMesh/lduMesh.C +++ b/src/OpenFOAM/meshes/lduMesh/lduMesh.C @@ -33,7 +33,7 @@ License namespace Foam { -defineTypeNameAndDebug(lduMesh, 0); + defineTypeNameAndDebug(lduMesh, 0); } @@ -49,9 +49,13 @@ const Foam::objectRegistry& Foam::lduMesh::thisDb() const // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - const lduMesh& ldum = ip.t_; + const auto& ldum = *iproxy; const lduAddressing& addr = ldum.lduAddr(); const lduInterfacePtrsList interfaces = ldum.interfaces(); @@ -62,6 +66,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) << " interfaces:" << interfaces.size() << " comm:" << ldum.comm() << endl; + label nCouples = 0; forAll(interfaces, i) { diff --git a/src/OpenFOAM/meshes/lduMesh/lduMesh.H b/src/OpenFOAM/meshes/lduMesh/lduMesh.H index 85e33ed605..493bbcaabc 100644 --- a/src/OpenFOAM/meshes/lduMesh/lduMesh.H +++ b/src/OpenFOAM/meshes/lduMesh/lduMesh.H @@ -98,14 +98,11 @@ public: ) const; - // Info + // Info - //- Return info proxy. - // Used to print mesh information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print mesh information to a stream + InfoProxy info() const noexcept { return *this; } // Ostream Operator diff --git a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H index 59490311d2..118589f3a5 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H +++ b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModel.H @@ -46,8 +46,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef cellModel_H -#define cellModel_H +#ifndef Foam_cellModel_H +#define Foam_cellModel_H #include "pointField.H" #include "edgeList.H" @@ -66,6 +66,10 @@ namespace Foam class cellModel; Ostream& operator<<(Ostream& os, const cellModel& cm); +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + + /*---------------------------------------------------------------------------*\ Class cellModel Declaration \*---------------------------------------------------------------------------*/ @@ -228,12 +232,10 @@ public: const UList& points ) const; - //- Return info proxy. - // Used to print information to a stream - InfoProxy info() const - { - return *this; - } + + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } //- The writeData member function required by regIOobject bool writeData(Ostream& os) const @@ -249,12 +251,6 @@ public: }; -// Ostream Operators - -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // Global Operators //- Equality: true when model pointers are identical diff --git a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModelIO.C b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModelIO.C index 464b12ce35..c57f0a1516 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModel/cellModelIO.C +++ b/src/OpenFOAM/meshes/meshShapes/cellModel/cellModelIO.C @@ -59,9 +59,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const cellModel& cm) template<> -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - const cellModel& cm = ip.t_; + const auto& cm = *iproxy; os << "name = " << cm.name() << ", " << "index = " << cm.index() << ", " diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H index 7356f77ddf..193cee691e 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShape.H @@ -62,6 +62,9 @@ bool operator==(const cellShape& a, const cellShape& b); Istream& operator>>(Istream& is, cellShape& s); Ostream& operator<<(Ostream& os, const cellShape& s); +template<> +Ostream& operator<<(Ostream& os, const InfoProxy& ip); + /*---------------------------------------------------------------------------*\ Class cellShape Declaration @@ -212,11 +215,9 @@ public: //- Collapse shape to correct one after removing duplicate vertices void collapse(); - //- Return info proxy, to print information to a stream - Foam::InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } // Friend Operators @@ -224,17 +225,13 @@ public: friend bool operator==(const cellShape& a, const cellShape& b); - // IOstream operators + // IOstream Operators friend Istream& operator>>(Istream& is, cellShape& s); friend Ostream& operator<<(Ostream& os, const cellShape& s); }; -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeIO.C b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeIO.C index d9d92114f8..d8c737b7e9 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeIO.C +++ b/src/OpenFOAM/meshes/meshShapes/cellShape/cellShapeIO.C @@ -115,9 +115,13 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const cellShape& s) template<> -Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const InfoProxy& iproxy +) { - const cellShape& cs = ip.t_; + const auto& cs = *iproxy; if (isNull(cs.model())) { @@ -125,7 +129,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) } else { - os << cs.model().info() << endl; + os << cs.model().info() << nl; } os << "\tGeom:\tpoint\tlabel\txyz\n"; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.H index e6bf8960d1..a86b0d2beb 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBase.H @@ -97,6 +97,9 @@ class mapDistributeBase; Istream& operator>>(Istream&, mapDistributeBase&); Ostream& operator<<(Ostream&, const mapDistributeBase&); +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class mapDistributeBase Declaration @@ -1031,8 +1034,9 @@ public: // IOstream Operators - //- Info proxy to print summary information to a stream - InfoProxy info() const + //- Return info proxy, + //- used to print summary information to a stream + InfoProxy info() const noexcept { return *this; } @@ -1079,12 +1083,6 @@ public: }; -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseIO.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseIO.C index f04368a55c..be60fb8d75 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseIO.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeBaseIO.C @@ -171,10 +171,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const auto& map = ip.t_; + const auto& map = *iproxy; // Output as compact pseudo dictionary entries diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H index e1d1fc5253..4a132748ec 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.H @@ -59,6 +59,9 @@ class mapDistributePolyMesh; Istream& operator>>(Istream&, mapDistributePolyMesh&); Ostream& operator<<(Ostream&, const mapDistributePolyMesh&); +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class mapDistributePolyMesh Declaration @@ -308,8 +311,9 @@ public: // IOstream Operators - //- Info proxy to print summary information to a stream - InfoProxy info() const + //- Return info proxy, + //- used to print summary information to a stream + InfoProxy info() const noexcept { return *this; } @@ -351,12 +355,6 @@ public: }; -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ip); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMeshIO.C index 50e1663f03..a3ee7783da 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMeshIO.C @@ -187,10 +187,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const auto& map = ip.t_; + const auto& map = *iproxy; os.beginBlock("cellMap"); os.writeEntry("oldSize", map.nOldCells()); diff --git a/src/fileFormats/ensight/part/cells/ensightCells.H b/src/fileFormats/ensight/part/cells/ensightCells.H index 928399f45e..ac64cd0d81 100644 --- a/src/fileFormats/ensight/part/cells/ensightCells.H +++ b/src/fileFormats/ensight/part/cells/ensightCells.H @@ -254,8 +254,9 @@ public: // Output - //- Return info proxy - InfoProxy info() const { return *this; } + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } //- Globally unique mesh points. Required when writing point fields. @@ -281,6 +282,7 @@ public: }; +//- Print information via proxy template<> Ostream& operator<<(Ostream&, const InfoProxy&); diff --git a/src/fileFormats/ensight/part/cells/ensightCellsIO.C b/src/fileFormats/ensight/part/cells/ensightCellsIO.C index 467a0b51e3..f45f70a417 100644 --- a/src/fileFormats/ensight/part/cells/ensightCellsIO.C +++ b/src/fileFormats/ensight/part/cells/ensightCellsIO.C @@ -336,10 +336,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const ensightCells& part = ip.t_; + const auto& part = *iproxy; os << part.name().c_str(); diff --git a/src/fileFormats/ensight/part/faces/ensightFaces.H b/src/fileFormats/ensight/part/faces/ensightFaces.H index 8b4cff2819..0243ba510e 100644 --- a/src/fileFormats/ensight/part/faces/ensightFaces.H +++ b/src/fileFormats/ensight/part/faces/ensightFaces.H @@ -247,8 +247,9 @@ public: // Output - //- Return info proxy - InfoProxy info() const { return *this; } + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } //- Globally unique mesh points. @@ -274,6 +275,7 @@ public: }; +//- Print information via proxy template<> Ostream& operator<<(Ostream&, const InfoProxy&); diff --git a/src/fileFormats/ensight/part/faces/ensightFacesIO.C b/src/fileFormats/ensight/part/faces/ensightFacesIO.C index b23a5b9afa..66723c144e 100644 --- a/src/fileFormats/ensight/part/faces/ensightFacesIO.C +++ b/src/fileFormats/ensight/part/faces/ensightFacesIO.C @@ -141,10 +141,10 @@ template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const ensightFaces& part = ip.t_; + const auto& part = *iproxy; os << part.name().c_str(); diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C index ecdef223fa..5ddb6f5b23 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.C @@ -508,10 +508,10 @@ Foam::Ostream& Foam::operator<< Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const wallBoundedParticle& p = ip.t_; + const auto& p = *iproxy; tetPointRef tpr(p.currentTetIndices().tet(p.mesh())); diff --git a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.H b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.H index 6fe5ff6bb7..9a49d00b16 100644 --- a/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.H +++ b/src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.H @@ -260,25 +260,25 @@ public: ); - // Info + // Info - //- Return info proxy. - // Used to print particle information to a stream - inline InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print particle information to a stream + InfoProxy info() const noexcept + { + return *this; + } - // I-O + // I-O - //- Read - template - static void readFields(CloudType&); + //- Read + template + static void readFields(CloudType&); - //- Write - template - static void writeFields(const CloudType&); + //- Write + template + static void writeFields(const CloudType&); // Ostream Operator diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C index a5a66a23de..e54593589b 100644 --- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C +++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C @@ -496,7 +496,7 @@ Foam::Ostream& Foam::operator<< const InfoProxy& iproxy ) { - const blockDescriptor& bd = iproxy.t_; + const auto& bd = *iproxy; os << "Dimensions:" << bd.density() << " nPoints:" << bd.nPoints() diff --git a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H index 9c04e352a6..da0a97906e 100644 --- a/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H +++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H @@ -55,8 +55,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef blockDescriptor_H -#define blockDescriptor_H +#ifndef Foam_blockDescriptor_H +#define Foam_blockDescriptor_H #include "ijkMesh.H" #include "cellShape.H" @@ -72,6 +72,14 @@ SourceFiles namespace Foam { +// Forward Declarations +class blockDescriptor; + +Ostream& operator<<(Ostream&, const blockDescriptor&); + +Ostream& operator<<(Ostream&, const InfoProxy&); + + /*---------------------------------------------------------------------------*\ Class blockDescriptor Declaration \*---------------------------------------------------------------------------*/ @@ -261,21 +269,12 @@ public: //- Write block index with dictionary lookup static void write(Ostream&, const label blocki, const dictionary&); - //- Return info proxy - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- used to print information to a stream + InfoProxy info() const noexcept { return *this; } }; -//- Output Operator -Ostream& operator<<(Ostream& os, const blockDescriptor& bd); - -//- Info output -Ostream& operator<<(Ostream& os, const InfoProxy& info); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/meshTools/coordSet/writers/common/coordSetWriter.C b/src/meshTools/coordSet/writers/common/coordSetWriter.C index 35e53056b0..d3e7c5cae4 100644 --- a/src/meshTools/coordSet/writers/common/coordSetWriter.C +++ b/src/meshTools/coordSet/writers/common/coordSetWriter.C @@ -461,10 +461,10 @@ bool Foam::coordSetWriter::merge() const Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const coordSetWriter& w = ip.t_; + const auto& w = *iproxy; os << "coordSetWriter:" << " upToDate: " << w.upToDate_ diff --git a/src/meshTools/coordSet/writers/common/coordSetWriter.H b/src/meshTools/coordSet/writers/common/coordSetWriter.H index 05b2f43170..f98cf887b1 100644 --- a/src/meshTools/coordSet/writers/common/coordSetWriter.H +++ b/src/meshTools/coordSet/writers/common/coordSetWriter.H @@ -538,7 +538,8 @@ public: // Other - //- Return info proxy. + //- Return info proxy, + //- used to print information to a stream virtual InfoProxy info() const { return *this; @@ -548,7 +549,7 @@ public: friend Ostream& operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ); diff --git a/src/meshTools/triSurface/surfaceLocation/surfaceLocation.C b/src/meshTools/triSurface/surfaceLocation/surfaceLocation.C index a8eb28fb10..ebb03bd03c 100644 --- a/src/meshTools/triSurface/surfaceLocation/surfaceLocation.C +++ b/src/meshTools/triSurface/surfaceLocation/surfaceLocation.C @@ -111,10 +111,10 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const surfaceLocation& sl) Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const surfaceLocation& sl = ip.t_; + const auto& sl = *iproxy; os << "coord:" << sl.point(); diff --git a/src/meshTools/triSurface/surfaceLocation/surfaceLocation.H b/src/meshTools/triSurface/surfaceLocation/surfaceLocation.H index 6516da4fa0..d9ee0baa91 100644 --- a/src/meshTools/triSurface/surfaceLocation/surfaceLocation.H +++ b/src/meshTools/triSurface/surfaceLocation/surfaceLocation.H @@ -45,8 +45,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef surfaceLocation_H -#define surfaceLocation_H +#ifndef Foam_surfaceLocation_H +#define Foam_surfaceLocation_H #include "pointIndexHit.H" #include "triangle.H" @@ -63,8 +63,10 @@ class triSurface; Istream& operator>>(Istream&, surfaceLocation&); Ostream& operator<<(Ostream&, const surfaceLocation&); + Ostream& operator<<(Ostream&, const InfoProxy&); + /*---------------------------------------------------------------------------*\ Class surfaceLocation Declaration \*---------------------------------------------------------------------------*/ @@ -139,11 +141,9 @@ public: //- Normal. Approximate for points. vector normal(const triSurface& s) const; - //- Return info proxy, to print information to a stream - InfoProxy info() const - { - return *this; - } + //- Return info proxy, + //- to print information to a stream + InfoProxy info() const noexcept { return *this; } //- Write info about selected face index to a stream void write(Ostream& os, const triSurface& s) const; @@ -154,12 +154,6 @@ public: friend Istream& operator>>(Istream& is, surfaceLocation& sl); friend Ostream& operator<<(Ostream& os, const surfaceLocation& sl); - - friend Ostream& operator<< - ( - Ostream& os, - const InfoProxy& ip - ); }; diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C index 5a05dd3332..37395777ed 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.C @@ -741,16 +741,16 @@ void Foam::cellCellStencil::walkFront } -// * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * * * // template<> Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ic + const InfoProxy& iproxy ) { - const cellCellStencil& e = ic.t_; + const auto& e = *iproxy; const labelUList& cellTypes = e.cellTypes(); const labelUList& interpolationCells = e.interpolationCells(); @@ -825,4 +825,5 @@ Foam::Ostream& Foam::operator<< return os; } + // ************************************************************************* // diff --git a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H index b106addad8..8191a3df72 100644 --- a/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H +++ b/src/overset/cellCellStencil/cellCellStencil/cellCellStencil.H @@ -40,8 +40,8 @@ SourceFiles \*---------------------------------------------------------------------------*/ -#ifndef cellCellStencil_H -#define cellCellStencil_H +#ifndef Foam_cellCellStencil_H +#define Foam_cellCellStencil_H #include "scalarList.H" #include "mapDistribute.H" @@ -53,8 +53,14 @@ SourceFiles namespace Foam { +// Forward Declarations +class cellCellStencil; class mapDistribute; +template<> +Ostream& operator<<(Ostream&, const InfoProxy&); + + /*---------------------------------------------------------------------------*\ Class cellCellStencil Declaration \*---------------------------------------------------------------------------*/ @@ -265,13 +271,6 @@ public: template static void correctBoundaryConditions(GeoField& psi); - //- Return info proxy. - //- Used to print stencil information to a stream - InfoProxy info() const - { - return *this; - } - //- Surround holes with layer(s) of interpolated cells void walkFront ( @@ -310,10 +309,15 @@ public: bitSet& isFront, scalarField& fraction ) const; + + + // Write + + //- Return info proxy, + //- used to print stencil information to a stream + InfoProxy info() const noexcept { return *this; } }; -template<> -Ostream& operator<<(Ostream& os, const InfoProxy& ic); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/surfMesh/writers/common/surfaceWriter.C b/src/surfMesh/writers/common/surfaceWriter.C index 74dea7f2c9..963aaa63c6 100644 --- a/src/surfMesh/writers/common/surfaceWriter.C +++ b/src/surfMesh/writers/common/surfaceWriter.C @@ -744,10 +744,10 @@ defineSurfaceFieldMethods(Foam::surfaceWriter, Foam::tensor) Foam::Ostream& Foam::operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy ) { - const surfaceWriter& w = ip.t_; + const auto& w = *iproxy; os << "surfaceWriter:" << " upToDate: " << w.upToDate_ diff --git a/src/surfMesh/writers/common/surfaceWriter.H b/src/surfMesh/writers/common/surfaceWriter.H index ea3692cd41..94df1ee659 100644 --- a/src/surfMesh/writers/common/surfaceWriter.H +++ b/src/surfMesh/writers/common/surfaceWriter.H @@ -611,8 +611,9 @@ public: // Other IO - //- Return info proxy. - virtual InfoProxy info() const + //- Return info proxy, + //- used to print information to a stream + virtual InfoProxy info() const noexcept { return *this; } @@ -621,7 +622,7 @@ public: friend Ostream& operator<< ( Ostream& os, - const InfoProxy& ip + const InfoProxy& iproxy );