70 PP_UseCount (
const PP_UseCount& rhs);
76 PP_UseCount& operator= (
const PP_UseCount& rhs);
88 int linkCount ()
const;
107 PP_UseCount::PP_UseCount ()
109 cnt(
new unsigned int(1))
114 PP_UseCount::PP_UseCount (
const PP_UseCount& rhs)
123 PP_UseCount::unique ()
const 130 PP_UseCount::decrement ()
143 PP_UseCount::operator= (
const PP_UseCount& rhs)
152 PP_UseCount::~PP_UseCount ()
159 PP_UseCount::linkCount ()
const 207 PP_CpPtr (
const PP_CpPtr<T>& rhs);
212 PP_CpPtr<T>& operator= (T* rhs);
222 PP_CpPtr<T>& operator= (
const PP_CpPtr<T>& rhs);
233 bool isNull ()
const;
241 bool operator== (
const PP_CpPtr<T>& rhs)
const;
245 bool operator!= (
const PP_CpPtr<T>& rhs)
const;
265 class PP_CpClassPtr :
276 PP_CpClassPtr (T* rhs);
286 PP_CpClassPtr (
const PP_CpClassPtr<T>& rhs);
291 PP_CpClassPtr<T>& operator= (T* rhs);
301 PP_CpClassPtr<T>& operator= (
const PP_CpClassPtr<T>& rhs);
305 T* operator-> ()
const;
340 PP_LnPtr<T>& operator= (
const PP_LnPtr<T>& rhs);
346 PP_LnPtr<T>& operator= (T* rhs)
354 ucnt = PP_UseCount();
365 bool unique ()
const;
369 int linkCount ()
const;
380 bool isNull ()
const;
384 bool operator== (
const PP_LnPtr<T>& rhs)
const;
388 bool operator!= (
const PP_LnPtr<T>& rhs)
const;
421 PP_LnClassPtr (T* rhs);
428 PP_LnClassPtr<T>& operator= (
const PP_LnClassPtr<T>& rhs);
434 PP_LnClassPtr<T>& operator= (T* rhs);
438 T* operator->()
const;
447 PP_CpPtr<T>::PP_CpPtr ()
455 PP_CpPtr<T>::PP_CpPtr(T* rhs)
463 PP_CpPtr<T>::~PP_CpPtr()
471 PP_CpPtr<T>::isNull ()
const 478 PP_CpPtr<T>::PP_CpPtr (
const PP_CpPtr<T>& rhs)
480 ptr = rhs.isNull() ? 0 :
new T(*rhs.ptr);
486 PP_CpPtr<T>::operator= (
const PP_CpPtr<T>& rhs)
488 if (!(ptr == rhs.ptr))
491 ptr = rhs.isNull() ? 0 :
new T(*rhs.ptr);
499 PP_CpPtr<T>::operator= (T* rhs)
518 PP_CpPtr<T>::release ()
528 PP_CpPtr<T>::operator== (
const PP_CpPtr<T>& rhs)
const 530 return ptr == rhs.ptr;
536 PP_CpPtr<T>::operator!= (
const PP_CpPtr<T>& rhs)
const 538 return ptr != rhs.ptr;
543 PP_CpClassPtr<T>::PP_CpClassPtr ()
551 PP_CpClassPtr<T>::PP_CpClassPtr (T* rhs)
559 PP_CpClassPtr<T>::PP_CpClassPtr (
const PP_CpClassPtr<T>& rhs)
568 PP_CpClassPtr<T>::operator= (T* rhs)
570 PP_CpPtr<T>::operator= (rhs);
577 PP_CpClassPtr<T>::operator= (
const PP_CpClassPtr<T>& rhs)
579 PP_CpPtr<T>::operator= (rhs);
586 PP_CpClassPtr<T>::operator-> ()
const 593 PP_LnPtr<T>::PP_LnPtr ()
601 PP_LnPtr<T>::PP_LnPtr(T* rhs)
610 PP_LnPtr<T>::unique ()
const 612 return ucnt.unique();
617 PP_LnPtr<T>::~PP_LnPtr ()
626 PP_LnPtr<T>::operator= (
const PP_LnPtr<T>& rhs)
641 PP_LnPtr<T>::linkCount ()
const 643 return ucnt.linkCount();
658 PP_LnPtr<T>::isNull ()
const 666 PP_LnPtr<T>::operator== (
const PP_LnPtr<T>& rhs)
const 668 return ptr == rhs.ptr;
674 PP_LnPtr<T>::operator!= (
const PP_LnPtr<T>& rhs)
const 676 return ptr != rhs.ptr;
681 PP_LnClassPtr<T>::PP_LnClassPtr ()
687 PP_LnClassPtr<T>::PP_LnClassPtr (T* rhs)
696 PP_LnClassPtr<T>::operator= (
const PP_LnClassPtr<T>& rhs)
698 PP_LnPtr<T>::operator=(rhs);
705 PP_LnClassPtr<T>::operator= (T* rhs)
707 PP_LnPtr<T>::operator=(rhs);
714 PP_LnClassPtr<T>::operator->()
const 725 friend class PP_String;
729 PP_StringRep (
int _len = 0);
742 PP_StringRep::PP_StringRep (
int _len)
745 s =
new char [bufferlength];
749 PP_StringRep::~PP_StringRep ()
805 PP_String (
const char* s);
809 PP_String (
const PP_String& rhs);
813 PP_String& operator= (
const PP_String& rhs);
818 PP_String& operator+= (
const PP_String& right);
824 PP_String& operator+= (
const char* right);
830 PP_String& operator+= (
char c);
835 PP_String& toUpper ();
840 PP_String& toLower ();
848 std::istream& getline (std::istream& strm);
858 bool isNull ()
const;
863 char& operator [] (
int k);
868 char operator[] (
int k)
const;
873 const char* c_str ()
const;
880 double toDouble ()
const;
887 int toInteger ()
const;
894 long toLong ()
const;
898 friend std::ostream&
operator<< (std::ostream& os,
899 const PP_String& str);
913 friend std::istream&
operator>> (std::istream& is,
920 PP_LnClassPtr<PP_StringRep> p;
932 friend inline bool operator< (
const PP_String& left,
933 const PP_String& right);
937 friend inline bool operator<= (
const PP_String& left,
938 const PP_String& right);
942 friend inline bool operator!= (
const PP_String& left,
943 const PP_String& right);
947 friend inline bool operator== (
const PP_String& left,
948 const PP_String& right);
952 friend inline bool operator>= (
const PP_String& left,
953 const PP_String& right);
957 friend inline bool operator> (
const PP_String& left,
958 const PP_String& right);
962 friend inline bool operator< (
const PP_String& left,
967 friend inline bool operator<= (
const PP_String& left,
972 friend inline bool operator!= (
const PP_String& left,
977 friend inline bool operator== (
const PP_String& left,
982 friend inline bool operator>= (
const PP_String& left,
987 friend inline bool operator> (
const PP_String& left,
992 friend inline bool operator< (
const char* left,
993 const PP_String& right);
997 friend inline bool operator<= (
const char* left,
998 const PP_String& right);
1002 friend inline bool operator!= (
const char* left,
1003 const PP_String& right);
1007 friend inline bool operator== (
const char* left,
1008 const PP_String& right);
1012 friend inline bool operator>= (
const char* left,
1013 const PP_String& right);
1017 friend inline bool operator> (
const char* left,
1018 const PP_String& right);
1027 PP_String::isNull ()
const 1034 PP_String::length ()
const 1041 PP_String::toDouble ()
const 1043 return len == 0 ? 0 : std::atof(p->s);
1048 PP_String::toInteger ()
const 1050 return len == 0 ? 0 : atoi(p->s);
1055 PP_String::toLong ()
const 1057 return len == 0 ? 0 : atol(p->s);
1062 PP_String::c_str ()
const 1069 PP_String::operator[] (
int index)
const 1078 const PP_String& right)
1080 PP_String result(left);
1081 return result += right;
1087 const PP_String& right)
1089 return ::strcmp(left.c_str(), right.c_str()) < 0;
1094 operator<= (
const PP_String& left,
1095 const PP_String& right)
1097 return ::strcmp(left.c_str(), right.c_str()) <= 0;
1102 operator!= (
const PP_String& left,
1103 const PP_String& right)
1105 return ::strcmp(left.c_str(), right.c_str()) != 0;
1110 operator== (
const PP_String& left,
1111 const PP_String& right)
1113 return ::strcmp(left.c_str(), right.c_str()) == 0;
1118 operator>= (
const PP_String& left,
1119 const PP_String& right)
1121 return ::strcmp(left.c_str(), right.c_str()) >= 0;
1126 operator> (
const PP_String& left,
1127 const PP_String& right)
1129 return ::strcmp(left.c_str(), right.c_str()) > 0;
1137 return ::strcmp(left.c_str(), right) < 0;
1142 operator<= (
const PP_String& left,
1145 return ::strcmp(left.c_str(), right) <= 0;
1150 operator!= (
const PP_String& left,
1153 return ::strcmp(left.c_str(), right) != 0;
1158 operator== (
const PP_String& left,
1161 return ::strcmp(left.c_str(), right) == 0;
1166 operator>= (
const PP_String& left,
1169 return ::strcmp(left.c_str(), right) >= 0;
1174 operator> (
const PP_String& left,
1177 return ::strcmp(left.c_str(), right) > 0;
1183 const PP_String& right)
1185 return ::strcmp(left, right.c_str()) < 0;
1190 operator<= (
const char* left,
1191 const PP_String& right)
1193 return ::strcmp(left, right.c_str()) <= 0;
1198 operator!= (
const char* left,
1199 const PP_String& right)
1201 return ::strcmp(left, right.c_str()) != 0;
1206 operator== (
const char* left,
1207 const PP_String& right)
1209 return ::strcmp(left, right.c_str()) == 0;
1214 operator>= (
const char* left,
1215 const PP_String& right)
1217 return ::strcmp(left, right.c_str()) >= 0;
1222 operator> (
const char* left,
1223 const PP_String& right)
1225 return ::strcmp(left, right.c_str()) > 0;
1230 template <
class T>
class PP_ListLink;
1231 template <
class T>
class PP_ListIterator;
1232 template <
class T>
class PP_List;
1238 friend class PP_List<T>;
1239 friend class PP_ListIterator<T>;
1241 PP_ListLink (
const T& _val,
1242 PP_ListLink<T>* _pre,
1243 PP_ListLink<T>* _suc)
1252 PP_ListLink<T>* pre;
1253 PP_ListLink<T>* suc;
1268 class PP_ListIterator
1274 PP_ListIterator (
const PP_List<T>& aList);
1278 PP_ListIterator (
const PP_ListIterator<T>& rhs);
1288 const T& operator() ()
const;
1306 bool operator! ()
const;
1311 const T& value ()
const;
1318 PP_ListIterator<T>& operator++ ();
1325 PP_ListIterator<T>& operator-- ();
1333 PP_ListIterator<T> operator-- (
int);
1340 PP_ListIterator<T> operator++ (
int);
1345 bool operator== (
const PP_ListIterator<T>&)
const;
1349 bool operator!= (
const PP_ListIterator<T>&)
const;
1355 PP_ListIterator (
const PP_List<T>& _list,
1356 PP_ListLink<T>* _p);
1360 const PP_List<T>& list;
1367 friend class PP_List<T>;
1372 PP_ListIterator<T>& operator= (
const PP_ListIterator<T>&);
1419 PP_List (
const PP_List<T>& rhs);
1423 PP_List<T>& operator= (
const PP_List<T>& rhs);
1431 void prepend (
const T& value);
1435 void append (
const T& value);
1439 void add (
const T& value);
1443 void join (
const PP_List<T>& src);
1451 void catenate (PP_List<T>& src);
1459 T& firstElement ()
const;
1463 T& lastElement ()
const;
1469 bool includes (
const T& value)
const;
1476 bool operator== (
const PP_List<T>& rhs)
const;
1480 bool operator!= (
const PP_List<T>& rhs)
const;
1488 bool isNotEmpty ()
const;
1492 int length ()
const;
1496 void removeFirst ();
1504 const T& operator[] (
const PP_ListIterator<T>& li)
const;
1508 T& operator[] (
const PP_ListIterator<T>& li);
1512 void remove (
const T& value);
1517 void remove (
const PP_List<T>& lst);
1521 void remove (PP_ListIterator<T>& lit);
1525 void replace (PP_ListIterator<T>& li,
1531 void addAfter (PP_ListIterator<T>& lit,
1537 void addBefore (PP_ListIterator<T>& lit,
1542 PP_ListIterator<T> first ()
const;
1546 PP_ListIterator<T> last ()
const;
1552 void remove (PP_ListLink<T> *ln);
1556 PP_ListLink<T>* addBefore (PP_ListLink<T>* ln,
1561 PP_ListLink<T>* addAfter (PP_ListLink<T>* ln,
1566 PP_ListLink<T>* head;
1570 PP_ListLink<T>* tail;
1574 friend class PP_ListIterator<T>;
1587 PP_ListIterator<T>::PP_ListIterator (
const PP_List<T>& _list,
1597 PP_ListIterator<T>::PP_ListIterator (
const PP_List<T>& aList)
1606 PP_ListIterator<T>::PP_ListIterator (
const PP_ListIterator<T>& li)
1616 PP_ListIterator<T>::rewind ()
1624 PP_ListIterator<T>::operator() ()
const 1641 PP_ListIterator<T>::operator
void* ()
1643 return p != 0 ? this : 0;
1649 PP_ListIterator<T>::operator! ()
const 1651 return p == 0 ? true :
false;
1657 PP_ListIterator<T>::value ()
const 1666 PP_ListIterator<T>::operator++ ()
1676 PP_ListIterator<T>::operator-- ()
1686 PP_ListIterator<T>::operator++ (
int)
1688 const PP_ListIterator<T> li = *
this;
1696 PP_ListIterator<T>::operator-- (
int)
1698 const PP_ListIterator<T> li = *
this;
1706 PP_ListIterator<T>::operator== (
const PP_ListIterator<T>& _li)
const 1708 return (&list == &_li.list && p == _li.p) ? true :
false;
1714 PP_ListIterator<T>::operator!= (
const PP_ListIterator<T>& _li)
const 1716 return ! PP_ListIterator<T>::operator==(_li);
1725 PP_List<T>::PP_List ()
1734 PP_List<T>::~PP_List ()
1742 PP_List<T>::prepend (
const T& value)
1744 addBefore(head, value);
1750 PP_List<T>::append (
const T& value)
1752 addAfter(tail, value);
1758 PP_List<T>::firstElement ()
const 1767 PP_List<T>::lastElement ()
const 1778 return head == 0 && tail == 0;
1784 PP_List<T>::isNotEmpty ()
const 1792 PP_List<T>::removeFirst ()
1800 PP_List<T>::removeLast ()
1808 PP_List<T>::operator[] (
const PP_ListIterator<T>& li)
const 1817 PP_List<T>::operator[] (
const PP_ListIterator<T>& li)
1826 PP_List<T>::replace (PP_ListIterator<T>& li,
1836 PP_List<T>::addAfter (PP_ListIterator<T>& lit,
1839 addAfter(lit.p, val);
1845 PP_List<T>::addBefore (PP_ListIterator<T>& lit,
1848 addBefore(lit.p, val);
1854 PP_List<T>::first ()
const 1856 return PP_ListIterator<T>(*
this,head);
1862 PP_List<T>::last ()
const 1864 return PP_ListIterator<T>(*
this,tail);
1873 PP_List<T>::PP_List (
const PP_List<T>& source)
1878 if (source.isEmpty())
1881 for (PP_ListIterator<T> li(source); li; ++li)
1891 PP_List<T>::add (
const T& value)
1899 PP_List<T>::length ()
const 1902 for (PP_ListIterator<T> li(*
this); li; ++li)
1910 PP_List<T>::operator= (
const PP_List<T>& source)
1912 if (!(
this == &source))
1915 for (PP_ListIterator<T> li(source); li; ++li)
1922 inline PP_ListLink<T> *
1923 PP_List<T>::addBefore (PP_ListLink<T>* ln,
1928 PP_ListLink<T>* newlink;
1932 head = newlink =
new PP_ListLink<T>(val, 0, head);
1937 head->suc->pre = newlink;
1941 newlink =
new PP_ListLink<T>(val, ln->pre, ln);
1943 ln->pre->suc = newlink;
1953 PP_List<T>::addAfter (PP_ListLink<T>* ln,
1958 PP_ListLink<T>* newlink;
1968 tail = newlink =
new PP_ListLink<T>(val,tail,0);
1973 tail->pre->suc = newlink;
1977 newlink =
new PP_ListLink<T>(val, ln, ln->suc);
1979 ln->suc->pre = newlink;
1988 PP_List<T>::join (
const PP_List<T>& list2)
1990 for (PP_ListIterator<T> li2(list2); li2; ++li2)
1996 PP_List<T>::catenate (PP_List<T>& list2)
1998 if (list2.isEmpty())
2012 tail->suc = list2.head;
2013 list2.head->pre = tail;
2022 PP_List<T>::clear ()
2024 PP_ListLink<T>* next = 0;
2026 for (PP_ListLink<T>* p = head; p != 0; p = next)
2037 PP_List<T>::includes (
const T& v)
const 2040 for (PP_ListIterator<T> li(*
this); li && !rc; ++li)
2048 PP_List<T>::operator== (
const PP_List<T>& rhs)
const 2050 if (length() == rhs.length())
2052 for (PP_ListIterator<T> li(*
this), ri(rhs); li; ++li, ++ri)
2063 PP_List<T>::operator!= (
const PP_List<T>& rhs)
const 2065 return !operator==(rhs);
2070 PP_List<T>::remove (PP_ListIterator<T>& li)
2072 PP_ListLink<T> *np = li.p->suc;
2079 PP_List<T>::remove (
const T& _v)
2081 for (PP_ListIterator<T> litr(*
this); litr; ++litr)
2088 PP_List<T>::remove (
const PP_List<T>& _lv)
2090 for (PP_ListIterator<T> litr(_lv); litr; ++litr)
2096 PP_List<T>::remove (PP_ListLink<T>* ln)
2100 if (head == ln && tail == ln)
2102 else if (head == ln)
2108 else if (tail == ln)
2116 CH_assert(ln->suc != 0 && ln->pre != 0);
2117 ln->suc->pre = ln->pre;
2118 ln->pre->suc = ln->suc;
2124 template <
class T>
class PP_Array;
2177 PP_Array (
long len);
2183 const T& initialvalue);
2188 PP_Array (
const T* vec,
2193 PP_Array (
const PP_Array<T>& rhs);
2198 PP_Array<T>& operator= (
const PP_Array<T>& rhs);
2211 bool ready ()
const;
2216 void reserve (
long _truesize);
2234 void resize (
long newlen);
2244 void resize (
long newlen,
2245 const T& initialvalue);
2249 long length ()
const;
2254 long trueSize ()
const;
2260 T& operator[] (
long K);
2264 const T& operator[] (
long K)
const;
2272 const T&
get (
long i)
const;
2282 const T* dataPtr ()
const;
2296 bool operator== (
const PP_Array<T>& rhs)
const;
2300 bool operator!= (
const PP_Array<T>& rhs)
const;
2320 PP_Array<T>& operator= (
int);
2329 PP_Array<T>::PP_Array ()
2338 PP_Array<T>::PP_Array (
long len)
2349 PP_Array<T>::clear ()
2359 PP_Array<T>::~PP_Array ()
2367 PP_Array<T>::ready ()
const 2369 return vp != 0 && nelem != 0;
2375 PP_Array<T>::length ()
const 2383 PP_Array<T>::trueSize ()
const 2391 PP_Array<T>::operator[] (
long i)
2401 PP_Array<T>::operator[] (
long i)
const 2411 PP_Array<T>::get (
long i)
2421 PP_Array<T>::get (
long i)
const 2431 PP_Array<T>::set (
long i,
2442 PP_Array<T>::dataPtr ()
2450 PP_Array<T>::dataPtr ()
const 2458 PP_Array<T>::swap (
long i,
2471 PP_Array<T>::operator!= (
const PP_Array<T>& rhs)
const 2473 return !(operator==(rhs));
2481 PP_Array<T>::PP_Array (
long len,
2482 const T& initialValue)
2488 for (
long i = 0; i < nelem; ++i)
2489 vp[i] = initialValue;
2493 PP_Array<T>::PP_Array (
const T* vec,
2500 for (
long i = 0; i < nelem; ++i)
2505 PP_Array<T>::PP_Array (
const PP_Array<T>& a)
2510 for (
long i = 0; i < nelem; i++)
2516 PP_Array<T>::operator= (
const PP_Array<T>& sa)
2521 vp =
new T[sa.nelem];
2524 for (
long i = 0; i < nelem; i++)
2533 PP_Array<T>::resize (
long newlen)
2535 if (newlen == nelem)
2537 if (newlen <= truesize)
2542 T* newvp =
new T[newlen];
2543 long len =
Min(newlen,nelem);
2544 for (
long i = 0; i < len; i++)
2554 void PP_Array<T>::resize (
long newlen,
2555 const T& initialValue)
2557 if (newlen == nelem)
2559 if (newlen <= truesize)
2561 for (
long i = nelem; i < newlen; ++i)
2562 vp[i] = initialValue;
2566 T* newvp =
new T[newlen];
2567 long len =
Min(newlen,nelem);
2569 for (i = 0; i < len; i++)
2571 for (i = len; i < newlen; ++i)
2572 newvp[i] = initialValue;
2581 PP_Array<T>::reserve (
long _truesize)
2583 if (_truesize > truesize)
2585 T* newvp =
new T[_truesize];
2586 for (
long i = 0; i < nelem; i++)
2590 truesize = _truesize;
2596 PP_Array<T>::shrinkWrap ()
2598 if (nelem != truesize)
2600 T* newvp =
new T[nelem];
2601 for (
long i = 0; i < nelem; i++)
2611 PP_Array<T>::operator== (
const PP_Array<T>& rhs)
const 2613 if (length() != rhs.length())
2616 for (
long i = 0; i < length(); ++i)
2617 if (!((*
this)[i] == rhs[i]))
2775 #endif //for the doxygen thing 2851 friend class PP_entry;
2865 const char* prefix = 0,
2866 const char* parfile = 0);
2871 void define (
int argc,
2873 const char* prefix = 0,
2874 const char* parfile = 0);
2898 bool contains (
const char*
name)
const;
2904 bool contains (
const std::string&
name)
const;
2913 bool looseContains (
const char*
name)
const;
2919 bool looseContains (
const std::string&
name)
const;
2927 int countval (
const char*
name,
2934 int countname (
const char*
name)
const;
2940 int countname (
const std::string&
name)
const;
2950 int len = (int)strEntry.size() + 1;
2951 bldTable(strEntry.c_str(), len, table);
2965 template <
typename TYPE>
2966 void setVal (
const std::string& varName, TYPE varVal)
2968 std::string valStr =
2969 static_cast<std::ostringstream*
>( &(std::ostringstream() << varVal) )->str();
2970 std::string inEntry = varName +
" = " + valStr;
2971 addEntries(inEntry);
2985 void setStr (
const std::string& varName, std::string varVal)
2987 std::string inEntry = varName +
" = " + varVal;
2988 addEntries(inEntry);
2995 void dumpTable (std::ostream& os)
const;
3006 void get (
const char*
name,
3020 int query (
const char* name,
3033 void get (
const char*
name,
3047 int query (
const char* name,
3060 void get (
const char*
name,
3074 int query (
const char* name,
3087 void get (
const char*
name,
3101 int query (
const char* name,
3114 void get (
const char*
name,
3128 int query (
const char* name,
3143 void get (
const char*
name,
3159 int query (
const char* name,
3176 void getarr (
const char* name,
3194 void getarr (
const char* name,
3195 std::vector<int>& ref,
3213 int queryarr (
const char* name,
3232 int queryarr (
const char* name,
3233 std::vector<int>& ref,
3250 void getarr (
const char* name,
3268 void getarr (
const char* name,
3269 std::vector<unsigned long>& ref,
3287 int queryarr (
const char* name,
3306 int queryarr (
const char* name,
3307 std::vector<unsigned long>& ref,
3324 void getarr (
const char* name,
3342 void getarr (
const char* name,
3343 std::vector<float>& ref,
3361 int queryarr (
const char* name,
3380 int queryarr (
const char* name,
3381 std::vector<float>& ref,
3398 void getarr (
const char* name,
3416 void getarr (
const char* name,
3417 std::vector<double>& ref,
3435 int queryarr (
const char* name,
3454 int queryarr (
const char* name,
3455 std::vector<double>& ref,
3472 void getarr (
const char* name,
3490 void getarr (
const char* name,
3491 std::vector<std::string>& ref,
3509 int queryarr (
const char* name,
3528 int queryarr (
const char* name,
3529 std::vector<std::string>& ref,
3546 void getarr (
const char* name,
3564 void getarr (
const char* name,
3565 std::vector<bool>& ref,
3583 int queryarr (
const char* name,
3602 int queryarr (
const char* name,
3603 std::vector<bool>& ref,
3610 return thePrefix.c_str();
3636 static PP_List<PP_entry*> table;
3641 static char** xargv;
3649 void bldTable (
const char* str,
3651 PP_List<PP_entry*>& tab);
3655 void addDefn (PP_String& def,
3656 PP_List<PP_String>& val,
3657 PP_List<PP_entry*>& tab);
3661 void read_file (
const char* fname,
3662 PP_List<PP_entry*>& tab);
3666 PPType getToken (
const char*,
3677 PP_String thePrefix;
3681 void ppinit (
const char* parfile);
3685 const PP_entry* ppindex (
int n,
3686 const char* name)
const;
3695 void getval (
const char* name,
3704 void getarr (
const char* name,
3710 int queryval (
const char* name,
3715 int queryarr (
const char* name,
3723 bool isInteger (
const PP_String& str,
int& val)
const;
3724 bool isUnsigned(
const PP_String& str,
unsigned long& val)
const;
3725 int isDouble (
const PP_String& str,
double& val)
const;
3726 bool isBool (
const PP_String& str,
bool& val)
const;
3741 ParmParse::PPType typ,
3742 PP_List<PP_String>& vals);
3748 ParmParse::PPType deftype;
3749 PP_Array<PP_String> val;
3751 void dump (std::ostream& os)
const;
3767 const PP_entry* def = ppindex(n,name);
3768 return def == 0 ? 0 : def->val.length();
3777 getval(name,ppInt,&ptr,ival,-1);
3786 return queryval(name,ppInt,&ptr,ival,-1);
3795 getval(name,ppUnsignedLong,&ptr,ival,-1);
3804 return queryval(name,ppUnsignedLong,&ptr,ival,-1);
3813 getval(name,ppFloat,&ptr,ival,-1);
3822 return queryval(name,ppFloat,&ptr,ival,-1);
3831 getval(name,ppDouble,&ptr,ival,-1);
3840 return queryval(name,ppDouble,&ptr,ival,-1);
3849 PP_String pp_string;
3850 getval(name,ppString,&pp_string,ival,-1);
3851 ptr = pp_string.c_str();
3860 PP_String pp_string;
3861 int status = queryval(name,ppString,&pp_string,ival,-1);
3863 ptr = pp_string.c_str();
3873 getval(name,ppBool,&ptr,ival,-1);
3882 return queryval(name,ppBool,&ptr,ival,-1);
3888 std::vector<int>& ptr,
3892 if (ptr.size() < num_val)
3893 ptr.resize(num_val);
3894 int* c_array =
new int[num_val];
3895 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3896 for (
int i = 0; i < num_val; ++i)
3898 ptr[i] = c_array[i];
3910 if (ptr.
size() < num_val)
3912 int* c_array =
new int[num_val];
3913 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3914 for (
int i = 0; i < num_val; ++i)
3916 ptr[i] = c_array[i];
3924 std::vector<int>& ptr,
3928 if (ptr.size() < num_val)
3929 ptr.resize(num_val);
3930 int* c_array =
new int[num_val];
3931 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3934 for (
int i = 0; i < num_val; ++i)
3936 ptr[i] = c_array[i];
3950 if (ptr.
size() < num_val)
3952 int* c_array =
new int[num_val];
3953 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3956 for (
int i = 0; i < num_val; ++i)
3958 ptr[i] = c_array[i];
3968 std::vector<float>& ptr,
3972 if (ptr.size() < num_val)
3973 ptr.resize(num_val);
3974 float* c_array =
new float[num_val];
3975 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3976 for (
int i = 0; i < num_val; ++i)
3978 ptr[i] = c_array[i];
3990 if (ptr.
size() < num_val)
3992 float* c_array =
new float[num_val];
3993 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3994 for (
int i = 0; i < num_val; ++i)
3996 ptr[i] = c_array[i];
4004 std::vector<float>& ptr,
4008 if (ptr.size() < num_val)
4009 ptr.resize(num_val);
4010 float* c_array =
new float[num_val];
4011 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
4014 for (
int i = 0; i < num_val; ++i)
4016 ptr[i] = c_array[i];
4030 if (ptr.
size() < num_val)
4032 float* c_array =
new float[num_val];
4033 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
4036 for (
int i = 0; i < num_val; ++i)
4038 ptr[i] = c_array[i];
4048 std::vector<double>& ptr,
4052 if (ptr.size() < num_val)
4053 ptr.resize(num_val);
4054 double* c_array =
new double[num_val];
4055 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4058 cerr <<
"ParmParse::getarr(): " 4060 <<
" not found in table" << endl;
4064 for (
int i = 0; i < num_val; ++i)
4066 ptr[i] = c_array[i];
4078 if (ptr.
size() < num_val)
4080 double* c_array =
new double[num_val];
4081 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4084 cerr <<
"ParmParse::getarr(): " 4086 <<
" not found in table" << endl;
4090 for (
int i = 0; i < num_val; ++i)
4092 ptr[i] = c_array[i];
4100 std::vector<double>& ptr,
4104 if (ptr.size() < num_val)
4105 ptr.resize(num_val);
4106 double* c_array =
new double[num_val];
4107 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4110 for (
int i = 0; i < num_val; ++i)
4112 ptr[i] = c_array[i];
4126 if (ptr.
size() < num_val)
4128 double* c_array =
new double[num_val];
4129 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4132 for (
int i = 0; i < num_val; ++i)
4134 ptr[i] = c_array[i];
4144 std::vector<std::string>& ptr,
4148 if (ptr.size() < num_val)
4149 ptr.resize(num_val);
4150 PP_String* c_array =
new PP_String[num_val];
4151 getarr(name,ppString,c_array,start_ix,num_val,-1);
4152 for (
int i = 0; i < num_val; ++i)
4154 ptr[i] = c_array[i].c_str();
4166 if (ptr.
size() < num_val)
4168 PP_String* c_array =
new PP_String[num_val];
4169 getarr(name,ppString,c_array,start_ix,num_val,-1);
4170 for (
int i = 0; i < num_val; ++i)
4172 ptr[i] = c_array[i].c_str();
4180 std::vector<std::string>& ptr,
4184 if (ptr.size() < num_val)
4185 ptr.resize(num_val);
4186 PP_String* c_array =
new PP_String[num_val];
4187 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4190 for (
int i = 0; i < num_val; ++i)
4192 ptr[i] = c_array[i].c_str();
4206 if (ptr.
size() < num_val)
4208 PP_String* c_array =
new PP_String[num_val];
4209 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4212 for (
int i = 0; i < num_val; ++i)
4214 ptr[i] = c_array[i].c_str();
4225 std::vector<bool>& ptr,
4229 if (ptr.size() < num_val)
4230 ptr.resize(num_val);
4231 bool* c_array =
new bool[num_val];
4232 getarr(name,ppBool,c_array,start_ix,num_val,-1);
4233 for (
int i = 0; i < num_val; ++i)
4235 ptr[i] = c_array[i];
4243 std::vector<bool>& ptr,
4247 if (ptr.size() < num_val)
4248 ptr.resize(num_val);
4249 bool* c_array =
new bool[num_val];
4250 int status =
queryarr(name,ppBool,c_array,start_ix,num_val,-1);
4253 for (
int i = 0; i < num_val; ++i)
4255 ptr[i] = c_array[i];
4266 ParmParse::isInteger (
const PP_String& str,
4273 val = (int) strtol(str.c_str(), &endp, 10);
4279 ParmParse::isUnsigned (
const PP_String& str,
4280 unsigned long & val)
const 4283 val = strtoul(str.c_str(), &endp, 10);
4289 ParmParse::isDouble (
const PP_String& str,
4293 val = std::strtod(str.c_str(), &endp);
4299 ParmParse::isBool (
const PP_String& str,
4302 PP_String str_lc( str );
4304 if ( str_lc ==
"true" || str_lc ==
"1" )
4308 else if ( str_lc ==
"false" || str_lc ==
"0" )
friend class PP_entry
Definition: ParmParse.H:2851
int countval(const char *name, int n=-1) const
Definition: ParmParse.H:3761
#define CH_assert(cond)
Definition: CHArray.H:37
int countname(const char *name) const
int query(const char *name, int &ref, int ival=0) const
Definition: ParmParse.H:3782
void setStr(const std::string &varName, std::string varVal)
Definition: ParmParse.H:2985
int isEmpty(const box2d *)
Parse Parameters From Command Line and Input Files.
Definition: ParmParse.H:2849
void resize(unsigned int isize)
Definition: Vector.H:346
std::ostream & operator<<(std::ostream &a_os, const IndexTM< T, N > &a_iv)
C::self_type operator+(const C &, const C &)
Definition: GenericArithmeticI.H:120
const char * name(const FArrayBox &a_dummySpecializationArg)
Definition: CH_HDF5.H:907
std::istream & operator>>(std::istream &a_os, IndexTM< T, N > &a_iv)
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:212
size_t size() const
Definition: Vector.H:192
int queryarr(const char *name, Vector< int > &ref, int start_ix, int num_val) const
access an array of objects
Definition: ParmParse.H:3945
void get(const char *name, int &ref, int ival=0) const
access single object
Definition: ParmParse.H:3773
void setVal(const std::string &varName, TYPE varVal)
Definition: ParmParse.H:2966
void const char const int const int const int * K
Definition: Lapack.H:83
T Min(const T &a_a, const T &a_b)
Definition: Misc.H:26
C::self_type operator*(const C &, const C &)
Definition: GenericArithmeticI.H:128
const char * prefix() const
return prefix
Definition: ParmParse.H:3608
void addEntries(const std::string &strEntry)
Definition: ParmParse.H:2948
void dumpTable(std::ostream &os) const
void getarr(const char *name, Vector< int > &ref, int start_ix, int num_val) const
access an array of objects
Definition: ParmParse.H:3905
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).