generic_spec< T > Class Template Reference

#include <generic_spec.h>

Collaboration diagram for generic_spec< T >:
Collaboration graph
[legend]

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

data
bool is_all

Detailed Description

template<class T>
class generic_spec< T >

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.


Constructor & Destructor Documentation

template<class T >
generic_spec< T >::generic_spec (  )  [inline]

build a default spec which match anything

Definition at line 69 of file generic_spec.h.


Member Function Documentation

template<class T>
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.

template<class T>
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.

template<class T>
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.

template<>
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)

template<class T >
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().

Here is the call graph for this function:

template<class T>
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.


Field Documentation

template<class T>
T generic_spec< T >::data [private]
template<class T>
bool generic_spec< T >::is_all [private]

The documentation for this class was generated from the following file:

Generated on 8 Nov 2012 for Oprofile by  doxygen 1.6.1