Utility constructs for Vaucanson

Collaboration diagram for Utility constructs for Vaucanson:


Files

file  char_traits.hh
 Generic char_traits declarations.
file  deferrer.hh
 Declarations for the Deferrer class.
file  deferrer.hxx
 Definitions for the Deferrer class.
file  window.hh
 Window class for regular expression search on streams.

Namespaces

namespace  utility
 The namespace for utility constructs.

Modules

 Contract checking for Vaucanson
 In Vaucanson, several types of contracts can be placed in the library code.

Classes

struct  generic_int_type
 Generic and under-efficient int_type implementation for char_traits. More...
struct  char_traits
 Generic char_traits. More...
struct  DeferrerDebugPart
 Helper class for Deferrer. More...
struct  DeferrerDebugPart
 Helper class for Deferrer. More...
struct  DeferrerDebugPart< T, false >
struct  Deferrer
 This class defers the creation of its template parameter. More...
struct  remove_reference
 Turn a reference type into its corresponding plain type. More...
struct  remove_reference
 Turn a reference type into its corresponding plain type. More...
struct  remove_reference< T & >
struct  remove_reference< const T & >
struct  remove_const
 Turn a const type into its corresponding mutable type. More...
struct  remove_const
 Turn a const type into its corresponding mutable type. More...
struct  remove_const < const T >
struct  static_if
 Choose between two types or values depending on a constant Boolean. More...
struct  static_if
 Choose between two types or values depending on a constant Boolean. More...
struct  static_if< false, T, U >
struct  static_if_simple
 Choose between two types or values depending on a constant Boolean. More...
struct  static_if_simple
 Choose between two types or values depending on a constant Boolean. More...
struct  static_if_simple< false, T, U >
struct  static_eq
 Test for equality between two types. More...
struct  static_eq
 Test for equality between two types. More...
struct  static_eq< T, T >
struct  static_pow_compute
 These are auxilliary functions for static_pow. More...
struct  static_pow_compute
 These are auxilliary functions for static_pow. More...
struct  static_pow_compute< N, P, true >
struct  static_pow_compute< N, 0, true >
struct  static_pow
 Static exponentiation. More...
struct  static_pow_minus_one
 Static exponentiation, result minus one. More...
class  SupportIterator
 Iterator over the Support generic class. More...
class  Support< std::map< U, T > >
 Support<map<U, T> > is a const adapter of std::map to container. More...
class  SparseIterator
 SparseIterator is an iterator over range except some points. More...
class  SparseInterval
 Container over a sparse integer range. More...
class  SelfIterator
 SelfIterator is an iterator which is also a container. More...
struct  Window
 Handle windows in streams for performing regular expression search. More...

Small alphabetic letters random generation tools.

typedef vcsn::algebra::static_char_interval<
'a', 'z'> 
utility::random::small_alpha_interval_t
typedef vcsn::algebra::static_ranged<
char, small_alpha_interval_t
utility::random::small_alpha_letter_t
template<>
small_alpha_letter_t utility::random::generate< small_alpha_letter_t > ()
 Generates a random small alphabetic letter.
void utility::Window::moveto (length_t offset)
 Move to a specific offset.
void utility::Window::moveto (iterator_t position)
 Move to a specific offset.

Accessors

letter_t utility::Window::eol_value () const
 Get the letter value used for ending lines.
iterator_t utility::Window::begin () const
 Get an iterator to the beginning of the stream.
iterator_t utility::Window::stream () const
 Get an iterator to the current position in the stream.
iterator_t utility::Window::end () const
 Get an iterator to the end of the stream.
size_t utility::Window::offset () const
 Get the actual offset in the stream.
length_t utility::Window::length () const
 Get the maximum length of the window.
string_t utility::Window::window () const
 Get the window as a basic_string<letter_t>.

Defines

#define SELECT(T)   (*(const T*)0)
 Type argument for types with no commas (simple or 1-par templates).
#define SELECT2(T1, T2)   (*(const T1 , T2 *)0)
 Type argument for types with one comma (2-parameters templates).
#define SELECT3(T1, T2, T3)   (*(const T1 , T2, T3 *)0)
 Type argument for types with two commas (3-parameters templates).
#define SELECT4(T1, T2, T3, T4)   (*(const T1 , T2, T3, T4 *)0)
 Type argument for types with three commas (4-parameters templates).
#define SELECTOR(T)   const T &
 Type formal argument for types with no commas (simple or 1-par templates).
#define SELECTOR2(T1, T2)   const T1 , T2 &
 Type formal argument for types with one comma (2-parameters templates).
#define SELECTOR3(T1, T2, T3)   const T1 , T2, T3 &
 Type formal argument for types with two commas (3-parameters templates).
#define SELECTOR4(T1, T2, T3, T4)   const T1 , T2, T3, T4 &
 Type formal argument for types with three commas (4-parameters templates).

Enumerations

enum  

Functions

template<typename T>
utility::random::generate ()
 Generate a random value.
template<typename T>
utility::random::generate (T min, T max)
 Generate a random value between bounds.
template<>
char utility::random::generate< char > ()
 Generate a random character.
template<>
char utility::random::generate< char > (char min, char max)
 Generate a random character between bounds.
char utility::random::generate_letter ()
 Generate a random lowercase letter.
char utility::random::generate_digit ()
 Generate a random digit.
template<>
bool utility::random::generate< bool > ()
 Generate a random Boolean.
template<>
int utility::random::generate< int > ()
 Generate a random integer.
