Vcsn  2.3
Be Rational
vcsn::xalloc< StoredType > Class Template Reference

Allocate slots in std::ostreams. More...

#include <xalloc.hh>

Collaboration diagram for vcsn::xalloc< StoredType >:

Classes

class  get_type
 Handle the data to get from the xalloced place. More...
 
class  set_type
 Handle the data to put in the xalloced place. More...
 
class  swap_type
 Swap the data stored in the stream for a given one. More...
 

Public Member Functions

 xalloc ()
 Allocates the slot. More...
 
long int index () const ATTRIBUTE_PURE
 The xalloc index. More...
 
StoredType & operator() (std::ostream &ostr) const
 The stored data as an lvalue. More...
 
set_type set (StoredType &data) const
 A setter. More...
 
get_type get (StoredType &data) const
 A getter. More...
 
swap_type swap (StoredType &data) const
 A swapper. More...
 

Private Attributes

const long int index_
 The index of the slot. More...
 

Detailed Description

template<typename StoredType>
class vcsn::xalloc< StoredType >

Allocate slots in std::ostreams.

Used to store flags in streams.

Set, get or swap data. The idea is to build the right inner class with set, get or swap methods, then use this class as a parameter of operator<<.

Definition at line 38 of file xalloc.hh.

Constructor & Destructor Documentation

template<typename StoredType >
vcsn::xalloc< StoredType >::xalloc ( )

Allocates the slot.

Definition at line 26 of file xalloc.hxx.

Member Function Documentation

template<typename StoredType >
xalloc< StoredType >::get_type vcsn::xalloc< StoredType >::get ( StoredType &  data) const

A getter.

Parameters
datawhere to store the value when the getter is executed.

Definition at line 91 of file xalloc.hxx.

template<typename StoredType >
long int vcsn::xalloc< StoredType >::index ( ) const

The xalloc index.

Definition at line 32 of file xalloc.hxx.

template<typename StoredType >
StoredType & vcsn::xalloc< StoredType >::operator() ( std::ostream &  ostr) const

The stored data as an lvalue.

Definition at line 39 of file xalloc.hxx.

template<typename StoredType >
xalloc< StoredType >::set_type vcsn::xalloc< StoredType >::set ( StoredType &  data) const

A setter.

Parameters
datawhere to find the value when the setter is executed.

Definition at line 66 of file xalloc.hxx.

template<typename StoredType >
xalloc< StoredType >::swap_type vcsn::xalloc< StoredType >::swap ( StoredType &  data) const

A swapper.

Parameters
datavalue to exchange when the swapper is executed.

Definition at line 115 of file xalloc.hxx.

Member Data Documentation

template<typename StoredType>
const long int vcsn::xalloc< StoredType >::index_
private

The index of the slot.

Definition at line 98 of file xalloc.hh.


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