Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::chrono::duration_units< CharT > Class Template Referenceabstract

duration_units facet gives useful information about the duration units, as the number of plural forms, the plural form associated to a duration, the text associated to a plural form and a duration's period, More...

#include <duration_units.hpp>

Inheritance diagram for boost::chrono::duration_units< CharT >:
Collaboration diagram for boost::chrono::duration_units< CharT >:

Public Types

typedef CharT char_type
 Type of character the facet is instantiated on. More...
 
typedef std::basic_string< CharT > string_type
 Type of character string passed to member functions. More...
 

Public Member Functions

 duration_units (size_t refs=0)
 Construct a duration_units facet. More...
 
virtual const string_typeget_n_d_valid_units_start () const =0
 
virtual const string_typeget_n_d_valid_units_end () const =0
 calls the do_... More...
 
virtual const string_typeget_valid_units_start () const =0
 
virtual const string_typeget_valid_units_end () const =0
 
virtual bool match_n_d_valid_unit (const string_type *k) const =0
 
virtual bool match_valid_unit (const string_type *k, rt_ratio &rt) const =0
 
virtual string_type get_pattern () const =0
 calls the do_... More...
 
template<typename Rep , typename Period >
string_type get_unit (duration_style style, duration< Rep, Period > const &d) const
 calls the do_... More...
 
template<typename Rep , typename Period >
string_type get_n_d_unit (duration_style style, duration< Rep, Period > const &d) const
 calls the do_... More...
 
template<typename Period >
bool is_named_unit () const
 calls the do_... More...
 

Static Public Attributes

static std::locale::id id
 Unique identifier for this type of facet. More...
 

Protected Member Functions

virtual ~duration_units ()
 Destroys the facet More...
 
virtual string_type do_get_n_d_unit (duration_style style, rt_ratio rt, intmax_t v) const =0
 
virtual string_type do_get_unit (duration_style style, rt_ratio rt, intmax_t v) const =0
 
virtual bool do_is_named_unit (rt_ratio rt) const =0
 

Detailed Description

template<typename CharT = char>
class boost::chrono::duration_units< CharT >

duration_units facet gives useful information about the duration units, as the number of plural forms, the plural form associated to a duration, the text associated to a plural form and a duration's period,

Member Typedef Documentation

template<typename CharT = char>
typedef CharT boost::chrono::duration_units< CharT >::char_type

Type of character the facet is instantiated on.

template<typename CharT = char>
typedef std::basic_string<CharT> boost::chrono::duration_units< CharT >::string_type

Type of character string passed to member functions.

Constructor & Destructor Documentation

template<typename CharT = char>
boost::chrono::duration_units< CharT >::duration_units ( size_t  refs = 0)
inlineexplicit

Construct a duration_units facet.

Parameters
refsConstruct a duration_units facet. If the refs argument is 0 then destruction of the object is delegated to the locale, or locales, containing it. This allows the user to ignore lifetime management issues. On the other had, if refs is 1 then the object must be explicitly deleted; the locale will not do so. In this case, the object can be maintained across the lifetime of multiple locales.
template<typename CharT = char>
virtual boost::chrono::duration_units< CharT >::~duration_units ( )
inlineprotectedvirtual

Destroys the facet

Member Function Documentation

template<typename CharT = char>
virtual string_type boost::chrono::duration_units< CharT >::do_get_n_d_unit ( duration_style  style,
rt_ratio  rt,
intmax_t  v 
) const
protectedpure virtual
Returns
the [N/D] suffix unit associated to this duration.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_units< CharT >::get_n_d_unit().

template<typename CharT = char>
virtual string_type boost::chrono::duration_units< CharT >::do_get_unit ( duration_style  style,
rt_ratio  rt,
intmax_t  v 
) const
protectedpure virtual
Returns
the unit associated to this duration.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_units< CharT >::get_unit().

template<typename CharT = char>
virtual bool boost::chrono::duration_units< CharT >::do_is_named_unit ( rt_ratio  rt) const
protectedpure virtual
Returns
true if the unit associated to the given Period is named, false otherwise.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_units< CharT >::is_named_unit().

template<typename CharT = char>
template<typename Rep , typename Period >
string_type boost::chrono::duration_units< CharT >::get_n_d_unit ( duration_style  style,
duration< Rep, Period > const &  d 
) const
inline
template<typename CharT = char>
virtual const string_type* boost::chrono::duration_units< CharT >::get_n_d_valid_units_end ( ) const
pure virtual

calls the do_...

Returns
pointer to the end of valid [N/D] units.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_get< CharT, InputIterator >::do_get_n_d_valid_unit().

template<typename CharT = char>
virtual const string_type* boost::chrono::duration_units< CharT >::get_n_d_valid_units_start ( ) const
pure virtual
Returns
pointer to the start of valid [N/D] units.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_get< CharT, InputIterator >::do_get_n_d_valid_unit().

template<typename CharT = char>
virtual string_type boost::chrono::duration_units< CharT >::get_pattern ( ) const
pure virtual

calls the do_...

Returns
the pattern to be used by default.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_put< CharT, OutputIterator >::put().

template<typename CharT = char>
template<typename Rep , typename Period >
string_type boost::chrono::duration_units< CharT >::get_unit ( duration_style  style,
duration< Rep, Period > const &  d 
) const
inline
template<typename CharT = char>
virtual const string_type* boost::chrono::duration_units< CharT >::get_valid_units_end ( ) const
pure virtual
template<typename CharT = char>
virtual const string_type* boost::chrono::duration_units< CharT >::get_valid_units_start ( ) const
pure virtual
Returns
pointer to the start of valid units, symbol or prefix with its different plural forms.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_get< CharT, InputIterator >::do_get_valid_unit().

template<typename CharT = char>
template<typename Period >
bool boost::chrono::duration_units< CharT >::is_named_unit ( ) const
inline

calls the do_...

Returns
true if the unit associated to the given Period is named, false otherwise.

References boost::chrono::duration_units< CharT >::do_is_named_unit().

template<typename CharT = char>
virtual bool boost::chrono::duration_units< CharT >::match_n_d_valid_unit ( const string_type k) const
pure virtual
Parameters
kthe found pointer to the [N/D] unit.
Returns
true if k matches a valid unit.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_get< CharT, InputIterator >::do_get_n_d_valid_unit().

template<typename CharT = char>
virtual bool boost::chrono::duration_units< CharT >::match_valid_unit ( const string_type k,
rt_ratio rt 
) const
pure virtual
Parameters
kthe found pointer to the unit. rt is set to the valid Period when the k matches a valid unit.
Returns
true if k matches a valid unit.

Implemented in boost::chrono::duration_units_default< CharT >.

Referenced by boost::chrono::duration_get< CharT, InputIterator >::do_get_valid_unit().

Member Data Documentation

template<typename CharT = char>
std::locale::id boost::chrono::duration_units< CharT >::id
static

Unique identifier for this type of facet.


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