|
LRDE Tiger Compiler
1.34a $Id: 7fef12e1f5fa43449d667a0eec1d837c40fc1202 $
|
Allocate slots in std::ostreams. More...
#include <xalloc.hh>

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. | |
| long int | index () const |
| The xalloc index. | |
| StoredType & | operator() (std::ostream &ostr) const |
| The stored data as an lvalue. | |
| set_type | set (StoredType &data) const |
| get_type | get (StoredType &data) const |
| swap_type | swap (StoredType &data) const |
Private Attributes | |
| const long int | index_ |
| The index of the slot. | |
Allocate slots in std::ostreams.
Used to store flags in streams so that calling print with additional parameters is no longer required (for example in ast/libast.hh).
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<<.
| misc::xalloc< StoredType >::xalloc | ( | ) |
Allocates the slot.
| xalloc< StoredType >::get_type misc::xalloc< StoredType >::get | ( | StoredType & | data | ) | const |
A getter.
| data | where to store the value when the getter is executed. |
| long int misc::xalloc< StoredType >::index | ( | ) | const |
The xalloc index.
| StoredType & misc::xalloc< StoredType >::operator() | ( | std::ostream & | ostr | ) | const |
The stored data as an lvalue.
| xalloc< StoredType >::set_type misc::xalloc< StoredType >::set | ( | StoredType & | data | ) | const |
A setter.
| data | where to find the value when the setter is executed. |
| xalloc< StoredType >::swap_type misc::xalloc< StoredType >::swap | ( | StoredType & | data | ) | const |
A swapper.
| data | value to exchange when the swapper is executed. |
Referenced by type::Function::dump(), target::instructions_dump(), regalloc::RegisterAllocator::operator()(), and misc::xalloc< StoredType >::swap_type::operator()().
|
private |
The index of the slot.