Vcsn  2.8
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

◆ xalloc()

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

Allocates the slot.

Definition at line 26 of file xalloc.hxx.

Member Function Documentation

◆ get()

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 110 of file xalloc.hxx.

References vcsn::xalloc< StoredType >::get_type::get_type().

Here is the call graph for this function:

◆ index()

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

The xalloc index.

Definition at line 32 of file xalloc.hxx.

References vcsn::xalloc< StoredType >::index_.

Referenced by vcsn::xalloc< StoredType >::operator()().

◆ operator()()

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

The stored data as an lvalue.

Definition at line 61 of file xalloc.hxx.

References vcsn::xalloc< StoredType >::index().

Here is the call graph for this function:

◆ set()

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 85 of file xalloc.hxx.

References vcsn::xalloc< StoredType >::set_type::set_type().

Here is the call graph for this function:

◆ swap()

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 134 of file xalloc.hxx.

References vcsn::xalloc< StoredType >::swap_type::swap_type().

Here is the call graph for this function:

Member Data Documentation

◆ index_

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

The index of the slot.

Definition at line 98 of file xalloc.hh.

Referenced by vcsn::xalloc< StoredType >::index().


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