mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added INew construct from dictionary
This commit is contained in:
@ -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<T> operator()(Istream& is) const
|
||||
{
|
||||
return T::New(is);
|
||||
}
|
||||
|
||||
//- Construct from word and Istream
|
||||
autoPtr<T> operator()(const word&, Istream& is) const
|
||||
{
|
||||
return T::New(is);
|
||||
}
|
||||
|
||||
//- Construct from dictionary
|
||||
autoPtr<T> operator()(const dictionary& dict) const
|
||||
{
|
||||
return T::New(dict);
|
||||
}
|
||||
|
||||
//- Construct from word and dictionary
|
||||
autoPtr<T> operator()(const word&, const dictionary& dict) const
|
||||
{
|
||||
return T::New(dict);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user