![]() |
PEARL
Parallel Event Access and Replay Library
|
Representation of a string definition. More...
#include <pearl/String.h>
Public Types | |
typedef uint32_t | IdType |
String definition identifier type. | |
Public Member Functions | |
IdType | getId () const |
Get global identifier. | |
const std::string | getString () const |
Get string data as C++ std::string. | |
const char * | getCString () const |
Get string data as C string. | |
Constructors & destructor | |
String (IdType id, const std::string &str) | |
Constructor. | |
Static Public Attributes | |
static const IdType | NO_ID = (~static_cast<IdType>(0)) |
Numerical identifier used for undefined string definitions. | |
static const String | UNDEFINED |
static const IdType | MACHINE_ID = NO_ID - 1 |
Numerical identifier used for the String::MACHINE instance. | |
static const String | MACHINE |
static const IdType | NODE_ID = NO_ID - 2 |
Numerical identifier used for the String::NODE instance. | |
static const String | NODE |
Related Functions | |
(Note that these are not member functions.) | |
bool | operator== (const String &lhs, const String &rhs) |
Equality operator. | |
bool | operator!= (const String &lhs, const String &rhs) |
Inequality operator. | |
Stream I/O functions | |
std::ostream & | operator<< (std::ostream &stream, const String &item) |
Stream output operator. |
Instances of the String class provide information about global string definitions. They are referenced by various other definitions, such as Region or Location, and associate a character string with a numerical identifier. String definitions are globally defined and continously enumerated, i.e., the ID is element of [0,#strings-1].
typedef uint32_t pearl::String::IdType |
pearl::String::String | ( | IdType | id, |
const std::string & | str | ||
) |
Creates a new string definition instance using the given global identifier id and the character string str.
id | Global string identifier |
str | Associated character string |
const char* pearl::String::getCString | ( | ) | const |
Returns the character string associated to the string definition as a null-terminated C string. For the returned pointer, the same restrictions apply as for the c_str() member function of the std::string class. That is, the returned array points to an internal location large enough to hold the character string plus its terminating null-character, but the values in this array should not be modified in the program.
IdType pearl::String::getId | ( | ) | const |
Returns the global identifier of the string definition.
const std::string pearl::String::getString | ( | ) | const |
Returns the character string associated to the string definition as a C++ std::string object.
Compares two string definition objects lhs and rhs for inequality. Two string definitions are considered unequal if either their global identifiers or their associated characters strings differ.
lhs | Left-hand operand |
rhs | Right-hand operand |
std::ostream & operator<< | ( | std::ostream & | stream, |
const String & | item | ||
) | [related] |
Prints the contents of the given string definition object item to an output stream in a human-readable form.
stream | Output stream |
item | String definition object |
Compares two string definition objects lhs and rhs for equality. Two string definitions are considered equal if both their global identifiers and their associated characters strings are identical.
lhs | Left-hand operand |
rhs | Right-hand operand |
const String pearl::String::MACHINE [static] |
Static instance of class String providing the character string "machine" for the EPIK trace reader.
const IdType pearl::String::MACHINE_ID = NO_ID - 1 [static] |
const IdType pearl::String::NO_ID = (~static_cast<IdType>(0)) [static] |
const String pearl::String::NODE [static] |
Static instance of class String providing the character string "node" for the EPIK trace reader.
const IdType pearl::String::NODE_ID = NO_ID - 2 [static] |
const String pearl::String::UNDEFINED [static] |
Static instance of class String representing undefined string entries in other definitions.
![]() |
Copyright © 1998–2014 Forschungszentrum Jülich GmbH,
Jülich Supercomputing Centre
Copyright © 2009–2014 German Research School for Simulation Sciences GmbH, Laboratory for Parallel Programming |