Commit 6840fa31 authored by andy's avatar andy
Browse files

ENH: demandDrivenEntry - added initialise function

parent 66fdc593
......@@ -105,6 +105,9 @@ public:
// Public Member Functions
//- Initialise
inline void initialise() const;
//- Return the value
inline const Type& value() const;
......
......@@ -28,13 +28,20 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
inline const Type& Foam::demandDrivenEntry<Type>::value() const
inline void Foam::demandDrivenEntry<Type>::initialise() const
{
if (!stored_)
{
dict_.lookup(keyword_) >> value_;
stored_ = true;
}
}
template<class Type>
inline const Type& Foam::demandDrivenEntry<Type>::value() const
{
initialise();
return value_;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment