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

Definition at line 35 of file MSSwarmTrafficLightLogic.h.

References m_buffer, m_currentIndex, m_firstTime, m_size, and size().

◆ ~CircularBuffer()

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

Definition at line 40 of file MSSwarmTrafficLightLogic.h.

References m_buffer.

Member Function Documentation

◆ addValue()

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

Definition at line 44 of file MSSwarmTrafficLightLogic.h.

References insert(), m_buffer, m_currentIndex, and m_firstTime.

◆ at()

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

Definition at line 57 of file MSSwarmTrafficLightLogic.h.

References m_buffer, m_currentIndex, and m_size.

Referenced by back(), and front().

Here is the caller graph for this function:

◆ back()

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

Definition at line 66 of file MSSwarmTrafficLightLogic.h.

References at(), and size().

◆ clear()

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

Definition at line 77 of file MSSwarmTrafficLightLogic.h.

References m_currentIndex, and m_firstTime.

◆ front()

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

Definition at line 62 of file MSSwarmTrafficLightLogic.h.

References at().

◆ insert()

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

Definition at line 88 of file MSSwarmTrafficLightLogic.h.

References invalid_return< std::string >::value, m_buffer, m_currentIndex, m_firstTime, and m_size.

Referenced by addValue(), and 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 insert(), and invalid_return< std::string >::value.

◆ size()

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

Definition at line 70 of file MSSwarmTrafficLightLogic.h.

References m_currentIndex, m_firstTime, and m_size.

Referenced by back(), and CircularBuffer().

Here is the caller graph for this function:

Field Documentation

◆ m_buffer

template<class T>
T* CircularBuffer< T >::m_buffer
private

Definition at line 83 of file MSSwarmTrafficLightLogic.h.

Referenced by addValue(), at(), CircularBuffer(), insert(), and ~CircularBuffer().

◆ m_currentIndex

template<class T>
int CircularBuffer< T >::m_currentIndex
private

Definition at line 85 of file MSSwarmTrafficLightLogic.h.

Referenced by addValue(), at(), CircularBuffer(), clear(), insert(), and size().

◆ m_firstTime

template<class T>
bool CircularBuffer< T >::m_firstTime
private

Definition at line 86 of file MSSwarmTrafficLightLogic.h.

Referenced by addValue(), CircularBuffer(), clear(), insert(), and size().

◆ m_size

template<class T>
int CircularBuffer< T >::m_size
private

Definition at line 84 of file MSSwarmTrafficLightLogic.h.

Referenced by at(), CircularBuffer(), insert(), and size().


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