mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- use the dictionary 'get' methods instead of readScalar for
additional checking
Unchecked: readScalar(dict.lookup("key"));
Checked: dict.get<scalar>("key");
- In templated classes that also inherit from a dictionary, an additional
'template' keyword will be required. Eg,
this->coeffsDict().template get<scalar>("key");
For this common use case, the predefined getXXX shortcuts may be
useful. Eg,
this->coeffsDict().getScalar("key");
This commit is contained in:
@ -33,10 +33,10 @@ template<class Type>
|
||||
Foam::csvTableReader<Type>::csvTableReader(const dictionary& dict)
|
||||
:
|
||||
tableReader<Type>(dict),
|
||||
headerLine_(readBool(dict.lookup("hasHeaderLine"))),
|
||||
timeColumn_(readLabel(dict.lookup("timeColumn"))),
|
||||
headerLine_(dict.get<bool>("hasHeaderLine")),
|
||||
timeColumn_(dict.get<label>("timeColumn")),
|
||||
componentColumns_(dict.lookup("valueColumns")),
|
||||
separator_(dict.lookupOrDefault<string>("separator", string(","))[0])
|
||||
separator_(dict.lookupOrDefault<string>("separator", ",")[0])
|
||||
{
|
||||
if (componentColumns_.size() != pTraits<Type>::nComponents)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user