functionEntry.C
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
00027 #include "functionEntry.H"
00028
00029
00030
00031 namespace Foam
00032 {
00033 defineMemberFunctionSelectionTable
00034 (
00035 functionEntry,
00036 execute,
00037 dictionaryIstream
00038 );
00039
00040 defineMemberFunctionSelectionTable
00041 (
00042 functionEntry,
00043 execute,
00044 primitiveEntryIstream
00045 );
00046 }
00047
00048
00049
00050
00051 bool Foam::functionEntry::execute
00052 (
00053 const word& functionName,
00054 dictionary& parentDict,
00055 Istream& is
00056 )
00057 {
00058 is.fatalCheck
00059 (
00060 "functionEntry::execute"
00061 "(const word& functionName, dictionary& parentDict, Istream&)"
00062 );
00063
00064 if (!executedictionaryIstreamMemberFunctionTablePtr_)
00065 {
00066 cerr<<"functionEntry::execute"
00067 << "(const word&, dictionary&, Istream&)"
00068 << " not yet initialized, function = "
00069 << functionName.c_str() << std::endl;
00070
00071
00072 return true;
00073 }
00074
00075 executedictionaryIstreamMemberFunctionTable::iterator mfIter =
00076 executedictionaryIstreamMemberFunctionTablePtr_->find(functionName);
00077
00078 if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end())
00079 {
00080 FatalErrorIn
00081 (
00082 "functionEntry::execute"
00083 "(const word& functionName, dictionary& parentDict, Istream&)"
00084 ) << "Unknown functionEntry " << functionName
00085 << endl << endl
00086 << "Valid functionEntries are :" << endl
00087 << executedictionaryIstreamMemberFunctionTablePtr_->toc()
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 << endl << endl
00131 << "Valid functionEntries are :" << endl
00132 << executeprimitiveEntryIstreamMemberFunctionTablePtr_->toc()
00133 << exit(FatalError);
00134 }
00135
00136 return mfIter()(parentDict, entry, is);
00137 }
00138
00139
Copyright © 2000-2009 OpenCFD Ltd