diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C index da7de7e820983b9021da4670102775bdafa29eaa..904c4f2902f17880759e57c90a3525c74b1c3b12 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListIO.C @@ -56,7 +56,7 @@ Foam::Istream& Foam::operator>>(Foam::Istream& is, FixedList<T, Size>& L) { L = dynamicCast<token::Compound<List<T> > > ( - firstToken.transferCompoundToken() + firstToken.transferCompoundToken(is) ); } else if (firstToken.isLabel()) diff --git a/src/OpenFOAM/containers/Lists/List/ListIO.C b/src/OpenFOAM/containers/Lists/List/ListIO.C index dda233bd841b195fbae2696b2257f70a23332ddb..8699f6126a6a2a6bf303aa5bfdaf6168c107da4a 100644 --- a/src/OpenFOAM/containers/Lists/List/ListIO.C +++ b/src/OpenFOAM/containers/Lists/List/ListIO.C @@ -59,7 +59,7 @@ Foam::Istream& Foam::operator>>(Istream& is, List<T>& L) ( dynamicCast<token::Compound<List<T> > > ( - firstToken.transferCompoundToken() + firstToken.transferCompoundToken(is) ) ); } diff --git a/src/OpenFOAM/db/IOstreams/token/CompoundToken.H b/src/OpenFOAM/db/IOstreams/token/CompoundToken.H deleted file mode 100644 index 915e6b6a973629053e9291842befd3ce1c201a73..0000000000000000000000000000000000000000 --- a/src/OpenFOAM/db/IOstreams/token/CompoundToken.H +++ /dev/null @@ -1,133 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. - -Class - Foam::CompoundToken - -Description - An abstract base class for managing compound tokens - -\*---------------------------------------------------------------------------*/ - -#ifndef CompoundToken_H -#define CompoundToken_H - -#include "refCount.H" -#include "typeInfo.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of friend functions and operators - -class CompoundToken; -Ostream& operator<<(Ostream&, const CompoundToken&); - - -/*---------------------------------------------------------------------------*\ - Class CompoundToken Declaration -\*---------------------------------------------------------------------------*/ - -class CompoundToken -: - public refCount -{ - // Private Member Functions - - //- Disallow default bitwise copy construct - CompoundToken(const CompoundToken&); - - //- Disallow default bitwise assignment - void operator=(const CompoundToken&); - - -public: - - //- Runtime type information - virtual const word& type() const = 0; - - - // Declare run-time constructor selection tables - - declareRunTimeSelectionTable - ( - autoPtr, - CompoundToken, - Istream, - (const word& type, Istream& is), - (type, is) - ); - - - // Constructors - - //- Construct null - CompoundToken() - {} - - //- Return the clone as this and increment reference count - virtual autoPtr<CompoundToken> clone() const = 0; - - - // Selectors - - //- Select null constructed - static autoPtr<CompoundToken> New(const word& type, Istream& is); - - - //- Destructor - virtual ~CompoundToken(); - - - // Member Functions - - // Access - - // Check - - // Edit - - // Write - - virtual void write(Istream&) = 0; - - - // IOstream Operators - - friend Ostream& operator<<(Ostream&, const CompoundToken&); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 6c57d1a1a9a1a7910d1cfdac16bd5d7be7afd61b..5d7ce3f2f708c5afb4fa251c6ee1291fb7a1fddf 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -63,11 +63,11 @@ Foam::autoPtr<Foam::token::compound> Foam::token::compound::New if (cstrIter == IstreamConstructorTablePtr_->end()) { - FatalErrorIn("token::compound::New(const word&, Istream&)") + FatalIOErrorIn("token::compound::New(const word&, Istream&)", is) << "Unknown compound type " << compoundType << nl << nl << "Valid compound types:" << endl << IstreamConstructorTablePtr_->sortedToc() - << abort(FatalError); + << abort(FatalIOError); } return autoPtr<Foam::token::compound>(cstrIter()(is)); @@ -86,15 +86,15 @@ bool Foam::token::compound::isCompound(const word& name) } -Foam::token::compound& Foam::token::transferCompoundToken() +Foam::token::compound& Foam::token::transferCompoundToken(const Istream& is) { if (type_ == COMPOUND) { if (compoundTokenPtr_->empty()) { - FatalErrorIn("token::transferCompoundToken()") + FatalIOErrorIn("token::transferCompoundToken(const Istream& is)", is) << "compound has already been transfered from token\n " - << info() << abort(FatalError); + << info() << abort(FatalIOError); } else { diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 0c70cdc82e7b984c90218bfe079e78356f23db64..af754336195ea7c0d327e669d787d92dfcc82d77 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -351,7 +351,7 @@ public: inline bool isCompound() const; inline const compound& compoundToken() const; - compound& transferCompoundToken(); + compound& transferCompoundToken(const Istream& is); inline label lineNumber() const; inline label& lineNumber(); diff --git a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C index 7587a7be485fb564867f5bd67bf1084464da578b..1089b2576ee7ded399b46ccaa0e8747e50bf87ab 100644 --- a/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C +++ b/src/genericPatchFields/genericFvPatchField/genericFvPatchField.C @@ -147,7 +147,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField ( dynamicCast<token::Compound<List<scalar> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -184,7 +184,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField ( dynamicCast<token::Compound<List<vector> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -224,7 +224,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField token::Compound<List<sphericalTensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -264,7 +264,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField token::Compound<List<symmTensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -301,7 +301,7 @@ Foam::genericFvPatchField<Type>::genericFvPatchField ( dynamicCast<token::Compound<List<tensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); diff --git a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C index bb8fe3f6fe38581f3de9dd720cd852d4bc2b60c6..02f74a25c26197d25abb8e5e8702d16231a8a473 100644 --- a/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C +++ b/src/genericPatchFields/genericPointPatchField/genericPointPatchField.C @@ -129,7 +129,7 @@ genericPointPatchField<Type>::genericPointPatchField ( dynamicCast<token::Compound<List<scalar> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -167,7 +167,7 @@ genericPointPatchField<Type>::genericPointPatchField ( dynamicCast<token::Compound<List<vector> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -208,7 +208,7 @@ genericPointPatchField<Type>::genericPointPatchField token::Compound<List<sphericalTensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -249,7 +249,7 @@ genericPointPatchField<Type>::genericPointPatchField token::Compound<List<symmTensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) ); @@ -287,7 +287,7 @@ genericPointPatchField<Type>::genericPointPatchField ( dynamicCast<token::Compound<List<tensor> > > ( - fieldToken.transferCompoundToken() + fieldToken.transferCompoundToken(is) ) );