clingo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Public Types | Public Member Functions | Protected Attributes | List of all members
ProgramOptions::NotifiedValue< T > Class Template Reference

#include <typed_value.h>

Inheritance diagram for ProgramOptions::NotifiedValue< T >:
Inheritance graph
Collaboration diagram for ProgramOptions::NotifiedValue< T >:
Collaboration graph

Public Types

typedef detail::Parser< T >::type parser_type
 
typedef detail::Notifier
< const T * > 
notifier_type
 
- Public Types inherited from ProgramOptions::Value
enum  State { value_unassigned = 0, value_defaulted = 1, value_fixed = 2 }
 Possible (tentative) states of an option value. More...
 
enum  DescType { desc_name = 1, desc_default = 2, desc_implicit = 4 }
 Possible value descriptions. More...
 

Public Member Functions

 NotifiedValue (T *(*cf)(), const notifier_type &n, parser_type p)
 
NotifiedValue< T > * storeTo (T &obj)
 
bool doParse (const std::string &name, const std::string &value)
 
- Public Member Functions inherited from ProgramOptions::Value
virtual ~Value ()
 
State state () const
 Returns the current state of this value. More...
 
Valuestate (Value::State s)
 
const char * arg () const
 Returns the name of this value. More...
 
Valuearg (const char *n)
 
Valuealias (char c)
 Sets an alias name for the corresponding option. More...
 
char alias () const
 
Valuelevel (DescriptionLevel lev)
 Sets a description level for the corresponding option. More...
 
DescriptionLevel level () const
 Returns the description level of the corresponding option. More...
 
bool isNegatable () const
 Returns true if this is the value of an negatable option. More...
 
Valuenegatable ()
 
bool isImplicit () const
 Returns true if value can be implicitly created from an empty string. More...
 
bool isFlag () const
 Returns true if this is the value of an option flag. More...
 
Valueflag ()
 
bool isComposing () const
 Returns true if the value of this option can be composed from multiple source. More...
 
Valuecomposing ()
 
ValuedefaultsTo (const char *v)
 
const char * defaultsTo () const
 Returns the default value of this or 0 none exists. More...
 
Valueimplicit (const char *str)
 
const char * implicit () const
 Returns the implicit value of this or 0 if isImplicit() == false. More...
 
bool parse (const std::string &name, const std::string &value, State st=value_fixed)
 Parses the given string and updates the value's state. More...
 

Protected Attributes

union {
   T *   address
 
   T *(*   create )()
 
value_
 
parser_type parser_
 
notifier_type notify_
 

Additional Inherited Members

- Protected Types inherited from ProgramOptions::Value
enum  Property {
  property_implicit = 1, property_flag = 3, property_composing = 4, property_negatable = 8,
  property_location =16, not_a_property =32
}
 
typedef unsigned char byte_t
 
- Protected Member Functions inherited from ProgramOptions::Value
 Value (byte_t flagSet, State initial=value_unassigned)
 
void setProperty (Property f)
 
void clearProperty (Property f)
 
bool hasProperty (Property f) const
 
bool state (bool b, State s)
 
const char * desc (DescType t) const
 
Valuedesc (DescType t, const char *d)
 

Member Typedef Documentation

template<class T>
typedef detail::Notifier<const T*> ProgramOptions::NotifiedValue< T >::notifier_type
template<class T>
typedef detail::Parser<T>::type ProgramOptions::NotifiedValue< T >::parser_type

Constructor & Destructor Documentation

template<class T>
ProgramOptions::NotifiedValue< T >::NotifiedValue ( T *(*)()  cf,
const notifier_type n,
parser_type  p 
)
inline

Member Function Documentation

template<class T>
bool ProgramOptions::NotifiedValue< T >::doParse ( const std::string &  name,
const std::string &  value 
)
inlinevirtual

Implements ProgramOptions::Value.

Here is the call graph for this function:

template<class T>
NotifiedValue<T>* ProgramOptions::NotifiedValue< T >::storeTo ( T &  obj)
inline

Here is the call graph for this function:

Member Data Documentation

template<class T>
T* ProgramOptions::NotifiedValue< T >::address
template<class T>
T*(* ProgramOptions::NotifiedValue< T >::create)()
template<class T>
notifier_type ProgramOptions::NotifiedValue< T >::notify_
protected
template<class T>
parser_type ProgramOptions::NotifiedValue< T >::parser_
protected
union { ... } ProgramOptions::NotifiedValue< T >::value_

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