6 #ifndef VCSN_MISC_XALLOC_HH
7 # define VCSN_MISC_XALLOC_HH
10 # include <functional>
19 virtual void operator()(std::ostream& o)
const = 0;
38 template <
class StoredType>
105 long int index() const ATTRIBUTE_PURE;
107 StoredType& operator()(std::ostream& ostr) const;
124 # include <vcsn/misc/xalloc.hxx>
126 #endif // !VCSN_MISC_XALLOC_HH
std::ostream & operator<<(std::ostream &os, direction d)
Pretty-printing.
get_type(const xalloc &slot, StoredType &data)
Set data_ to data.
Handle the data to get from the xalloced place.
swap_type swap(StoredType &data) const
A swapper.
StoredType & data_
Variable in which we return the xalloc data.
const xalloc & slot_
The xalloced data.
StoredType & data_
Variable in which we store the data to be swapped.
virtual void operator()(std::ostream &o) const =0
set_type set(StoredType &data) const
A setter.
const xalloc & slot_
The xalloced data.
Handle the data to put in the xalloced place.
Defines the operator() for the classes get_type, set_type and swap_type.
xalloc()
Allocates the slot.
void operator()(std::ostream &ostr) const
Set the data in the xalloced place.
const long int index_
The index of the slot.
Allocate slots in std::ostreams.
get_type get(StoredType &data) const
A getter.
const xalloc & slot_
The xalloced data.
void operator()(std::ostream &ostr) const
Get the data from the xalloced place.
StoredType & data_
Data to put in the stream.
void operator()(std::ostream &ostr) const
Swap the data from the xalloced place for a given one.
Swap the data stored in the stream for a given one.
swap_type(const xalloc &slot, StoredType &data)
Set data_ to data.
long int index() const ATTRIBUTE_PURE
The xalloc index.
set_type(const xalloc &slot, StoredType &data)
Set data_ to data.