|
[Sponsors] |
|
December 31, 2019, 16:10 |
IstreamConstructorTablePtr
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51 |
Hi all,
I also have another question that I do not get at the moment. We have the object named IstreamConstructorTablePtr_ in the ddtScheme class. See code snippet below. Code:
template<class Type> tmp<ddtScheme<Type>> ddtScheme<Type>::New ( const fvMesh& mesh, Istream& schemeData ) { if (fv::debug) { InfoInFunction << "Constructing ddtScheme<Type>" << endl; } if (schemeData.eof()) { FatalIOErrorInFunction ( schemeData ) << "Ddt scheme not specified" << endl << endl << "Valid ddt schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } const word schemeName(schemeData); typename IstreamConstructorTable::iterator cstrIter = IstreamConstructorTablePtr_->find(schemeName); if (cstrIter == IstreamConstructorTablePtr_->end()) { FatalIOErrorInFunction ( schemeData ) << "Unknown ddt scheme " << schemeName << nl << nl << "Valid ddt schemes are :" << endl << IstreamConstructorTablePtr_->sortedToc() << exit(FatalIOError); } return cstrIter()(mesh, schemeData); } However, I cannot determine where the object is created or initiated.
__________________
Keep foaming, Tobias Holzmann |
|
January 2, 2020, 12:46 |
|
#2 |
Senior Member
Sergei
Join Date: Dec 2009
Posts: 261
Rep Power: 21 |
Hi.
Declaration and definition of IstreamConstructorTablePtr_ are done in ddtScheme class with two macros: declareRunTimeSelectionTable and defineRunTimeSelectionTable I presented some thoughts on the subject in the thread Runtime Type Selection. Check it out. |
|
|
|