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;
2911 int countval (
const char*
name,
2918 int countname (
const char*
name)
const;
2924 int countname (
const std::string&
name)
const;
2934 int len = (int)strEntry.size() + 1;
2935 bldTable(strEntry.c_str(), len, table);
2949 template <
typename TYPE>
2950 void setVal (
const std::string& varName, TYPE varVal)
2952 std::string valStr =
2953 static_cast<std::ostringstream*
>( &(std::ostringstream() << varVal) )->str();
2954 std::string inEntry = varName +
" = " + valStr;
2955 addEntries(inEntry);
2969 void setStr (
const std::string& varName, std::string varVal)
2971 std::string inEntry = varName +
" = " + varVal;
2972 addEntries(inEntry);
2979 void dumpTable (std::ostream& os)
const;
2990 void get (
const char*
name,
3004 int query (
const char* name,
3017 void get (
const char*
name,
3031 int query (
const char* name,
3044 void get (
const char*
name,
3058 int query (
const char* name,
3071 void get (
const char*
name,
3085 int query (
const char* name,
3098 void get (
const char*
name,
3112 int query (
const char* name,
3127 void get (
const char*
name,
3143 int query (
const char* name,
3160 void getarr (
const char* name,
3178 void getarr (
const char* name,
3179 std::vector<int>& ref,
3197 int queryarr (
const char* name,
3216 int queryarr (
const char* name,
3217 std::vector<int>& ref,
3234 void getarr (
const char* name,
3252 void getarr (
const char* name,
3253 std::vector<unsigned long>& ref,
3271 int queryarr (
const char* name,
3290 int queryarr (
const char* name,
3291 std::vector<unsigned long>& ref,
3308 void getarr (
const char* name,
3326 void getarr (
const char* name,
3327 std::vector<float>& ref,
3345 int queryarr (
const char* name,
3364 int queryarr (
const char* name,
3365 std::vector<float>& ref,
3382 void getarr (
const char* name,
3400 void getarr (
const char* name,
3401 std::vector<double>& ref,
3419 int queryarr (
const char* name,
3438 int queryarr (
const char* name,
3439 std::vector<double>& ref,
3456 void getarr (
const char* name,
3474 void getarr (
const char* name,
3475 std::vector<std::string>& ref,
3493 int queryarr (
const char* name,
3512 int queryarr (
const char* name,
3513 std::vector<std::string>& ref,
3530 void getarr (
const char* name,
3548 void getarr (
const char* name,
3549 std::vector<bool>& ref,
3567 int queryarr (
const char* name,
3586 int queryarr (
const char* name,
3587 std::vector<bool>& ref,
3594 return thePrefix.c_str();
3620 static PP_List<PP_entry*> table;
3625 static char** xargv;
3633 void bldTable (
const char* str,
3635 PP_List<PP_entry*>& tab);
3639 void addDefn (PP_String& def,
3640 PP_List<PP_String>& val,
3641 PP_List<PP_entry*>& tab);
3645 void read_file (
const char* fname,
3646 PP_List<PP_entry*>& tab);
3650 PPType getToken (
const char*,
3661 PP_String thePrefix;
3665 void ppinit (
const char* parfile);
3669 const PP_entry* ppindex (
int n,
3670 const char* name)
const;
3679 void getval (
const char* name,
3688 void getarr (
const char* name,
3694 int queryval (
const char* name,
3699 int queryarr (
const char* name,
3707 bool isInteger (
const PP_String& str,
int& val)
const;
3708 bool isUnsigned(
const PP_String& str,
unsigned long& val)
const;
3709 int isDouble (
const PP_String& str,
double& val)
const;
3710 bool isBool (
const PP_String& str,
bool& val)
const;
3725 ParmParse::PPType typ,
3726 PP_List<PP_String>& vals);
3732 ParmParse::PPType deftype;
3733 PP_Array<PP_String> val;
3735 void dump (std::ostream& os)
const;
3751 const PP_entry* def = ppindex(n,name);
3752 return def == 0 ? 0 : def->val.length();
3761 getval(name,ppInt,&ptr,ival,-1);
3770 return queryval(name,ppInt,&ptr,ival,-1);
3779 getval(name,ppUnsignedLong,&ptr,ival,-1);
3788 return queryval(name,ppUnsignedLong,&ptr,ival,-1);
3797 getval(name,ppFloat,&ptr,ival,-1);
3806 return queryval(name,ppFloat,&ptr,ival,-1);
3815 getval(name,ppDouble,&ptr,ival,-1);
3824 return queryval(name,ppDouble,&ptr,ival,-1);
3833 PP_String pp_string;
3834 getval(name,ppString,&pp_string,ival,-1);
3835 ptr = pp_string.c_str();
3844 PP_String pp_string;
3845 int status = queryval(name,ppString,&pp_string,ival,-1);
3847 ptr = pp_string.c_str();
3857 getval(name,ppBool,&ptr,ival,-1);
3866 return queryval(name,ppBool,&ptr,ival,-1);
3872 std::vector<int>& ptr,
3876 if (ptr.size() < num_val)
3877 ptr.resize(num_val);
3878 int* c_array =
new int[num_val];
3879 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3880 for (
int i = 0; i < num_val; ++i)
3882 ptr[i] = c_array[i];
3894 if (ptr.
size() < num_val)
3896 int* c_array =
new int[num_val];
3897 getarr(name,ppInt,c_array,start_ix,num_val,-1);
3898 for (
int i = 0; i < num_val; ++i)
3900 ptr[i] = c_array[i];
3908 std::vector<int>& ptr,
3912 if (ptr.size() < num_val)
3913 ptr.resize(num_val);
3914 int* c_array =
new int[num_val];
3915 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3918 for (
int i = 0; i < num_val; ++i)
3920 ptr[i] = c_array[i];
3934 if (ptr.
size() < num_val)
3936 int* c_array =
new int[num_val];
3937 int status =
queryarr(name,ppInt,c_array,start_ix,num_val,-1);
3940 for (
int i = 0; i < num_val; ++i)
3942 ptr[i] = c_array[i];
3951 std::vector<float>& ptr,
3955 if (ptr.size() < num_val)
3956 ptr.resize(num_val);
3957 float* c_array =
new float[num_val];
3958 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3959 for (
int i = 0; i < num_val; ++i)
3961 ptr[i] = c_array[i];
3973 if (ptr.
size() < num_val)
3975 float* c_array =
new float[num_val];
3976 getarr(name,ppFloat,c_array,start_ix,num_val,-1);
3977 for (
int i = 0; i < num_val; ++i)
3979 ptr[i] = c_array[i];
3987 std::vector<float>& ptr,
3991 if (ptr.size() < num_val)
3992 ptr.resize(num_val);
3993 float* c_array =
new float[num_val];
3994 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
3997 for (
int i = 0; i < num_val; ++i)
3999 ptr[i] = c_array[i];
4013 if (ptr.
size() < num_val)
4015 float* c_array =
new float[num_val];
4016 int status =
queryarr(name,ppFloat,c_array,start_ix,num_val,-1);
4019 for (
int i = 0; i < num_val; ++i)
4021 ptr[i] = c_array[i];
4031 std::vector<double>& ptr,
4035 if (ptr.size() < num_val)
4036 ptr.resize(num_val);
4037 double* c_array =
new double[num_val];
4038 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4041 cerr <<
"ParmParse::getarr(): " 4043 <<
" not found in table" << endl;
4047 for (
int i = 0; i < num_val; ++i)
4049 ptr[i] = c_array[i];
4061 if (ptr.
size() < num_val)
4063 double* c_array =
new double[num_val];
4064 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4067 cerr <<
"ParmParse::getarr(): " 4069 <<
" not found in table" << endl;
4073 for (
int i = 0; i < num_val; ++i)
4075 ptr[i] = c_array[i];
4083 std::vector<double>& ptr,
4087 if (ptr.size() < num_val)
4088 ptr.resize(num_val);
4089 double* c_array =
new double[num_val];
4090 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4093 for (
int i = 0; i < num_val; ++i)
4095 ptr[i] = c_array[i];
4109 if (ptr.
size() < num_val)
4111 double* c_array =
new double[num_val];
4112 int status =
queryarr(name,ppDouble,c_array,start_ix,num_val,-1);
4115 for (
int i = 0; i < num_val; ++i)
4117 ptr[i] = c_array[i];
4127 std::vector<std::string>& ptr,
4131 if (ptr.size() < num_val)
4132 ptr.resize(num_val);
4133 PP_String* c_array =
new PP_String[num_val];
4134 getarr(name,ppString,c_array,start_ix,num_val,-1);
4135 for (
int i = 0; i < num_val; ++i)
4137 ptr[i] = c_array[i].c_str();
4149 if (ptr.
size() < num_val)
4151 PP_String* c_array =
new PP_String[num_val];
4152 getarr(name,ppString,c_array,start_ix,num_val,-1);
4153 for (
int i = 0; i < num_val; ++i)
4155 ptr[i] = c_array[i].c_str();
4163 std::vector<std::string>& ptr,
4167 if (ptr.size() < num_val)
4168 ptr.resize(num_val);
4169 PP_String* c_array =
new PP_String[num_val];
4170 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4173 for (
int i = 0; i < num_val; ++i)
4175 ptr[i] = c_array[i].c_str();
4189 if (ptr.
size() < num_val)
4191 PP_String* c_array =
new PP_String[num_val];
4192 int status =
queryarr(name,ppString,c_array,start_ix,num_val,-1);
4195 for (
int i = 0; i < num_val; ++i)
4197 ptr[i] = c_array[i].c_str();
4208 std::vector<bool>& ptr,
4212 if (ptr.size() < num_val)
4213 ptr.resize(num_val);
4214 bool* c_array =
new bool[num_val];
4215 getarr(name,ppBool,c_array,start_ix,num_val,-1);
4216 for (
int i = 0; i < num_val; ++i)
4218 ptr[i] = c_array[i];
4226 std::vector<bool>& ptr,
4230 if (ptr.size() < num_val)
4231 ptr.resize(num_val);
4232 bool* c_array =
new bool[num_val];
4233 int status =
queryarr(name,ppBool,c_array,start_ix,num_val,-1);
4236 for (
int i = 0; i < num_val; ++i)
4238 ptr[i] = c_array[i];
4249 ParmParse::isInteger (
const PP_String& str,
4256 val = (int) strtol(str.c_str(), &endp, 10);
4262 ParmParse::isUnsigned (
const PP_String& str,
4263 unsigned long & val)
const 4266 val = strtoul(str.c_str(), &endp, 10);
4272 ParmParse::isDouble (
const PP_String& str,
4276 val = std::strtod(str.c_str(), &endp);
4282 ParmParse::isBool (
const PP_String& str,
4285 PP_String str_lc( str );
4287 if ( str_lc ==
"true" || str_lc ==
"1" )
4291 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:3745
#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:3766
void setStr(const std::string &varName, std::string varVal)
Definition: ParmParse.H:2969
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:864
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:3929
void get(const char *name, int &ref, int ival=0) const
access single object
Definition: ParmParse.H:3757
void setVal(const std::string &varName, TYPE varVal)
Definition: ParmParse.H:2950
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:3592
void addEntries(const std::string &strEntry)
Definition: ParmParse.H:2932
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:3889
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).