|
PSCF v1.3.3
|
Miscellaneous utility classes and functions. More...
Classes | |
| class | Util::Bit |
| Represents a specific bit location within an unsigned int. More... | |
| class | Util::Exception |
| A user-defined exception. More... | |
| class | Util::FileMaster |
| A FileMaster manages input and output files for a simulation. More... | |
| class | Util::FlagSet |
| A set of boolean variables represented by characters. More... | |
| class | Util::Log |
| A static class that holds a log output stream. More... | |
| class | Util::Memory |
| Provides method to allocate array. More... | |
| class | Util::Notifier< Event > |
| Abstract template for a notifier (or subject) in the Observer design pattern. More... | |
| class | Util::Observer< Event > |
| Abstract class template for observer in the observer design pattern. More... | |
| class | Util::Setable< T > |
| Template for a value that can be set or declared null (i.e., unknown). More... | |
| class | Util::Timer |
| Wall clock timer. More... | |
Functions | |
| std::string | Util::toString (int n) |
| Return string representation of an integer. | |
| int | Util::rStrip (std::string &string) |
| Strip trailing whitespace from a string. | |
| void | Util::checkString (std::istream &in, const std::string &expected) |
| Extract string from stream, and compare to expected value. | |
| bool | Util::getLine (std::istream &in, std::stringstream &line) |
| Read the next line into a stringstream. | |
| bool | Util::getNextLine (std::istream &in, std::string &line) |
| Read the next non-empty line into a string, strip trailing whitespace. | |
| bool | Util::getNextLine (std::istream &in, std::stringstream &line) |
| Read next non-empty line into a stringstream, strip trailing whitespace. | |
| template<typename D, typename B, typename M> | |
| ptrdiff_t | Util::memberOffset (D &object, M B::*memPtr) |
| Template for calculating offsets of data members. | |
Miscellaneous utility classes and functions.
| std::string Util::toString | ( | int | n | ) |
Return string representation of an integer.
| n | integer to be converted. |
Definition at line 52 of file ioUtil.cpp.
Referenced by Pscf::R1d::Sweep::getSolution(), Pscf::Prdc::MixturePrdc< D, PT, ST, TT >::writeQAll(), and Pscf::R1d::System::writeQAll().
| int Util::rStrip | ( | std::string & | string | ) |
Strip trailing whitespace from a string.
| string | string (stripped upon return). |
Definition at line 18 of file ioUtil.cpp.
Referenced by getNextLine(), getNextLine(), and Util::XmlAttribute::match().
| void Util::checkString | ( | std::istream & | in, |
| const std::string & | expected ) |
Extract string from stream, and compare to expected value.
| Exception | if input value differs from expected value. |
| in | input stream |
| expected | expected value of string read from stream |
Definition at line 37 of file ioUtil.cpp.
References Util::Log::file(), and UTIL_THROW.
Referenced by Pscf::Rpc::RGridTrajectoryReader< D >::readFrame(), and Pscf::Rpg::RGridTrajectoryReader< D >::readFrame().
| bool Util::getLine | ( | std::istream & | in, |
| std::stringstream & | line ) |
Read the next line into a stringstream.
Variant of std::getline(). Does not strip trailing whitespace.
| in | input stream from which to read. |
| line | stringstream containing line, on output. |
Definition at line 62 of file ioUtil.cpp.
| bool Util::getNextLine | ( | std::istream & | in, |
| std::string & | line ) |
Read the next non-empty line into a string, strip trailing whitespace.
Variant of std::getline() that skips empty lines.
| in | input stream from which to read. |
| line | string with next non-empty line, on output. |
Definition at line 79 of file ioUtil.cpp.
References rStrip().
Referenced by Pscf::Rpc::RGridTrajectoryReader< D >::readFrame(), and Pscf::Rpg::RGridTrajectoryReader< D >::readFrame().
| bool Util::getNextLine | ( | std::istream & | in, |
| std::stringstream & | line ) |
Read next non-empty line into a stringstream, strip trailing whitespace.
Variant of std::getline() that skips empty lines and uses stringstream.
| in | input stream from which to read. |
| line | stringstream containing next non-empty line, on output. |
Definition at line 100 of file ioUtil.cpp.
References rStrip().