Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include <OpenFOAM/functionEntry.H>
00027
00028
00029
00030 namespace Foam
00031 {
00032 defineMemberFunctionSelectionTable
00033 (
00034 functionEntry,
00035 execute,
00036 dictionaryIstream
00037 );
00038
00039 defineMemberFunctionSelectionTable
00040 (
00041 functionEntry,
00042 execute,
00043 primitiveEntryIstream
00044 );
00045 }
00046
00047
00048
00049
00050 bool Foam::functionEntry::execute
00051 (
00052 const word& functionName,
00053 dictionary& parentDict,
00054 Istream& is
00055 )
00056 {
00057 is.fatalCheck
00058 (
00059 "functionEntry::execute"
00060 "(const word& functionName, dictionary& parentDict, Istream&)"
00061 );
00062
00063 if (!executedictionaryIstreamMemberFunctionTablePtr_)
00064 {
00065 cerr<<"functionEntry::execute"
00066 << "(const word&, dictionary&, Istream&)"
00067 << " not yet initialized, function = "
00068 << functionName.c_str() << std::endl;
00069
00070
00071 return true;
00072 }
00073
00074 executedictionaryIstreamMemberFunctionTable::iterator mfIter =
00075 executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
00076
00077 if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
00078 {
00079 FatalErrorIn
00080 (
00081 "functionEntry::execute"
00082 "(const word& functionName, dictionary& parentDict, Istream&)"
00083 ) << "Unknown functionEntry '" << functionName
00084 << "' in " << is.name() << " near line " << is.lineNumber()
00085 << endl << endl
00086 << "Valid functionEntries are :" << endl
00087 << executedictionaryIstreamMemberFunctionTablePtr_->sortedToc()
00088 << exit(FatalError);
00089 }
00090
00091 return mfIter()(parentDict, is);
00092 }
00093
00094
00095 bool Foam::functionEntry::execute
00096 (
00097 const word& functionName,
00098 const dictionary& parentDict,
00099 primitiveEntry& entry,
00100 Istream& is
00101 )
00102 {
00103 is.fatalCheck
00104 (
00105 "functionEntry::execute"
00106 "(const word&, const dictionary&, primitiveEntry&, Istream&)"
00107 );
00108
00109 if (!executeprimitiveEntryIstreamMemberFunctionTablePtr_)
00110 {
00111 cerr<<"functionEntry::execute"
00112 << "(const word&, const dictionary&, primitiveEntry&, Istream&)"
00113 << " not yet initialized, function = "
00114 << functionName.c_str() << std::endl;
00115
00116
00117 return true;
00118 }
00119
00120 executeprimitiveEntryIstreamMemberFunctionTable::iterator mfIter =
00121 executeprimitiveEntryIstreamMemberFunctionTablePtr_->find(functionName);
00122
00123 if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end())
00124 {
00125 FatalErrorIn
00126 (
00127 "functionEntry::execute"
00128 "(const word&, const dictionary&, primitiveEntry&, Istream&)"
00129 ) << "Unknown functionEntry '" << functionName
00130 << "' in " << is.name() << " near line " << is.lineNumber()
00131 << endl << endl
00132 << "Valid functionEntries are :" << endl
00133 << executeprimitiveEntryIstreamMemberFunctionTablePtr_->sortedToc()
00134 << exit(FatalError);
00135 }
00136
00137 return mfIter()(parentDict, entry, is);
00138 }
00139
00140