Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
CircularBuffer< T > Class Template Reference

#include <MSSwarmTrafficLightLogic.h>

Public Member Functions

bool addValue (const T newValue, T &replacedValue)
 
at (const int index) const
 
back () const
 
 CircularBuffer (int size)
 
void clear ()
 
front () const
 
void push_front (const T value)
 
int size () const
 
virtual ~CircularBuffer ()
 

Private Member Functions

void insert (const T &value)
 

Private Attributes

T * m_buffer
 
int m_currentIndex
 
bool m_firstTime
 
int m_size
 

Detailed Description

template<class T>
class CircularBuffer< T >

Definition at line 33 of file MSSwarmTrafficLightLogic.h.

Constructor & Destructor Documentation

◆ CircularBuffer()

template<class T >
CircularBuffer< T >::CircularBuffer ( int  size)
inline

◆ ~CircularBuffer()

template<class T >
virtual CircularBuffer< T >::~CircularBuffer ( )
inlinevirtual

Definition at line 40 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::m_buffer.

Member Function Documentation

◆ addValue()

template<class T >
bool CircularBuffer< T >::addValue ( const T  newValue,
T &  replacedValue 
)
inline

◆ at()

template<class T >
T CircularBuffer< T >::at ( const int  index) const
inline

Definition at line 57 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::m_buffer, CircularBuffer< T >::m_currentIndex, and CircularBuffer< T >::m_size.

Referenced by CircularBuffer< T >::back(), and CircularBuffer< T >::front().

Here is the caller graph for this function:

◆ back()

template<class T >
T CircularBuffer< T >::back ( ) const
inline

◆ clear()

template<class T >
void CircularBuffer< T >::clear ( )
inline

◆ front()

template<class T >
T CircularBuffer< T >::front ( ) const
inline

Definition at line 62 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::at().

◆ insert()

template<class T >
void CircularBuffer< T >::insert ( const T &  value)
inlineprivate

Definition at line 88 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::m_buffer, CircularBuffer< T >::m_currentIndex, CircularBuffer< T >::m_firstTime, and CircularBuffer< T >::m_size.

Referenced by CircularBuffer< T >::addValue(), and CircularBuffer< T >::push_front().

Here is the caller graph for this function:

◆ push_front()

template<class T >
void CircularBuffer< T >::push_front ( const T  value)
inline

Definition at line 53 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::insert().

◆ size()

template<class T >
int CircularBuffer< T >::size ( ) const
inline

Definition at line 70 of file MSSwarmTrafficLightLogic.h.

References CircularBuffer< T >::m_currentIndex, CircularBuffer< T >::m_firstTime, and CircularBuffer< T >::m_size.

Referenced by CircularBuffer< T >::back().

Here is the caller graph for this function:

Field Documentation

◆ m_buffer

◆ m_currentIndex

◆ m_firstTime

◆ m_size


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