From ae2815e75b432cc7006272e91d0d561e4f2b7ce2 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 11 Oct 2010 17:28:11 +0100 Subject: [PATCH] ENH: Added INew construct from dictionary --- src/OpenFOAM/db/IOstreams/IOstreams/INew.H | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/db/IOstreams/IOstreams/INew.H b/src/OpenFOAM/db/IOstreams/IOstreams/INew.H index cd69fe3919..23c18150fb 100644 --- a/src/OpenFOAM/db/IOstreams/IOstreams/INew.H +++ b/src/OpenFOAM/db/IOstreams/IOstreams/INew.H @@ -25,7 +25,7 @@ Class Foam::INew Description - A helper class when constructing from an Istream + A helper class when constructing from an Istream or dictionary \*---------------------------------------------------------------------------*/ @@ -52,18 +52,33 @@ class INew public: + //- Construct null INew() {} + //- Construct from Istream autoPtr operator()(Istream& is) const { return T::New(is); } + //- Construct from word and Istream autoPtr operator()(const word&, Istream& is) const { return T::New(is); } + + //- Construct from dictionary + autoPtr operator()(const dictionary& dict) const + { + return T::New(dict); + } + + //- Construct from word and dictionary + autoPtr operator()(const word&, const dictionary& dict) const + { + return T::New(dict); + } };