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 "dlLibraryTable.H"
00027 #include <OpenFOAM/dictionary.H>
00028 #include <OpenFOAM/fileNameList.H>
00029
00030
00031
00032 template<class TablePtr>
00033 bool Foam::dlLibraryTable::open
00034 (
00035 const dictionary& dict,
00036 const word& libsEntry,
00037 const TablePtr& tablePtr
00038 )
00039 {
00040 if (dict.found(libsEntry))
00041 {
00042 fileNameList libNames(dict.lookup(libsEntry));
00043
00044 bool allOpened = (libNames.size() > 0);
00045
00046 forAll(libNames, i)
00047 {
00048 const fileName& libName = libNames[i];
00049
00050 label nEntries = 0;
00051
00052 if (tablePtr)
00053 {
00054 nEntries = tablePtr->size();
00055 }
00056
00057 bool opened = dlLibraryTable::open(libName);
00058 allOpened = opened && allOpened;
00059
00060 if (opened && (!tablePtr || tablePtr->size() <= nEntries))
00061 {
00062 WarningIn
00063 (
00064 "dlLibraryTable::open"
00065 "(const dictionary& dict, const word& libsEntry, "
00066 "const TablePtr tablePtr)"
00067 ) << "library " << libName
00068 << " did not introduce any new entries"
00069 << endl << endl;
00070 }
00071 }
00072
00073 return allOpened;
00074 }
00075 else
00076 {
00077 return false;
00078 }
00079 }
00080
00081
00082