template<>
int utility::random::generate< int > (int min, int max)
 Generate a random integer between two bounds.
template<>
unsigned utility::random::generate< unsigned > ()
 Generate a random unsigned integer.
template<>
unsigned utility::random::generate< unsigned > (unsigned min, unsigned max)
 Generate a random unsigned between two bounds.
template<>
float utility::random::generate< float > ()
 Generate a random float between -2 and 2.
template<>
float utility::random::generate< float > (float min, float max)
 Generate a random float between min and max.
template<>
double utility::random::generate< double > ()
 Generate a random double between -2 and 2.
template<>
double utility::random::generate< double > (double min, double max)
 Generate a random double between min and max.
template<class InputIterator, class OutputIterator>
void utility::random::sample_n (InputIterator first, InputIterator end, OutputIterator out, unsigned n)
 Generate of n sample from a range to an output iterator.
template<>
vcsn::algebra::RationalNumber utility::random::generate< vcsn::algebra::RationalNumber > ()
 Generate a random rational number.
template<>
vcsn::algebra::RationalNumber utility::random::generate< vcsn::algebra::RationalNumber > (const vcsn::algebra::RationalNumber min, const vcsn::algebra::RationalNumber max)
 Generates a bounded random rational number.
template<>
std::pair< char, int > utility::random::generate< std::pair< char, int > > ()
 Generate a random std::pair<char, int>.
template<typename T>
const T & utility::unique::get (const T &)
 The canonicalization operator.
template<typename T>
const T * utility::unique::get (const T *)
 Version of the canonicalization operator for pointers.
template<class InputIterator, class Letter>
std::ostream & utility::operator<< (std::ostream &ostr, const Window< InputIterator, Letter > &w)
 utility::DeferrerDebugPart::DeferrerDebugPart (void *ptr, bool is_valid=false)
void utility::DeferrerDebugPart::set_valid (bool b)
T & utility::DeferrerDebugPart::cast (void *)
const T & utility::DeferrerDebugPart::cast (const void *) const
 utility::DeferrerDebugPart< T, false >::DeferrerDebugPart (void *ptr, bool is_valid=false)
void utility::DeferrerDebugPart< T, false >::set_valid (bool b)
T & utility::DeferrerDebugPart< T, false >::cast (void *)
const T & utility::DeferrerDebugPart< T, false >::cast (const void *) const
 utility::Deferrer::Deferrer ()
 Constructor.
Deferrer & utility::Deferrer::operator= (const deferred_type &)
 Effectively builds the holded type.
 utility::Deferrer::operator T () const
 Get back the holded type.
 utility::Window::Window (const iterator_t &stream, const iterator_t &eof, letter_t eol, length_t length)
bool utility::Window::eof () const
 Indicates wether the end of the stream has been reached or not.
bool utility::Window::eol () const
 Indicates wether a new line has been reached or not.
void utility::Window::shift (unsigned int n)
 Shift the window.
void utility::Window::shift ()
 Shift the window completely (equivalent to shift(size())).
length_t utility::Window::size () const
 Returns the actual window size.
letter_t utility::Window::operator[] (length_t i) const
 Returns the i-th character of the window.
std::ostream & utility::Window::print (std::ostream &ostr) const
 Print the window.
void utility::Window::compute_size ()

Function Documentation

T utility::random::generate min,
max
 

Generate a random value between bounds.

This function returns a value between min and max (inclusive).

vcsn::algebra::RationalNumber generate< vcsn::algebra::RationalNumber > const vcsn::algebra::RationalNumber  min,
const vcsn::algebra::RationalNumber  max
[inline]
 

Generates a bounded random rational number.

Both fractions are first brought to the same denominator. Then, the maximum of the denominator and both numerators is taken. With this number, we work out a ratio, which is used to have a larger range of choice for our new fraction.

const T & get const T &   ) 
 

The canonicalization operator.

This operator uses the unique_map structure to retrieve the unique instance equal to the given value.

See also:
unique_map

Definition at line 74 of file unique.hxx.

References UniqueMap::instance().

Referenced by SetSlotAttribute< S, true >::_structure_attach(), vcsn::do_concatenate_of_normalized_here(), vcsn::do_star_of_normalized_here(), utility::unique::get(), and spontaneous_query::operator()().

Deferrer  )  [inherited]
 

Constructor.

Please notice that this constructor *do not initialize* the holded type.

See also:
operator=

Definition at line 112 of file deferrer.hxx.

Deferrer< T, rt_checks > & operator= const deferred_type  )  [inherited]
 

Effectively builds the holded type.

Warning:
Calling this operator twice does not call any destructor nor overloaded operators = on the first instance which was created.

Definition at line 118 of file deferrer.hxx.

References Deferrer::data, and DeferrerDebugPart< T, rt_checks >::set_valid().

Window const iterator_t stream,
const iterator_t eof,
letter_t  eol,
length_t  length
[inherited]
 

Build a window from a couple of begin/end iterator, a newline character and a window length.

Parameters:
stream Iterator to the begining of the stream.
eof Iterator to the end of the stream.
eol The newline character.
length The window length.
See also:
Window

Definition at line 36 of file window.hxx.

References Window::compute_size(), and precondition.

void shift unsigned int  n  )  [inherited]
 

Shift the window.

Parameters:
n The number of character the window must be shifted.

Definition at line 67 of file window.hxx.

References Window::compute_size(), Window::end_, Window::eol_, precondition, Window::size_, and Window::stream_.


Generated on Fri Jul 28 12:33:04 2006 for Vaucanson by  doxygen 1.4.6