rpa::pipe_circular< Container, CondVar >::slice Class Reference

#include <pipeline.h>

List of all members.

Public Types

typedef range_step_aux< iterator
>::slice 
slice_base

Public Member Functions

void check (void) const
 slice ()
 It is not strictly necessay to initialise the pointers.
 slice (const slice &slicRef)
 The default generated copy constructor cannot call 'slice_add'.
 slice (const slice_base &aSB, piplin_t *pipPtr)
 ~slice ()

Private Types

typedef pipe_circular piplin_t

Private Member Functions

sliceoperator= (const slice &refSlice)
 Forbidden because of the pointers.

Private Attributes

piplin_t_pipe_ptr
slice_next
slice_prev

Friends

class pipe_circular


Detailed Description

template<class Container, class CondVar>
class rpa::pipe_circular< Container, CondVar >::slice

The base slice just contains the beginning and end, plus the size. It needs a pointer to our range so it can remove its reservation from the buffer at destruction. This class is put here instead of being in the range_step, where it would be more consistent, simply because there is a circular dependency between pipe_circular and its range_step.


Member Typedef Documentation

template<class Container, class CondVar>
typedef pipe_circular rpa::pipe_circular< Container, CondVar >::slice::piplin_t [private]

template<class Container, class CondVar>
typedef range_step_aux< iterator >::slice rpa::pipe_circular< Container, CondVar >::slice::slice_base


Constructor & Destructor Documentation

template<class Container, class CondVar>
rpa::pipe_circular< Container, CondVar >::slice::slice (  )  [inline]

It is not strictly necessay to initialise the pointers.

template<class Container, class CondVar>
rpa::pipe_circular< Container, CondVar >::slice::slice ( const slice slicRef  )  [inline]

The default generated copy constructor cannot call 'slice_add'.

If the code is optimised, this should not be called, which is good, because it is useless to add then del the slice from the list.

template<class Container, class CondVar>
rpa::pipe_circular< Container, CondVar >::slice::slice ( const slice_base aSB,
piplin_t pipPtr 
) [inline]

At this moment, the range is still locked, and data is available, because we waited for it in rng_refresh_circular. The pipe pointer is necessary to update the 'Rd' iterator - which is later consistent, and to put this slice in the ordered list of the running slices, i.e. the slices which are being used. It prevents a writer to erase this slice.

Now this slice is ready to be used.

template<class Container, class CondVar>
rpa::pipe_circular< Container, CondVar >::slice::~slice (  )  [inline]

The pipe must be locked when this destructor is called. This is why algorithms must not create/delete slices without protection, and this is why they use chop_again, which does not call the destructors.


Member Function Documentation

template<class Container, class CondVar>
void rpa::pipe_circular< Container, CondVar >::slice::check ( void   )  const [inline]

It is possible to save some CPU cycles by not managing, the prev/next pointers when the slice is not in the list of running slices, but it adds clarity.

template<class Container, class CondVar>
slice& rpa::pipe_circular< Container, CondVar >::slice::operator= ( const slice refSlice  )  [private]

Forbidden because of the pointers.


Friends And Related Function Documentation

template<class Container, class CondVar>
friend class pipe_circular [friend]


Member Data Documentation

template<class Container, class CondVar>
slice* rpa::pipe_circular< Container, CondVar >::slice::_next [private]

template<class Container, class CondVar>
piplin_t* rpa::pipe_circular< Container, CondVar >::slice::_pipe_ptr [private]

template<class Container, class CondVar>
slice * rpa::pipe_circular< Container, CondVar >::slice::_prev [private]


The documentation for this class was generated from the following file:
Generated on Tue Sep 25 10:20:37 2007 for rpa by  doxygen 1.4.7