pstade

Next

Chapter 1. Oven 1.00.1

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Overview
Introduction
Requirements
Portability
Rationale
Related Work
Acknowledgements
Notation
Concepts
Pipable Adaptor
Resettable Object
Stoppable Generator
Iteration Block
Constant Range
Contiguous Range
Parallel Safe
Range Algorithms
STL Algorithms
STL Numerics
at
back
front
begin/end
copied
distance
equals
exists
forall
value_at
value_back
value_front
Ranges
any_range
any_indexed
array_range
directory_range
empty_range
file_range
as_array
as_c_str
as_literal
block
comprehension
counting
generation
hetero
initial_values
iteration
make_range
recursion
shared
single
shared_single
stream_lines
stream_read
streambuf_read
unfold
Range Adaptors
adjacent_filtered
adjacent_transformed
always
applied
checked
cleared
concatenated
const_refs
constants
converted
copied_to
cycled
delimited
dropped
dropped_while
elements
elements_c
filtered
identities
indirected
outdirected
outplaced
jointed
map_keys
map_values
memoized
offset
permuted
pointed
popped
reversed
rotated
rvalues
scanned
sliced
sorted
steps
taken
taken_while
transformed
uniqued
window
String Adaptors
broken_into
lower_chars
upper_chars
narrow_chars
wide_chars
string_found
string_split
matches
tokenized
utf8_decoded
utf8_encoded
utf16_decoded
utf16_encoded
xpressive_matches
xpressive_tokenized
Merge Adaptors
merged
set_cap
set_cup
set_delta
set_minus
Output Iterators
any_output_iterator
applier
eater
stream_writer
streambuf_writer
std_stream_writer
Output Iterator Adaptors
converter
copier
filterer
indirecter
intercepter
permuter
transformer
range_transformer
utf8_encoder
utf16_encoder
Utilities
adapted_to/to_base
expression
FOREACH
io.hpp
optional.hpp
regex.hpp
xpressive.hpp
nonstop
pack
partitioned
regular
regular_ref
shared_regular
split_at
zipped
unzipped
fuzipped
unfuzipped
zipped_with
Parallel Algorithms
parallel_copy
parallel_equals
parallel_for_each
parallel_reduce
parallel_sort
Extending Boost.Range
Concept-like extension
ATL extension
MFC extension
WTL extension
Version History

I tried to commit suicide by sticking my head in the oven, but there was a cake in it.” -- Lesley Boone

Oven is an advanced implementation of Range Library Proposal:

namespace lambda = boost::lambda;
using namespace pstade::oven;

typedef
    any_range<int, boost::single_pass_traversal_tag>
range;

range sieve(range rng)
{
    return rng|dropped(1)|filtered(regular(lambda::_1 % value_front(rng) != 0));
}

range primes
    = iteration(range(counting(2, max_count)), &::sieve)|transformed(value_front);

int main()
{
    std::cout << (primes|taken(200));
}

Oven is a header-only template library. All the types, functions and objects are defined in namespace pstade::oven.

Oven is known to work on the following platforms:

  • Microsoft Visual C++ 2005 Express Edition SP1
  • Microsoft Visual C++ .NET Version 7.1 SP1
  • MinGW with GCC 3.4.4
  • MinGW with GCC 4.1.2
  • Intel C++ Compiler Professional Edition 10.1 for Windows
  • Oven doesn't introduce any new elaborate concept.
  • Oven supports an iterator such that destruction of it may invalidate pointers and references previously obtained from that iterator (24.1/9).
  • Oven Range Adaptors return in constant time if possible.
  • Special thanks to Thorsten Ottosen, the author of Boost.Range and Range Library Proposal.
  • Special thanks to Cryolite, Takeshi Mouri, yotto-k and Yusuke Kajimoto. These people are instrumental in the design and development of Oven.

This document uses the following notation:

Expression

Semantics

_typeof

An imaginary operator to get the type of an expression.

++

An imaginary operator to concatenate tokens.

_rng

A Range such that it is Forward or Readable.

_fwdrng

A Forward Range

_bidrng

A Bidirectional Range

_rndrng

A Random Access Range

_outit

An Output Iterator

_fun

A Function Object

_cal

A Polymorphic Function Object

_prd

A Predicate

_begin

boost::begin

_end

boost::end

_iter_of

boost::range_result_iterator

_value_of

boost::range_value

[i, j)

A Range which behaves as if i = boost::begin([i, j)) and j = boost::end([i, j)).

{a0,a1,a2,...,aN}

A Range

(a0 a1 a2 ... aN)

A boost::tuple

Also, assume that every expression is placed after:

namespace oven = pstade::oven;
using namespace oven;

Last revised: January 02, 2008 at 09:05:28 GMT


Next