34 template<
class T,
class Key,
class Hash>
38 is.fatalCheck(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)");
44 "HashPtrTable<T, Key, Hash>::read(Istream&, const INew&) : " 48 if (firstToken.isLabel())
50 label s = firstToken.labelToken();
53 char delimiter = is.readBeginList(
"HashPtrTable<T, Key, Hash>");
57 if (2*s > this->tableSize_)
62 if (delimiter == token::BEGIN_LIST)
68 this->
insert(key, inewt(key, is).ptr());
72 "HashPtrTable<T, Key, Hash>::" 73 "read(Istream&, const INew&) : reading entry" 82 ) <<
"incorrect first token, '(', found " << firstToken.info()
88 is.readEndList(
"HashPtrTable");
90 else if (firstToken.isPunctuation())
92 if (firstToken.pToken() != token::BEGIN_LIST)
97 ) <<
"incorrect first token, '(', found " << firstToken.info()
105 lastToken.isPunctuation()
106 && lastToken.pToken() == token::END_LIST
110 is.putBack(lastToken);
113 this->
insert(key, inewt(key, is).ptr());
117 "HashPtrTable<T, Key, Hash>::read(Istream&, const INew&) : " 129 ) <<
"incorrect first token, expected <int> or '(', found " 134 is.fatalCheck(
"HashPtrTable<T, Key, Hash>::read(Istream&, const INew&)");
138 template<
class T,
class Key,
class Hash>
142 const dictionary& dict,
151 inewt(dict.subDict(iter().keyword())).ptr()
157 template<
class T,
class Key,
class Hash>
164 iter = this->begin();
169 const T* ptr = iter();
177 template<
class T,
class Key,
class Hash>
181 this->
read(is, inewt);
185 template<
class T,
class Key,
class Hash>
192 template<
class T,
class Key,
class Hash>
201 template<
class T,
class Key,
class Hash>
211 template<
class T,
class Key,
class Hash>
219 os <<
nl << L.
size() <<
nl << token::BEGIN_LIST <<
nl;
229 os << iter.key() << token::SPACE << *iter() <<
nl;
233 os << token::END_LIST;
236 os.check(
"Ostream& operator<<(Ostream&, const HashPtrTable&)");
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
HashPtrTable(const label size=128)
Construct given initial table size.
An STL-conforming const_iterator.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static iteratorEnd end()
iteratorEnd set to beyond the end of any HashTable
A list of keyword definitions, which are a keyword followed by any number of values (e...
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
label size() const
Return number of elements in table.
A HashTable specialization for hashing pointers.
void clear()
Clear all entries from table.
bool read(const char *, int32_t &)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Istream & operator>>(Istream &, directionInfo &)
timeIndices insert(timeIndex, timeDirs[timeI].value())
triSurfaceToAgglom resize(surfacesMesh.size())
iterator begin()
Iterator set to the beginning of the HashTable.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
A helper class when constructing from an Istream or dictionary.
void write(Ostream &os) const
Write.