www.cemf.ir
dictionary.cpp
Go to the documentation of this file.
1 /*------------------------------- phasicFlow ---------------------------------
2  O C enter of
3  O O E ngineering and
4  O O M ultiscale modeling of
5  OOOOOOO F luid flow
6 ------------------------------------------------------------------------------
7  Copyright (C): www.cemf.ir
8  email: hamid.r.norouzi AT gmail.com
9 ------------------------------------------------------------------------------
10 Licence:
11  This file is part of phasicFlow code. It is a free software for simulating
12  granular and multiphase flows. You can redistribute it and/or modify it under
13  the terms of GNU General Public License v3 or any other later versions.
14 
15  phasicFlow is distributed to help others in their research in the field of
16  granular and multiphase flows, but WITHOUT ANY WARRANTY; without even the
17  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 
19 -----------------------------------------------------------------------------*/
20 // based on OpenFOAM dictionary, with some modifications/simplifications
21 // to be tailored to our needs
22 
23 
24 #include "dictionary.hpp"
25 #include "uniquePtr.hpp"
26 #include "error.hpp"
27 #include "streams.hpp"
28 
29 
30 
32 
33 
34 // better to move it to the abstract class
35 // with an static member function.
37 (
38  iIstream & is
39 )
40 {
41  // ensure that the entry list of new the dicrionary is empty
42  entries_.clear();
43 
44 
45  // empty dictionary
46  if (is.eof())
47  {
48  return true;
49  }
50 
51  if (!is.good())
52  {
53  ioErrorInFile( is.name(), is.lineNumber() )<<
54  "iIstream is not good for reading tokens .... \n";
55  return false;
56  }
57 
58 
59  // reads tokens one-by-one
60  token nextTok(is);
61  if( nextTok == token::END_BLOCK)
62  {
63  ioErrorInFile( is.name(), is.lineNumber() )<<
64  "Not expecting a } for the start of a dictionray \n";
65  return false;
66  }
67 
68  bool hasBlockToken = true;
69 
70  // this is a sub-dict, so it should start with {
71  if(nextTok != token::BEGIN_BLOCK)
72  {
73  hasBlockToken = false;
74  is.putBack(nextTok);
75  }
76 
77 
78  //read all entries in ths dictionary
79  while ( !is.eof() && iEntry::createEntry(*this, is, hasBlockToken) )
80  {}
81 
82 
83  return true;
84 }
85 
87 (
88  iOstream& os,
89  bool withBlock
90 )const
91 {
92  if(withBlock) os.beginBlock(keyword());
93 
94  for( const auto& e:orderedEntries_)
95  {
96  if(e != nullptr )
97  e->write(os);
98  }
99  if(withBlock) os.endBlock();
100 
101  return true;
102 
103 }
104 
106 (
107  const word& keyword
108 )
109 {
110  if( auto [ptr, exist] = entries_.find(keyword); exist)
111  {
112 
113  return ptr;
114 
115  }
116 
117  return nullptr;
118 }
119 
121 (
122  const word& keyword
123 )const
124 {
125  if( auto [ptr, exist] = entries_.find(keyword); exist)
126  {
127  return const_cast<iEntry*> (ptr);
128  }
129 
130  return nullptr;
131 }
132 
133 
135 ()
136 :
137  iEntry("NULL_DICT"),
138  name_("NULL_DICT"),
139  entries_(),
140  orderedEntries_(),
141  parDict_(dictionary::nullDict),
142  isGlobal_(false)
143 {}
144 
146 (
147  const word& keyword
148 )
149 :
150  iEntry(keyword),
151  name_(keyword),
152  entries_(),
153  orderedEntries_(),
154  parDict_(dictionary::nullDict),
155  isGlobal_(false)
156 {}
157 
158 
160 (
161  const word& keyword,
162  bool global
163 )
164 :
165  iEntry(keyword),
166  name_(keyword),
167  entries_(),
168  orderedEntries_(),
169  parDict_(dictionary::nullDict),
170  isGlobal_(global)
171 {
172 }
173 
175 (
176  const word& keyword,
177  const fileSystem& file
178 )
179 :
180  iEntry(keyword),
181  name_(file.wordPath()),
182  entries_(),
183  orderedEntries_(),
184  parDict_(dictionary::nullDict),
185  isGlobal_(true)
186 {
187  iFstream dictStream(file);
188 
189  if(!read(dictStream))
190  {
191  ioErrorInFile(dictStream.name(), dictStream.lineNumber())<<
192  "error in reading dictionary from file "<< file <<endl;
193  fatalExit;
194  }
195 
196 }
197 
199 (
200  const word& keyword,
201  const dictionary& parDict
202 )
203 :
204  iEntry(keyword),
205  name_(groupNames(parDict.globalName(), keyword)),
206  entries_(),
207  orderedEntries_(),
208  parDict_(parDict),
209  isGlobal_(false)
210 {
211 
212 }
213 
215 (
216  const word& keyword,
217  const dictionary& parDict,
218  iIstream& is
219 )
220 :
221  iEntry(keyword),
222  name_(groupNames(parDict.globalName(), keyword)),
223  entries_(),
224  orderedEntries_(),
225  parDict_(parDict),
226  isGlobal_(false)
227 {
228 
229  if( !readDictionary(is) )
230  {
231  ioErrorInFile(is.name(), is.lineNumber()) <<
232  "error in reading dictionary " << name_ <<endl;
233  fatalExit;
234  }
235 }
236 
238 (
239  const word& keyword,
240  const dictionary& parDict,
241  const dictionary& dict
242 )
243 :
244  iEntry(keyword),
245  name_(groupNames(parDict.globalName(),keyword)),
246  entries_(),
247  orderedEntries_(),
248  parDict_(parDict),
249  isGlobal_(false)
250 {
251 
252  for( auto& entry : dict.orderedEntries_ )
253  {
254  if(entry)
255  {
256  auto ptr = entry->clone(*this);
257  auto key = entry->name();
258 
259  if( !addPtr(key, ptr) )
260  {
262  " error in cloning dicrionary / dataEntry " << entry->globalName() <<endl;
263  fatalExit;
264  }
265  }
266  }
267 
268 }
269 
271 (
272  const dictionary& src
273 )
274 :
275  iEntry(src.keyword()),
276  name_(src.keyword()),
277  entries_(),
278  orderedEntries_(),
279  parDict_(dictionary::nullDict),
280  isGlobal_(src.isGlobal_)
281 {
282 
283  for( auto& entry: src.orderedEntries_)
284  {
285 
286  if(entry)
287  {
288  auto ptr = entry->clone(*this);
289  auto key = entry->name();
290 
291  if( !addPtr(key, ptr) )
292  {
294  " error in cloning dicrionary / dataEntry " << entry->globalName() <<endl;
295  fatalExit;
296  }
297  }
298  }
299 
300 }
301 
303 :
304  dictionary(src)
305 {
306  isGlobal_ = global;
307 }
308 
309 pFlow::dictionary& pFlow::dictionary::operator=
310 (
311  const dictionary& rhs
312 )
313 {
314 
315  if( &rhs == this)return *this;
316 
317  clear();
318 
319  for( auto& entry: rhs.orderedEntries_)
320  {
321 
322  if(entry)
323  {
324  auto ptr = entry->clone(*this);
325  auto key = entry->name();
326 
327  if( !addPtr(key, ptr) )
328  {
330  " error in cloning dicrionary / dataEntry " << entry->globalName() <<endl;
331  fatalExit;
332  }
333  }
334  }
335 
336  return *this;
337 }
338 
340 {
341  return this;
342 }
343 
344 
346 {
347  return this;
348 }
349 
350 
352 {
353  return true;
354 }
355 
357 {
358  return name_;
359 }
360 
361 
363 {
364  return parDict_;
365 }
366 
367 
368 
370 {
371  return *this;
372 }
373 
374 
376 {
377  return *this;
378 }
379 
381 {
382  return isGlobal_;
383 }
384 
386 (
387  const word& keyword,
388  uniquePtr<iEntry>& entry,
389  bool warning
390 )
391 {
392 
393  if(entry == nullptr) return false;
394 
395  iEntry* oldEntryPtr = nullptr;
396  iEntry* newEntryPtr = entry.get();
397 
398  // search all entries for repeated keyword
399  if(auto [ptr, exist] = entries_.find(keyword); exist )
400  {
401  if(warning)
402  {
404  "keyword " << keyword << " already exists in the dicrionary " <<
405  this->globalName() << ". The old entry will be replaced by the new one. \n";
406  }
407 
408  // store the old pointer to entry
409  oldEntryPtr = ptr;
410  }
411 
412 
413  if( entries_.insertReplace(keyword, entry) )
414  {
415 
416  if(oldEntryPtr)
417  {
418  // this should be replaced
419  auto oIter = orderedEntries_.find(oldEntryPtr);
420  *oIter = newEntryPtr;
421  }
422  else
423  {
424  orderedEntries_.push_back(newEntryPtr);
425  }
426  return true;
427  }else
428  {
429  return false;
430  }
431 
432 }
433 
435 (
436  const word& keyword,
437  const float& v
438 )
439 {
440  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
441  return addPtr(keyword, ptr);
442 }
443 
445 (
446  const word& keyword,
447  const double& v
448 )
449 {
450  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
451  return addPtr(keyword, ptr);
452 }
453 
455 (
456  const word& keyword,
457  const word& v
458 )
459 {
460  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
461  return addPtr(keyword, ptr);
462 }
463 
465 (
466  const word& keyword,
467  const int64& v
468 )
469 {
470  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
471  return addPtr(keyword, ptr);
472 }
473 
475 (
476  const word& keyword,
477  const int32& v
478 )
479 {
480  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
481  return addPtr(keyword, ptr);
482 }
483 
484 
486 (
487  const word& keyword,
488  const int8& v
489 )
490 {
491  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
492  return addPtr(keyword, ptr);
493 }
494 
496 (
497  const word& keyword,
498  const uint64& v
499 )
500 {
501  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
502  return addPtr(keyword, ptr);
503 }
504 
506 (
507  const word& keyword,
508  const uint32& v
509 )
510 {
511  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
512  return addPtr(keyword, ptr);
513 }
514 
516 (
517  const word& keyword,
518  const uint8& v
519 )
520 {
521  uniquePtr<iEntry> ptr = makeUnique<dataEntry>(keyword, *this, token(v));
522  return addPtr(keyword, ptr);
523 }
524 
526 (
527  const word& keyword,
528  const dictionary& dict
529 )
530 {
531  uniquePtr<iEntry> ptr = makeUnique<dictionary>(keyword, *this, dict);
532  return addPtr(keyword, ptr);
533 }
534 
536 {
537  orderedEntries_.clear();
538  entries_.clear();
539 }
540 
542 (
543  const word& keyword
544 )
545 {
546  if( auto entry = findEntry(keyword); entry!= nullptr && entry->isDictionary() )
547  {
548  return dynamic_cast<dictionary*>(entry);
549  }
550  else
551  {
553  "keyword " << keyword<< " is not an sub-dictionary of " << this->globalName()<<endl;
554  fatalExit;
555  return this;
556  }
557 }
558 
560 (
561  const word& keyword
562 )
563 {
564 
565  if( auto entry = findEntry(keyword); entry!= nullptr && entry->isDictionary() )
566  {
567  return dynamic_cast<dictionary&>(*entry);
568  }
569  else
570  {
572  "keyword " << keyword<< " is not an sub-dictionary of " << this->globalName()<<endl;
573  fatalExit;
574  return *this;
575  }
576 
577 }
578 
580 (
581  const word& keyword
582 ) const
583 {
584 
585  if( auto entry = findEntry(keyword); entry!= nullptr && entry->isDictionary() )
586  {
587  return dynamic_cast<dictionary&>(*entry);
588  }
589  else
590  {
592  "keyword " << keyword<< " is not an sub-dictionary of " << this->globalName()<<endl;
593  fatalExit;
594  return *this;
595  }
596 }
597 
599 {
600  if( auto entry = findEntry(keyword); entry && !entry->isDictionary() )
601  {
602  return dynamic_cast<dataEntry*>(entry);
603  }
604  else
605  {
607  "keyword " << keyword<< " is not a dataEntry of " << this->globalName()<<endl;
608  fatalExit;
609  return nullptr;
610  }
611 }
612 
614 {
615  if( auto entry = findEntry(keyword); entry && !entry->isDictionary() )
616  {
617  return dynamic_cast<dataEntry&>(*entry);
618  }
619  else
620  {
622  "keyword " << keyword<< " is not a dataEntry of " << this->globalName()<<endl;
623  fatalExit;
624  return dataEntry::nullDataEntry;
625  }
626 }
627 
629 (
630  const word& keyword
631 )const
632 {
633  if( auto entry = findEntry(keyword); entry && !entry->isDictionary() )
634  {
635  return dynamic_cast<dataEntry&>(*entry);
636  }
637  else
638  {
640  "keyword " << keyword<< " is not a dataEntry of " << this->globalName()<<endl;
641  fatalExit;
642  return dataEntry::nullDataEntry;
643  }
644 }
645 
647 (
648  const word& keyword
649 )
650 {
651  if( auto entry = findEntry(keyword); entry!= nullptr && entry->isDictionary() )
652  {
653  return dynamic_cast<dictionary&>(*entry);
654  }
655  else
656  {
657  uniquePtr<iEntry> ptr = makeUnique<dictionary>(keyword, *this);
658  if( addPtr
659  (
660  keyword,
661  ptr
662  )
663  )
664  {
665  return subDictOrCreate(keyword);
666  }
667  else
668  {
670  "Unable to create sub-dictionary "<< keyword << " in dictionary " << globalName() <<endl;
671  fatalExit;
672  }
673  }
674  return *this;
675 }
676 
678 {
679  return entries_.size();
680 }
681 
683 {
684  size_t num = 0;
685  for(auto& e:entries_)
686  {
687  if( e.second && !e.second->isDictionary())
688  {
689  num++;
690  }
691  }
692  return num;
693 }
694 
696 {
697  size_t num = 0;
698  for(auto& e:entries_)
699  {
700  if( e.second && e.second->isDictionary())
701  {
702  num++;
703  }
704  }
705  return num;
706 }
707 
709 {
710  wordList wl;
711 
712  for(auto oe:orderedEntries_)
713  {
714  if(oe) wl.push_back( oe->keyword() );
715  }
716  return wl;
717 }
718 
720 {
721  wordList wl;
722 
723  for(auto oe:orderedEntries_)
724  {
725  if( oe && !oe->isDictionary())
726  {
727  wl.push_back(oe->keyword());
728  }
729  }
730  return wl;
731 }
732 
733 // return a list of all dictionary keywords
735 {
736  wordList wl;
737 
738  for(auto& oe:orderedEntries_)
739  {
740  if( oe && oe->isDictionary())
741  {
742  wl.push_back(oe->keyword());
743  }
744  }
745  return wl;
746 }
747 
749 (
750  const word& name
751 )const
752 {
753  if( auto ptr = findEntry(name); ptr)
754  {
755  return ptr->isDictionary();
756  }
757  return false;
758 }
759 
761 (
762  const word& name
763 )const
764 {
765  if( auto ptr = findEntry(name); ptr)
766  {
767  return !ptr->isDictionary();
768  }
769  return false;
770 }
771 
773 {
774  token tok;
775  if(!isFileDict() && !readKeyword(is, keyword_, tok))
776  {
777  ioErrorInFile(is.name(), is.lineNumber()) <<
778  "expected a valid keyword for dictionary but found " << tok <<endl;
779  fatalExit;
780  }
781 
782  if( !readDictionary(is) )
783  {
784  ioErrorInFile(is.name(), is.lineNumber()) <<
785  "error in reading dictionary " << keyword_ <<endl;
786  fatalExit;
787  }
788 
789  return true;
790 }
791 
792 
794 {
795  if(! writeDictionary(os, !isFileDict()) )
796  {
797  ioErrorInFile( os.name(), os.lineNumber());
798  fatalExit;
799  }
800  return true;
801 }
802 
803 
805 {
806  return makeUnique<dictionary>(*this);
807 }
808 
809 
811 {
812 
813  auto ptr = makeUnique<dictionary>(*this);
814  return ptr.release();
815 }
816 
818 (
819  const dictionary& parDict
820 ) const
821 {
822  return makeUnique<dictionary>(this->keyword(), parDict, *this);
823 }
824 
826 (
827  const dictionary& parDict
828 ) const
829 {
830  auto ptr = makeUnique<dictionary>(this->keyword(), parDict, *this);
831  return ptr.release();
832 }
pFlow::IOstream::eof
bool eof() const
Return true if end of input seen.
Definition: IOstream.hpp:192
pFlow::iOstream::beginBlock
virtual iOstream & beginBlock(const word &kw)
Write begin block group with a name Increments indentation, adds newline.
Definition: iOstream.cpp:77
pFlow::dictionary::orderedEntries_
List< iEntry * > orderedEntries_
entries in order of insertion
Definition: dictionary.hpp:82
pFlow::List< word >
pFlow::iOstream::write
virtual bool write(const token &tok)=0
Write token to stream or otherwise handle it.
pFlow::iEntry::clone
virtual uniquePtr< iEntry > clone() const =0
fatalExit
#define fatalExit
Fatal exit.
Definition: error.hpp:98
pFlow::token
Token class based on OpenFOAM stream, with some modifications/simplifications to be tailored to our n...
Definition: token.hpp:44
pFlow::dictionary::read
bool read(iIstream &is) override
read from stream
Definition: dictionary.cpp:772
pFlow::iOstream::endBlock
virtual iOstream & endBlock()
Write end block group Decrements indentation, adds newline.
Definition: iOstream.cpp:95
pFlow::dictionary::allKeywords
wordList allKeywords() const
return all keywords (non-nullptr) in this dictionary
Definition: dictionary.cpp:708
warningInFunction
#define warningInFunction
Report a warning.
Definition: error.hpp:95
pFlow::dictionary::findEntry
iEntry * findEntry(const word &keyword)
find an entry based on keyword return nullptr if not found
Definition: dictionary.cpp:106
pFlow::uint32
unsigned int uint32
Definition: builtinTypes.hpp:56
pFlow::dictionary::isGlobal_
bool isGlobal_
Definition: dictionary.hpp:87
pFlow::word
std::string word
Definition: builtinTypes.hpp:64
pFlow::int64
long long int int64
Definition: builtinTypes.hpp:52
pFlow::dictionary::globalName
virtual word globalName() const
global name of entry, separated with dots
Definition: dictionary.cpp:356
pFlow::Istream::name
virtual const word & name() const
Return the name of the stream.
Definition: Istream.hpp:81
pFlow::dictionary::subDictOrCreate
dictionary & subDictOrCreate(const word &keyword)
search for a sub-dict with keyword create a new sub-dict if not found and return a ref to it fatalExi...
Definition: dictionary.cpp:647
pFlow::dictionary::add
bool add(const word &keyword, const float &v)
add a float dataEntry
Definition: dictionary.cpp:435
pFlow::iEntry::keyword
virtual const word & keyword() const
return keyword
Definition: iEntry.hpp:88
pFlow::dictionary::isDictionary
virtual bool isDictionary() const
if this is a dictionary
Definition: dictionary.cpp:351
pFlow::endl
iOstream & endl(iOstream &os)
Add newline and flush stream.
Definition: iOstream.hpp:341
pFlow::dictionary::nullDict
static dictionary nullDict
Definition: dictionary.hpp:116
pFlow::iFstream
Input file stream for reading binary or ascii data from a file.
Definition: iFstream.hpp:37
pFlow::dictionary::clonePtr
virtual iEntry * clonePtr() const
clone the object
Definition: dictionary.cpp:810
pFlow::dictionary::containsDataEntry
bool containsDataEntry(const word &name) const
check if a data entry exist
Definition: dictionary.cpp:761
pFlow::dictionary::dictionaryKeywords
wordList dictionaryKeywords() const
return a list of all dictionary (non-null) keywords
Definition: dictionary.cpp:734
pFlow::dictionary::dictPtr
virtual dictionary * dictPtr()
pointer to this dictionary
Definition: dictionary.cpp:339
pFlow::fileSystem
Manages file pathes, manupulate and combines them.
Definition: fileSystem.hpp:71
pFlow::dictionary::containsDictionay
bool containsDictionay(const word &name) const
check if a sub-dictionary exists
Definition: dictionary.cpp:749
uniquePtr.hpp
pFlow::dataEntry
Data entry to be used in dictionries.
Definition: dataEntry.hpp:48
pFlow::dictionary::numEntries
size_t numEntries() const
return number of entris in this dictionary
Definition: dictionary.cpp:677
pFlow::iIstream
Interface class for any input stream
Definition: iIstream.hpp:37
pFlow::dictionary::clone
virtual uniquePtr< iEntry > clone() const
clone polymorphic object (here dictionary)
Definition: dictionary.cpp:804
pFlow::dictionary::dataEntryPtr
dataEntry * dataEntryPtr(const word &keyword)
pointer to a dataEntry fatalExit if not found/not a dataEntry
Definition: dictionary.cpp:598
fatalErrorInFunction
#define fatalErrorInFunction
Report a fatal error and function name and exit the application.
Definition: error.hpp:77
pFlow::int32
int int32
Definition: builtinTypes.hpp:50
pFlow::dictionary::isFileDict
virtual bool isFileDict() const
if dictionary is file dictionary, return false
Definition: dictionary.cpp:380
pFlow::dictionary::dict
virtual dictionary & dict()
ref to this dictionary, if it is a dictionary
Definition: dictionary.cpp:369
pFlow::dictionary::readDictionary
bool readDictionary(iIstream &is)
read dictionary from stream - without keyword
Definition: dictionary.cpp:37
dictionary.hpp
pFlow::dictionary::writeDictionary
bool writeDictionary(iOstream &os, bool withBlock=true) const
write dictionary to stream - with keyword
Definition: dictionary.cpp:87
pFlow::iIstream::putBack
void putBack(const token &tok)
Put back token Only a single put back is permitted.
Definition: iIstream.cpp:23
pFlow::dictionary::numDataEntries
size_t numDataEntries() const
return number of non-nullptr dataEntries
Definition: dictionary.cpp:682
pFlow::dictionary::dataEntryRef
dataEntry & dataEntryRef(const word &keyword)
ref to a subdictioanry fatalExit if not found/not a dataEntry
Definition: dictionary.cpp:613
pFlow::dictionary::write
bool write(iOstream &os) const override
write to stream
Definition: dictionary.cpp:793
pFlow::dictionary::subDictPtr
dictionary * subDictPtr(const word &keyword)
pointer to a subdictionary fatalExit if not found
Definition: dictionary.cpp:542
pFlow::IOstream::name
virtual const word & name() const
Return the name of the stream.
Definition: IOstream.cpp:31
pFlow::dictionary::subDict
dictionary & subDict(const word &keyword)
ref to a subdictioanry fatalExit if not found
Definition: dictionary.cpp:560
streams.hpp
pFlow::IOstream::good
bool good() const
Return true if next operation might succeed.
Definition: IOstream.hpp:186
pFlow::dataEntry::nullDataEntry
static dataEntry nullDataEntry
Definition: dataEntry.hpp:74
pFlow::dictionary::addPtr
bool addPtr(const word &keyword, uniquePtr< iEntry > &etry, bool warning=true)
add a pointer entry (dictionary/dataEntry) replaces this entry with existing one and issue a warning
Definition: dictionary.cpp:386
pFlow::uniquePtr
Definition: uniquePtr.hpp:42
pFlow::groupNames
word groupNames(const word &bw, const word &tw, char sep='.')
Group words and output bw.tw.
Definition: bTypesFunctions.cpp:179
ioErrorInFile
#define ioErrorInFile(fileName, lineNumber)
Report an error in file operation with supplied fileName and lineNumber.
Definition: error.hpp:87
pFlow::uint64
unsigned long long int uint64
Definition: builtinTypes.hpp:58
pFlow::iEntry
Interface calss for data entry and dictionary
Definition: iEntry.hpp:42
pFlow::dictionary::dictionary
dictionary()
cunstructs a null dictionary
Definition: dictionary.cpp:135
pFlow::dictionary::clear
void clear()
Definition: dictionary.cpp:535
pFlow::int8
signed char int8
Definition: builtinTypes.hpp:48
pFlow::IOstream::lineNumber
int32 lineNumber() const
Const access to the current stream line number.
Definition: IOstream.hpp:223
pFlow::fileSystem::wordPath
word wordPath() const
Path in word type.
Definition: fileSystem.hpp:160
pFlow::dictionary::addDict
bool addDict(const word &keyword, const dictionary &dict)
add a dictionary with the specifiedd keyword, if it exists, replace it.
Definition: dictionary.cpp:526
pFlow::dictionary::numDictionaries
size_t numDictionaries() const
return number of non-nullptr dictionaries
Definition: dictionary.cpp:695
pFlow::uint8
unsigned char uint8
Definition: builtinTypes.hpp:54
pFlow::dictionary::parrentDict
virtual const dictionary & parrentDict() const
const ref to parrent dictionary
Definition: dictionary.cpp:362
pFlow::iOstream
Interface class for any output stream.
Definition: iOstream.hpp:59
pFlow::dictionary::dataEntryKeywords
wordList dataEntryKeywords() const
return a list of all dataEntries (non-nullptr) keywords
Definition: dictionary.cpp:719
pFlow::dictionary
Dictionary holds a set of data entries or sub-dictionaries that are enclosed in a curely braces or ar...
Definition: dictionary.hpp:67
error.hpp