68 PP_UseCount (
const PP_UseCount& rhs);
74 PP_UseCount& operator= (
const PP_UseCount& rhs);
86 int linkCount ()
const;
105 PP_UseCount::PP_UseCount ()
107 cnt(
new unsigned int(1))
112 PP_UseCount::PP_UseCount (
const PP_UseCount& rhs)
121 PP_UseCount::unique ()
const 128 PP_UseCount::decrement ()
141 PP_UseCount::operator= (
const PP_UseCount& rhs)
150 PP_UseCount::~PP_UseCount ()
157 PP_UseCount::linkCount ()
const 205 PP_CpPtr (
const PP_CpPtr<T>& rhs);
210 PP_CpPtr<T>& operator= (T* rhs);
220 PP_CpPtr<T>& operator= (
const PP_CpPtr<T>& rhs);
231 bool isNull ()
const;
239 bool operator== (
const PP_CpPtr<T>& rhs)
const;
243 bool operator!= (
const PP_CpPtr<T>& rhs)
const;
263 class PP_CpClassPtr :
274 PP_CpClassPtr (T* rhs);
284 PP_CpClassPtr (
const PP_CpClassPtr<T>& rhs);
289 PP_CpClassPtr<T>& operator= (T* rhs);
299 PP_CpClassPtr<T>& operator= (
const PP_CpClassPtr<T>& rhs);
303 T* operator-> ()
const;
338 PP_LnPtr<T>& operator= (
const PP_LnPtr<T>& rhs);
344 PP_LnPtr<T>& operator= (T* rhs)
352 ucnt = PP_UseCount();
363 bool unique ()
const;
367 int linkCount ()
const;
378 bool isNull ()
const;
382 bool operator== (
const PP_LnPtr<T>& rhs)
const;
386 bool operator!= (
const PP_LnPtr<T>& rhs)
const;
419 PP_LnClassPtr (T* rhs);
426 PP_LnClassPtr<T>& operator= (
const PP_LnClassPtr<T>& rhs);
432 PP_LnClassPtr<T>& operator= (T* rhs);
436 T* operator->()
const;
445 PP_CpPtr<T>::PP_CpPtr ()
453 PP_CpPtr<T>::PP_CpPtr(T* rhs)
461 PP_CpPtr<T>::~PP_CpPtr()
469 PP_CpPtr<T>::isNull ()
const 476 PP_CpPtr<T>::PP_CpPtr (
const PP_CpPtr<T>& rhs)
478 ptr = rhs.isNull() ? 0 :
new T(*rhs.ptr);
484 PP_CpPtr<T>::operator= (
const PP_CpPtr<T>& rhs)
486 if (!(ptr == rhs.ptr))
489 ptr = rhs.isNull() ? 0 :
new T(*rhs.ptr);
497 PP_CpPtr<T>::operator= (T* rhs)
516 PP_CpPtr<T>::release ()
526 PP_CpPtr<T>::operator== (
const PP_CpPtr<T>& rhs)
const 528 return ptr == rhs.ptr;
534 PP_CpPtr<T>::operator!= (
const PP_CpPtr<T>& rhs)
const 536 return ptr != rhs.ptr;
541 PP_CpClassPtr<T>::PP_CpClassPtr ()
549 PP_CpClassPtr<T>::PP_CpClassPtr (T* rhs)
557 PP_CpClassPtr<T>::PP_CpClassPtr (
const PP_CpClassPtr<T>& rhs)
566 PP_CpClassPtr<T>::operator= (T* rhs)
568 PP_CpPtr<T>::operator= (rhs);
575 PP_CpClassPtr<T>::operator= (
const PP_CpClassPtr<T>& rhs)
577 PP_CpPtr<T>::operator= (rhs);
584 PP_CpClassPtr<T>::operator-> ()
const 591 PP_LnPtr<T>::PP_LnPtr ()
599 PP_LnPtr<T>::PP_LnPtr(T* rhs)
608 PP_LnPtr<T>::unique ()
const 610 return ucnt.unique();
615 PP_LnPtr<T>::~PP_LnPtr ()
624 PP_LnPtr<T>::operator= (
const PP_LnPtr<T>& rhs)
639 PP_LnPtr<T>::linkCount ()
const 641 return ucnt.linkCount();
656 PP_LnPtr<T>::isNull ()
const 664 PP_LnPtr<T>::operator== (
const PP_LnPtr<T>& rhs)
const 666 return ptr == rhs.ptr;
672 PP_LnPtr<T>::operator!= (
const PP_LnPtr<T>& rhs)
const 674 return ptr != rhs.ptr;
679 PP_LnClassPtr<T>::PP_LnClassPtr ()
685 PP_LnClassPtr<T>::PP_LnClassPtr (T* rhs)
694 PP_LnClassPtr<T>::operator= (
const PP_LnClassPtr<T>& rhs)
696 PP_LnPtr<T>::operator=(rhs);
703 PP_LnClassPtr<T>::operator= (T* rhs)
705 PP_LnPtr<T>::operator=(rhs);
712 PP_LnClassPtr<T>::operator->()
const 723 friend class PP_String;
727 PP_StringRep (
int _len = 0);
740 PP_StringRep::PP_StringRep (
int _len)
743 s =
new char [bufferlength];
747 PP_StringRep::~PP_StringRep ()
803 PP_String (
const char* s);
807 PP_String (
const PP_String& rhs);
811 PP_String& operator= (
const PP_String& rhs);
816 PP_String& operator+= (
const PP_String& right);
822 PP_String& operator+= (
const char* right);
828 PP_String& operator+= (
char c);
833 PP_String& toUpper ();
838 PP_String& toLower ();
846 std::istream& getline (std::istream& strm);
856 bool isNull ()
const;
861 char& operator [] (
int k);
866 char operator[] (
int k)
const;
871 const char* c_str ()
const;
878 double toDouble ()
const;
885 int toInteger ()
const;
892 long toLong ()
const;
896 friend std::ostream&
operator<< (std::ostream& os,
897 const PP_String& str);
911 friend std::istream&
operator>> (std::istream& is,
918 PP_LnClassPtr<PP_StringRep> p;
930 friend inline bool operator< (
const PP_String& left,
931 const PP_String& right);
935 friend inline bool operator<= (
const PP_String& left,
936 const PP_String& right);
940 friend inline bool operator!= (
const PP_String& left,
941 const PP_String& right);
945 friend inline bool operator== (
const PP_String& left,
946 const PP_String& right);
950 friend inline bool operator>= (
const PP_String& left,
951 const PP_String& right);
955 friend inline bool operator> (
const PP_String& left,
956 const PP_String& right);
960 friend inline bool operator< (
const PP_String& left,
965 friend inline bool operator<= (
const PP_String& left,
970 friend inline bool operator!= (
const PP_String& left,
975 friend inline bool operator== (
const PP_String& left,
980 friend inline bool operator>= (
const PP_String& left,
985 friend inline bool operator> (
const PP_String& left,
990 friend inline bool operator< (
const char* left,
991 const PP_String& right);
995 friend inline bool operator<= (
const char* left,
996 const PP_String& right);
1000 friend inline bool operator!= (
const char* left,
1001 const PP_String& right);
1005 friend inline bool operator== (
const char* left,
1006 const PP_String& right);
1010 friend inline bool operator>= (
const char* left,
1011 const PP_String& right);
1015 friend inline bool operator> (
const char* left,
1016 const PP_String& right);
1025 PP_String::isNull ()
const 1032 PP_String::length ()
const 1039 PP_String::toDouble ()
const 1041 return len == 0 ? 0 : std::atof(p->s);
1046 PP_String::toInteger ()
const 1048 return len == 0 ? 0 : atoi(p->s);
1053 PP_String::toLong ()
const 1055 return len == 0 ? 0 : atol(p->s);
1060 PP_String::c_str ()
const 1067 PP_String::operator[] (
int index)
const 1076 const PP_String& right)
1078 PP_String result(left);
1079 return result += right;
1085 const PP_String& right)
1087 return ::strcmp(left.c_str(), right.c_str()) < 0;
1092 operator<= (
const PP_String& left,
1093 const PP_String& right)
1095 return ::strcmp(left.c_str(), right.c_str()) <= 0;
1100 operator!= (
const PP_String& left,
1101 const PP_String& right)
1103 return ::strcmp(left.c_str(), right.c_str()) != 0;
1108 operator== (
const PP_String& left,
1109 const PP_String& right)
1111 return ::strcmp(left.c_str(), right.c_str()) == 0;
1116 operator>= (
const PP_String& left,
1117 const PP_String& right)
1119 return ::strcmp(left.c_str(), right.c_str()) >= 0;
1124 operator> (
const PP_String& left,
1125 const PP_String& right)
1127 return ::strcmp(left.c_str(), right.c_str()) > 0;
1135 return ::strcmp(left.c_str(), right) < 0;
1140 operator<= (
const PP_String& left,
1143 return ::strcmp(left.c_str(), right) <= 0;
1148 operator!= (
const PP_String& left,
1151 return ::strcmp(left.c_str(), right) != 0;
1156 operator== (
const PP_String& left,
1159 return ::strcmp(left.c_str(), right) == 0;
1164 operator>= (
const PP_String& left,
1167 return ::strcmp(left.c_str(), right) >= 0;
1172 operator> (
const PP_String& left,
1175 return ::strcmp(left.c_str(), right) > 0;
1181 const PP_String& right)
1183 return ::strcmp(left, right.c_str()) < 0;
1188 operator<= (
const char* left,
1189 const PP_String& right)
1191 return ::strcmp(left, right.c_str()) <= 0;
1196 operator!= (
const char* left,
1197 const PP_String& right)
1199 return ::strcmp(left, right.c_str()) != 0;
1204 operator== (
const char* left,
1205 const PP_String& right)
1207 return ::strcmp(left, right.c_str()) == 0;
1212 operator>= (
const char* left,
1213 const PP_String& right)
1215 return ::strcmp(left, right.c_str()) >= 0;
1220 operator> (
const char* left,
1221 const PP_String& right)
1223 return ::strcmp(left, right.c_str()) > 0;
1228 template <
class T>
class PP_ListLink;
1229 template <
class T>
class PP_ListIterator;
1230 template <
class T>
class PP_List;
1236 friend class PP_List<T>;
1237 friend class PP_ListIterator<T>;
1239 PP_ListLink (
const T& _val,
1240 PP_ListLink<T>* _pre,
1241 PP_ListLink<T>* _suc)
1250 PP_ListLink<T>* pre;
1251 PP_ListLink<T>* suc;
1266 class PP_ListIterator
1272 PP_ListIterator (
const PP_List<T>& aList);
1276 PP_ListIterator (
const PP_ListIterator<T>& rhs);
1286 const T& operator() ()
const;
1304 bool operator! ()
const;
1309 const T& value ()
const;
1316 PP_ListIterator<T>& operator++ ();
1323 PP_ListIterator<T>& operator-- ();
1331 PP_ListIterator<T> operator-- (
int);
1338 PP_ListIterator<T> operator++ (
int);
1343 bool operator== (
const PP_ListIterator<T>&)
const;
1347 bool operator!= (
const PP_ListIterator<T>&)
const;
1353 PP_ListIterator (
const PP_List<T>& _list,
1354 PP_ListLink<T>* _p);
1358 const PP_List<T>& list;
1365 friend class PP_List<T>;
1370 PP_ListIterator<T>& operator= (
const PP_ListIterator<T>&);
1417 PP_List (
const PP_List<T>& rhs);
1421 PP_List<T>& operator= (
const PP_List<T>& rhs);
1429 void prepend (
const T& value);
1433 void append (
const T& value);
1437 void add (
const T& value);
1441 void join (
const PP_List<T>& src);
1449 void catenate (PP_List<T>& src);
1457 T& firstElement ()
const;
1461 T& lastElement ()
const;
1467 bool includes (
const T& value)
const;
1474 bool operator== (
const PP_List<T>& rhs)
const;
1478 bool operator!= (
const PP_List<T>& rhs)
const;
1486 bool isNotEmpty ()
const;
1490 int length ()
const;
1494 void removeFirst ();
1502 const T& operator[] (
const PP_ListIterator<T>& li)
const;
1506 T& operator[] (
const PP_ListIterator<T>& li);
1510 void remove (
const T& value);
1515 void remove (
const PP_List<T>& lst);
1519 void remove (PP_ListIterator<T>& lit);
1523 void replace (PP_ListIterator<T>& li,
1529 void addAfter (PP_ListIterator<T>& lit,
1535 void addBefore (PP_ListIterator<T>& lit,
1540 PP_ListIterator<T> first ()
const;
1544 PP_ListIterator<T> last ()
const;
1550 void remove (PP_ListLink<T> *ln);
1554 PP_ListLink<T>* addBefore (PP_ListLink<T>* ln,
1559 PP_ListLink<T>* addAfter (PP_ListLink<T>* ln,
1564 PP_ListLink<T>* head;
1568 PP_ListLink<T>* tail;
1572 friend class PP_ListIterator<T>;
1585 PP_ListIterator<T>::PP_ListIterator (
const PP_List<T>& _list,
1595 PP_ListIterator<T>::PP_ListIterator (
const PP_List<T>& aList)
1604 PP_ListIterator<T>::PP_ListIterator (
const PP_ListIterator<T>& li)
1614 PP_ListIterator<T>::rewind ()
1622 PP_ListIterator<T>::operator() ()
const 1639 PP_ListIterator<T>::operator
void* ()
1641 return p != 0 ? this : 0;
1647 PP_ListIterator<T>::operator! ()
const 1649 return p == 0 ? true :
false;
1655 PP_ListIterator<T>::value ()
const 1664 PP_ListIterator<T>::operator++ ()
1674 PP_ListIterator<T>::operator-- ()
1684 PP_ListIterator<T>::operator++ (
int)
1686 const PP_ListIterator<T> li = *
this;
1694 PP_ListIterator<T>::operator-- (
int)
1696 const PP_ListIterator<T> li = *
this;
1704 PP_ListIterator<T>::operator== (
const PP_ListIterator<T>& _li)
const 1706 return (&list == &_li.list && p == _li.p) ? true :
false;
1712 PP_ListIterator<T>::operator!= (
const PP_ListIterator<T>& _li)
const 1714 return ! PP_ListIterator<T>::operator==(_li);
1723 PP_List<T>::PP_List ()
1732 PP_List<T>::~PP_List ()
1740 PP_List<T>::prepend (
const T& value)
1742 addBefore(head, value);
1748 PP_List<T>::append (
const T& value)
1750 addAfter(tail, value);
1756 PP_List<T>::firstElement ()
const 1765 PP_List<T>::lastElement ()
const 1776 return head == 0 && tail == 0;
1782 PP_List<T>::isNotEmpty ()
const 1790 PP_List<T>::removeFirst ()
1798 PP_List<T>::removeLast ()
1806 PP_List<T>::operator[] (
const PP_ListIterator<T>& li)
const 1815 PP_List<T>::operator[] (
const PP_ListIterator<T>& li)
1824 PP_List<T>::replace (PP_ListIterator<T>& li,
1834 PP_List<T>::addAfter (PP_ListIterator<T>& lit,
1837 addAfter(lit.p, val);
1843 PP_List<T>::addBefore (PP_ListIterator<T>& lit,
1846 addBefore(lit.p, val);
1852 PP_List<T>::first ()
const 1854 return PP_ListIterator<T>(*
this,head);
1860 PP_List<T>::last ()
const 1862 return PP_ListIterator<T>(*
this,tail);
1871 PP_List<T>::PP_List (
const PP_List<T>& source)
1876 if (source.isEmpty())
1879 for (PP_ListIterator<T> li(source); li; ++li)
1889 PP_List<T>::add (
const T& value)
1897 PP_List<T>::length ()
const 1900 for (PP_ListIterator<T> li(*
this); li; ++li)
1908 PP_List<T>::operator= (
const PP_List<T>& source)
1910 if (!(
this == &source))
1913 for (PP_ListIterator<T> li(source); li; ++li)
1920 inline PP_ListLink<T> *
1921 PP_List<T>::addBefore (PP_ListLink<T>* ln,
1926 PP_ListLink<T>* newlink;
1930 head = newlink =
new PP_ListLink<T>(val, 0, head);
1935 head->suc->pre = newlink;
1939 newlink =
new PP_ListLink<T>(val, ln->pre, ln);
1941 ln->pre->suc = newlink;
1951 PP_List<T>::addAfter (PP_ListLink<T>* ln,
1956 PP_ListLink<T>* newlink;
1966 tail = newlink =
new PP_ListLink<T>(val,tail,0);
1971 tail->pre->suc = newlink;
1975 newlink =
new PP_ListLink<T>(val, ln, ln->suc);
1977 ln->suc->pre = newlink;
1986 PP_List<T>::join (
const PP_List<T>& list2)
1988 for (PP_ListIterator<T> li2(list2); li2; ++li2)
1994 PP_List<T>::catenate (PP_List<T>& list2)
1996 if (list2.isEmpty())
2010 tail->suc = list2.head;
2011 list2.head->pre = tail;
2020 PP_List<T>::clear ()
2022 PP_ListLink<T>* next = 0;
2024 for (PP_ListLink<T>* p = head; p != 0; p = next)
2035 PP_List<T>::includes (
const T& v)
const 2038 for (PP_ListIterator<T> li(*
this); li && !rc; ++li)
2046 PP_List<T>::operator== (
const PP_List<T>& rhs)
const 2048 if (length() == rhs.length())
2050 for (PP_ListIterator<T> li(*
this), ri(rhs); li; ++li, ++ri)
2061 PP_List<T>::operator!= (
const PP_List<T>& rhs)
const 2063 return !operator==(rhs);
2068 PP_List<T>::remove (PP_ListIterator<T>& li)
2070 PP_ListLink<T> *np = li.p->suc;
2077 PP_List<T>::remove (
const T& _v)
2079 for (PP_ListIterator<T> litr(*
this); litr; ++litr)
2086 PP_List<T>::remove (
const PP_List<T>& _lv)
2088 for (PP_ListIterator<T> litr(_lv); litr; ++litr)
2094 PP_List<T>::remove (PP_ListLink<T>* ln)
2098 if (head == ln && tail == ln)
2100 else if (head == ln)
2106 else if (tail == ln)
2114 CH_assert(ln->suc != 0 && ln->pre != 0);
2115 ln->suc->pre = ln->pre;
2116 ln->pre->suc = ln->suc;
2122 template <
class T>
class PP_Array;
2175 PP_Array (
long len);
2181 const T& initialvalue);
2186 PP_Array (
const T* vec,
2191 PP_Array (
const PP_Array<T>& rhs);
2196 PP_Array<T>& operator= (
const PP_Array<T>& rhs);
2209 bool ready ()
const;
2214 void reserve (
long _truesize);
2232 void resize (
long newlen);
2242 void resize (
long newlen,
2243 const T& initialvalue);
2247 long length ()
const;
2252 long trueSize ()
const;
2258 T& operator[] (
long K);
2262 const T& operator[] (
long K)
const;
2270 const T&
get (
long i)
const;
2280 const T* dataPtr ()
const;
2294 bool operator== (
const PP_Array<T>& rhs)
const;
2298 bool operator!= (
const PP_Array<T>& rhs)
const;
2318 PP_Array<T>& operator= (
int);
2327 PP_Array<T>::PP_Array ()
2336 PP_Array<T>::PP_Array (
long len)
2347 PP_Array<T>::clear ()
2357 PP_Array<T>::~PP_Array ()
2365 PP_Array<T>::ready ()
const 2367 return vp != 0 && nelem != 0;
2373 PP_Array<T>::length ()
const 2381 PP_Array<T>::trueSize ()
const 2389 PP_Array<T>::operator[] (
long i)
2399 PP_Array<T>::operator[] (
long i)
const 2409 PP_Array<T>::get (
long i)
2419 PP_Array<T>::get (
long i)
const 2429 PP_Array<T>::set (
long i,
2440 PP_Array<T>::dataPtr ()
2448 PP_Array<T>::dataPtr ()
const 2456 PP_Array<T>::swap (
long i,
2469 PP_Array<T>::operator!= (
const PP_Array<T>& rhs)
const 2471 return !(operator==(rhs));
2479 PP_Array<T>::PP_Array (
long len,
2480 const T& initialValue)
2486 for (
long i = 0; i < nelem; ++i)
2487 vp[i] = initialValue;
2491 PP_Array<T>::PP_Array (
const T* vec,
2498 for (
long i = 0; i < nelem; ++i)
2503 PP_Array<T>::PP_Array (
const PP_Array<T>& a)
2508 for (
long i = 0; i < nelem; i++)
2514 PP_Array<T>::operator= (
const PP_Array<T>& sa)
2519 vp =
new T[sa.nelem];
2522 for (
long i = 0; i < nelem; i++)
2531 PP_Array<T>::resize (
long newlen)
2533 if (newlen == nelem)
2535 if (newlen <= truesize)
2540 T* newvp =
new T[newlen];
2541 long len =
Min(newlen,nelem);
2542 for (
long i = 0; i < len; i++)
2552 void PP_Array<T>::resize (
long newlen,
2553 const T& initialValue)
2555 if (newlen == nelem)
2557 if (newlen <= truesize)
2559 for (
long i = nelem; i < newlen; ++i)
2560 vp[i] = initialValue;
2564 T* newvp =
new T[newlen];
2565 long len =
Min(newlen,nelem);
2567 for (i = 0; i < len; i++)
2569 for (i = len; i < newlen; ++i)
2570 newvp[i] = initialValue;
2579 PP_Array<T>::reserve (
long _truesize)
2581 if (_truesize > truesize)
2583 T* newvp =
new T[_truesize];
2584 for (
long i = 0; i < nelem; i++)
2588 truesize = _truesize;
2594 PP_Array<T>::shrinkWrap ()
2596 if (nelem != truesize)
2598 T* newvp =
new T[nelem];
2599 for (
long i = 0; i < nelem; i++)
2609 PP_Array<T>::operator== (
const PP_Array<T>& rhs)
const 2611 if (length() != rhs.length())
2614 for (
long i = 0; i < length(); ++i)
2615 if (!((*
this)[i] == rhs[i]))
2773 #endif //for the doxygen thing 2849 friend class PP_entry;
2863 const char* prefix = 0,
2864 const char* parfile = 0);
2869 void define (
int argc,
2871 const char* prefix = 0,
2872 const char* parfile = 0);
2892 bool contains (
const char*
name)
const;
2898 bool contains (
const std::string&
name)
const;
2905 int countval (
const char*
name,
2912 int countname (
const char*
name)
const;
2918 int countname (
const std::string&
name)
const;
2924 void dumpTable (std::ostream& os)
const;
2935 void get (
const char*
name,
2949 int query (
const char* name,
2962 void get (
const char*
name,
2976 int query (
const char* name,
2989 void get (
const char*
name,
3003 int query (
const char* name,
3016 void get (
const char*
name,
3030 int query (
const char* name,
3043 void get (
const char*
name,
3057 int query (
const char* name,
3072 void get (
const char*
name,
3088 int query (
const char* name,
3106 void getarr (
const char* name,
3124 void getarr (
const char* name,
3125 std::vector<int>& ref,
3143 int queryarr (
const char* name,
3162 int queryarr (
const char* name,
3163 std::vector<int>& ref,
3180 void getarr (
const char* name,
3198 void getarr (
const char* name,
3199 std::vector<unsigned long>& ref,
3217 int queryarr (
const char* name,
3236 int queryarr (
const char* name,
3237 std::vector<unsigned long>& ref,
3254 void getarr (
const char* name,
3272 void getarr (
const char* name,
3273 std::vector<float>& ref,
3291 int queryarr (
const char* name,
3310 int queryarr (
const char* name,
3311 std::vector<float>& ref,
3328 void getarr (
const char* name,
3346 void getarr (
const char* name,
3347 std::vector<double>& ref,
3365 int queryarr (
const char* name,
3384 int queryarr (
const char* name,
3385 std::vector<double>& ref,
3402 void getarr (
const char* name,
3420 void getarr (
const char* name,
3421 std::vector<std::string>& ref,
3439 int queryarr (
const char* name,
3458 int queryarr (
const char* name,
3459 std::vector<std::string>& ref,
3476 void getarr (
const char* name,
3494 void getarr (
const char* name,
3495 std::vector<bool>& ref,
3513 int queryarr (
const char* name,
3532 int queryarr (
const char* name,
3533 std::vector<bool>& ref,
3541 return thePrefix.c_str();
3567 static PP_List<PP_entry*> table;
3572 static char** xargv;
3580 void bldTable (
const char* str,
3582 PP_List<PP_entry*>& tab);
3586 void addDefn (PP_String& def,
3587 PP_List<PP_String>& val,
3588 PP_List<PP_entry*>& tab);
3592 void read_file (
const char* fname,
3593 PP_List<PP_entry*>& tab);
3597 PPType getToken (
const char*,
3608 PP_String thePrefix;
3612 void ppinit (
const char* parfile);
3616 const PP_entry* ppindex (
int n,
3617 const char* name)
const;
3626 void getval (
const char* name,
3634 void getarr (
const char* name,
3640 int queryval (
const char* name,
3645 int queryarr (
const char* name,
3652 bool isInteger (
const PP_String& str,
int& val)
const;
3653 bool isUnsigned(
const PP_String& str,
unsigned long& val)
const;
3654 int isDouble (
const PP_String& str,
double& val)
const;
3655 bool isBool (
const PP_String& str,
bool& val)
const;
3670 ParmParse::PPType typ,
3671 PP_List<PP_String>& vals);
3677 ParmParse::PPType deftype;
3678 PP_Array<PP_String> val;
3680 void dump (std::ostream& os)
const;
3696 const PP_entry* def = ppindex(n,name);
3697 return def == 0 ? 0 : def->val.length();
3706 getval(name,ppInt,&ptr,ival,-1);
3715 return queryval(name,ppInt,&ptr,ival,-1);
3724 getval(name,ppUnsignedLong,&ptr,ival,-1);
3733 return queryval(name,ppUnsignedLong,&ptr,ival,-1);
3742 getval(name,ppFloat,&ptr,ival,-1);
3751 return queryval(name,ppFloat,&ptr,ival,-1);
3760 getval(name,ppDouble,&ptr,ival,-1);
3769 return queryval(name,ppDouble,&ptr,ival,-1);
3778 PP_String pp_string;
3779 getval(name,ppString,&pp_string,ival,-1);
3780 ptr = pp_string.c_str();
3789 PP_String pp_string;
3790 int status = queryval(name,ppString,&pp_string,ival,-1);
3792 ptr = pp_string.c_str();
3802 getval(name,ppBool,&ptr,ival,-1);
3811 return queryval(name,ppBool,&ptr,ival,-1);
3817 std::vector<int>& ptr,
3821 if (ptr.size() < num_val)
3822 ptr.resize(num_val);
3823 int* c_array =
new int[num_val];
3824 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3825 for (
int i = 0; i < num_val; ++i)
3827 ptr[i] = c_array[i];
3839 if (ptr.
size() < num_val)
3841 int* c_array =
new int[num_val];
3842 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3843 for (
int i = 0; i < num_val; ++i)
3845 ptr[i] = c_array[i];
3853 std::vector<int>& ptr,
3857 if (ptr.size() < num_val)
3858 ptr.resize(num_val);
3859 int* c_array =
new int[num_val];
3860 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3863 for (
int i = 0; i < num_val; ++i)
3865 ptr[i] = c_array[i];
3879 if (ptr.
size() < num_val)
3881 int* c_array =
new int[num_val];
3882 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3885 for (
int i = 0; i < num_val; ++i)
3887 ptr[i] = c_array[i];
3896 std::vector<float>& ptr,
3900 if (ptr.size() < num_val)
3901 ptr.resize(num_val);
3902 float* c_array =
new float[num_val];
3903 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3904 for (
int i = 0; i < num_val; ++i)
3906 ptr[i] = c_array[i];
3918 if (ptr.
size() < num_val)
3920 float* c_array =
new float[num_val];
3921 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3922 for (
int i = 0; i < num_val; ++i)
3924 ptr[i] = c_array[i];
3932 std::vector<float>& ptr,
3936 if (ptr.size() < num_val)
3937 ptr.resize(num_val);
3938 float* c_array =
new float[num_val];
3939 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
3942 for (
int i = 0; i < num_val; ++i)
3944 ptr[i] = c_array[i];
3958 if (ptr.
size() < num_val)
3960 float* c_array =
new float[num_val];
3961 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
3964 for (
int i = 0; i < num_val; ++i)
3966 ptr[i] = c_array[i];
3976 std::vector<double>& ptr,
3980 if (ptr.size() < num_val)
3981 ptr.resize(num_val);
3982 double* c_array =
new double[num_val];
3983 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
3986 cerr <<
"ParmParse::getarr(): " 3988 <<
" not found in table" << endl;
3992 for (
int i = 0; i < num_val; ++i)
3994 ptr[i] = c_array[i];
4006 if (ptr.
size() < num_val)
4008 double* c_array =
new double[num_val];
4009 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4012 cerr <<
"ParmParse::getarr(): " 4014 <<
" not found in table" << endl;
4018 for (
int i = 0; i < num_val; ++i)
4020 ptr[i] = c_array[i];
4028 std::vector<double>& ptr,
4032 if (ptr.size() < num_val)
4033 ptr.resize(num_val);
4034 double* c_array =
new double[num_val];
4035 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4038 for (
int i = 0; i < num_val; ++i)
4040 ptr[i] = c_array[i];
4054 if (ptr.
size() < num_val)
4056 double* c_array =
new double[num_val];
4057 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4060 for (
int i = 0; i < num_val; ++i)
4062 ptr[i] = c_array[i];
4072 std::vector<std::string>& ptr,
4076 if (ptr.size() < num_val)
4077 ptr.resize(num_val);
4078 PP_String* c_array =
new PP_String[num_val];
4079 getarr(name,ppString,c_array,start_ix,num_val,-1);
4080 for (
int i = 0; i < num_val; ++i)
4082 ptr[i] = c_array[i].c_str();
4094 if (ptr.
size() < num_val)
4096 PP_String* c_array =
new PP_String[num_val];
4097 getarr(name,ppString,c_array,start_ix,num_val,-1);
4098 for (
int i = 0; i < num_val; ++i)
4100 ptr[i] = c_array[i].c_str();
4108 std::vector<std::string>& ptr,
4112 if (ptr.size() < num_val)
4113 ptr.resize(num_val);
4114 PP_String* c_array =
new PP_String[num_val];
4115 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4118 for (
int i = 0; i < num_val; ++i)
4120 ptr[i] = c_array[i].c_str();
4134 if (ptr.
size() < num_val)
4136 PP_String* c_array =
new PP_String[num_val];
4137 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4140 for (
int i = 0; i < num_val; ++i)
4142 ptr[i] = c_array[i].c_str();
4153 std::vector<bool>& ptr,
4157 if (ptr.size() < num_val)
4158 ptr.resize(num_val);
4159 bool* c_array =
new bool[num_val];
4160 getarr(name,ppBool,c_array,start_ix,num_val,-1);
4161 for (
int i = 0; i < num_val; ++i)
4163 ptr[i] = c_array[i];
4171 std::vector<bool>& ptr,
4175 if (ptr.size() < num_val)
4176 ptr.resize(num_val);
4177 bool* c_array =
new bool[num_val];
4178 int status =
queryarr(name,ppBool,c_array,start_ix,num_val,-1);
4181 for (
int i = 0; i < num_val; ++i)
4183 ptr[i] = c_array[i];
4194 ParmParse::isInteger (
const PP_String& str,
4201 val = (int) strtol(str.c_str(), &endp, 10);
4207 ParmParse::isUnsigned (
const PP_String& str,
4208 unsigned long & val)
const 4211 val = strtoul(str.c_str(), &endp, 10);
4217 ParmParse::isDouble (
const PP_String& str,
4221 val = std::strtod(str.c_str(), &endp);
4227 ParmParse::isBool (
const PP_String& str,
4230 PP_String str_lc( str );
4232 if ( str_lc ==
"true" || str_lc ==
"1" )
4236 else if ( str_lc ==
"false" || str_lc ==
"0" )
friend class PP_entry
Definition: ParmParse.H:2849
int countval(const char *name, int n=-1) const
Definition: ParmParse.H:3690
#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:3711
int isEmpty(const box2d *)
Parse Parameters From Command Line and Input Files.
Definition: ParmParse.H:2847
void resize(unsigned int isize)
Definition: Vector.H:323
std::ostream & operator<<(std::ostream &a_os, const IndexTM< T, N > &a_iv)
C::self_type operator+(const C &, const C &)
Definition: GenericArithmeticI.H:124
const char * name(const FArrayBox &a_dummySpecializationArg)
Definition: CH_HDF5.H:741
std::istream & operator>>(std::istream &a_os, IndexTM< T, N > &a_iv)
bool operator<(const FaceIndex &f1, const FaceIndex &f2)
Definition: FaceIndex.H:204
size_t size() const
Definition: Vector.H:177
int queryarr(const char *name, Vector< int > &ref, int start_ix, int num_val) const
access an array of objects
Definition: ParmParse.H:3874
void get(const char *name, int &ref, int ival=0) const
access single object
Definition: ParmParse.H:3702
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:132
const char * prefix() const
return prefix
Definition: ParmParse.H:3539
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:3834
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).