#include <generic_spec.h>
Public Member Functions | |
generic_spec () | |
void | set (std::string const &) |
bool | is_set () const |
return true if a specific value is held by this container | |
T const | value () const |
return the specific value (only if is_set() == true) | |
bool | match (T const &rhs) const |
return true if rhs match this spec. Sub part of PP:3.24 | |
bool | match (generic_spec< T > const &rhs) const |
return true if rhs match this spec. Sub part of PP:3.24 | |
template<> | |
void | set (std::string const &str) |
Private Attributes | |
T | data |
bool | is_all |
used to hold something like { int cpu_nr, bool is_all }; to store a sub part of a samples filename see PP:3.21.
Definition at line 27 of file generic_spec.h.
generic_spec< T >::generic_spec | ( | ) | [inline] |
build a default spec which match anything
Definition at line 69 of file generic_spec.h.
bool generic_spec< T >::is_set | ( | ) | const [inline] |
return true if a specific value is held by this container
Definition at line 41 of file generic_spec.h.
bool generic_spec< T >::match | ( | generic_spec< T > const & | rhs | ) | const [inline] |
return true if rhs match this spec. Sub part of PP:3.24
Definition at line 58 of file generic_spec.h.
bool generic_spec< T >::match | ( | T const & | rhs | ) | const [inline] |
return true if rhs match this spec. Sub part of PP:3.24
Definition at line 53 of file generic_spec.h.
void generic_spec< std::string >::set | ( | std::string const & | str | ) | [inline] |
We don't use generic_spec<string>, since it's probably an error to try to use generic_spec<string> we specialize but don't define it to get a link error (using generic_spec<string> is problematic because g.set("all") is ambiguous)
void generic_spec< T >::set | ( | std::string const & | str | ) | [inline] |
build a spec from a string, valid argument are "all" or a string convertible to T through istringtream(str) >> data conversion is strict, no space are allowed at begin or end of str
Definition at line 78 of file generic_spec.h.
References generic_spec< T >::data, generic_spec< T >::is_all, and op_lexical_cast().
T const generic_spec< T >::value | ( | ) | const [inline] |
return the specific value (only if is_set() == true)
Definition at line 46 of file generic_spec.h.
T generic_spec< T >::data [private] |
Definition at line 63 of file generic_spec.h.
Referenced by generic_spec< pid_t >::match(), generic_spec< T >::set(), and generic_spec< pid_t >::value().
bool generic_spec< T >::is_all [private] |
Definition at line 64 of file generic_spec.h.
Referenced by generic_spec< pid_t >::is_set(), generic_spec< pid_t >::match(), generic_spec< T >::set(), and generic_spec< pid_t >::value().