NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
nest::MultRBuffer Class Reference

#include <ring_buffer.h>

Public Member Functions

 MultRBuffer ()
 
void add_value (const long_t offs, const double_t)
 Add a value to the ring buffer. More...
 
double get_value (const long_t offs)
 Read one value from ring buffer. More...
 
void clear ()
 Initialize the buffer with noughts. More...
 
void resize ()
 Resize the buffer according to max_thread and max_delay. More...
 
size_t size () const
 Returns buffer size, for memory measurement. More...
 

Private Member Functions

size_t get_index_ (const delay d) const
 Obtain buffer index. More...
 

Private Attributes

std::valarray< double_tbuffer_
 Buffered data. More...
 

Constructor & Destructor Documentation

nest::MultRBuffer::MultRBuffer ( )

Member Function Documentation

void nest::MultRBuffer::add_value ( const long_t  offs,
const double_t  v 
)
inline

Add a value to the ring buffer.

Parameters
offsArrival time relative to beginning of slice.
double_tValue to add.

References assert(), buffer_, and get_index_().

void nest::MultRBuffer::clear ( )

Initialize the buffer with noughts.

size_t nest::MultRBuffer::get_index_ ( const delay  d) const
inlineprivate

Obtain buffer index.

Parameters
delaydelivery delay for event
Returns
index to buffer element into which event should be recorded.

References assert(), buffer_, and nest::Scheduler::get_modulo().

Referenced by add_value(), and get_value().

double nest::MultRBuffer::get_value ( const long_t  offs)
inline

Read one value from ring buffer.

Parameters
offsOffset of element to read within slice.
Returns
value

References assert(), buffer_, get_index_(), and nest::Scheduler::get_min_delay().

void nest::MultRBuffer::resize ( )

Resize the buffer according to max_thread and max_delay.

References nest::Scheduler::get_max_delay(), and nest::Scheduler::get_min_delay().

size_t nest::MultRBuffer::size ( void  ) const
inline

Returns buffer size, for memory measurement.

References buffer_.

Member Data Documentation

std::valarray<double_t> nest::MultRBuffer::buffer_
private

Buffered data.

Referenced by add_value(), get_index_(), get_value(), and size().


The documentation for this class was generated from the following files: