Miscellaneous constructs used by Vaucanson

Collaboration diagram for Miscellaneous constructs used by Vaucanson:


Files

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

Namespaces

namespace  vcsn
 CPP guard should not be inserted here as VCSN_CONTEXT_NAMESPACE could be changed.

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  true_t
 Static Booleans, for type matching use of Booleans. More...
struct  false_t
struct  bool_to_type_helper
struct  bool_to_type_helper< false >
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'> 
vcsn::misc::random::small_alpha_interval_t
typedef vcsn::algebra::static_ranged<
char, small_alpha_interval_t
vcsn::misc::random::small_alpha_letter_t
template<>
small_alpha_letter_t vcsn::misc::random::generate< small_alpha_letter_t > ()
 Generates a random small alphabetic letter.
void vcsn::misc::Window::moveto (length_t offset)
 Move to a specific offset.
void vcsn::misc::Window::moveto (iterator_t position)
 Move to a specific offset.

Accessors

letter_t vcsn::misc::Window::eol_value () const
 Get the letter value used for ending lines.
iterator_t vcsn::misc::Window::begin () const
 Get an iterator to the beginning of the stream.
iterator_t vcsn::misc::Window::stream () const
 Get an iterator to the current position in the stream.
iterator_t vcsn::misc::Window::end () const
 Get an iterator to the end of the stream.
size_t vcsn::misc::Window::offset () const
 Get the actual offset in the stream.
length_t vcsn::misc::Window::length () const
 Get the maximum length of the window.
string_t vcsn::misc::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).
#define BOOL_TO_TYPE(Bool)   typename vcsn::misc::bool_to_type_helper< (Bool)>::ret

Enumerations

enum  

Functions

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

Function Documentation

T vcsn::misc::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 75 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(), vcsn::misc::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 114 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 120 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 37 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 68 of file window.hxx.

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


Generated on Sat Jul 29 17:28:36 2006 for Vaucanson by  doxygen 1.4.6