Gnash  0.8.11dev
Public Member Functions | List of all members
accumulator_type< T > Class Template Reference

An accumulating option value to handle multiple incrementing options. More...

#include <accumulator.h>

Inheritance diagram for accumulator_type< T >:

Public Member Functions

 accumulator_type ()
 
accumulator_typenotifier (std::function< void(const T &)> f)
 Set the notifier function. More...
 
accumulator_typedefault_value (const T &t)
 Set the default value for this option. More...
 
accumulator_typeimplicit_value (const T &t)
 Set the implicit value for this option. More...
 
virtual std::string name () const
 
virtual unsigned min_tokens () const
 There are no tokens for an accumulator_type. More...
 
virtual unsigned max_tokens () const
 
virtual bool is_composing () const
 Accumulating from different sources is silly. More...
 
virtual bool is_required () const
 Requiring one or more appearances is unlikely. More...
 
virtual void parse (boost::any &value_store, const std::vector< std::string > &new_tokens, bool) const
 Every appearance of the option simply increments the value. More...
 
virtual bool apply_default (boost::any &value_store) const
 If the option doesn't appear, this is the default value. More...
 
virtual void notify (const boost::any &value_store) const
 Notify the user function with the value of the value store. More...
 
virtual ~accumulator_type ()
 

Detailed Description

template<typename T>
class accumulator_type< T >

An accumulating option value to handle multiple incrementing options.

Constructor & Destructor Documentation

§ accumulator_type()

template<typename T >
accumulator_type< T >::accumulator_type ( )
inline

§ ~accumulator_type()

template<typename T >
virtual accumulator_type< T >::~accumulator_type ( )
inlinevirtual

References gnash::key::T.

Member Function Documentation

§ apply_default()

template<typename T >
virtual bool accumulator_type< T >::apply_default ( boost::any &  value_store) const
inlinevirtual

If the option doesn't appear, this is the default value.

§ default_value()

template<typename T >
accumulator_type* accumulator_type< T >::default_value ( const T &  t)
inline

Set the default value for this option.

References gnash::key::t.

§ implicit_value()

template<typename T >
accumulator_type* accumulator_type< T >::implicit_value ( const T &  t)
inline

Set the implicit value for this option.

Unlike for program_options::value, this specifies a value to be applied on each occurence of the option.

References gnash::key::t.

§ is_composing()

template<typename T >
virtual bool accumulator_type< T >::is_composing ( ) const
inlinevirtual

Accumulating from different sources is silly.

§ is_required()

template<typename T >
virtual bool accumulator_type< T >::is_required ( ) const
inlinevirtual

Requiring one or more appearances is unlikely.

§ max_tokens()

template<typename T >
virtual unsigned accumulator_type< T >::max_tokens ( ) const
inlinevirtual

§ min_tokens()

template<typename T >
virtual unsigned accumulator_type< T >::min_tokens ( ) const
inlinevirtual

There are no tokens for an accumulator_type.

§ name()

template<typename T >
virtual std::string accumulator_type< T >::name ( ) const
inlinevirtual

§ notifier()

template<typename T >
accumulator_type* accumulator_type< T >::notifier ( std::function< void(const T &)>  f)
inline

Set the notifier function.

References gnash::key::f.

§ notify()

template<typename T >
virtual void accumulator_type< T >::notify ( const boost::any &  value_store) const
inlinevirtual

Notify the user function with the value of the value store.

§ parse()

template<typename T >
virtual void accumulator_type< T >::parse ( boost::any &  value_store,
const std::vector< std::string > &  new_tokens,
bool   
) const
inlinevirtual

Every appearance of the option simply increments the value.

There should never be any tokens.

References gnash::key::T.


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