Ctrl-Z
一个多线程机器人运动控制强化学习部署框架
载入中...
搜索中...
未找到
z::RingBuffer< T > 模板类 参考

ring buffer class, this buffer does NOT garantee thread safety 更多...

#include <ZenBuffer.hpp>

类 z::RingBuffer< T > 继承关系图:
z::RingBuffer< T > 的协作图:

Public 成员函数

 RingBuffer (int _Size)
 Construct a new Ring Buffer object with size
 
 RingBuffer (int _Size, T &object)
 Construct a new Ring Buffer object with size and initial value
 
void push (const T &_Data)
 push data to the buffer
 
T & operator() (int _Index)
 get data from the buffer
 
T & operator[] (int _Index)
 get data from the buffer
 
T & front ()
 get the oldest data from the buffer
 
T & back ()
 get the newest data from the buffer
 
int size ()
 get the size of the buffer
 
void flush ()
 flush the buffer with default value
 
- Public 成员函数 继承自 z::ZObject
void PrintSplitLine (size_t length=60, char c='-')
 print a split line, default length is 60 and character is '-'
 

详细描述

template<typename T>
class z::RingBuffer< T >

ring buffer class, this buffer does NOT garantee thread safety

模板参数
Ttype of data

构造及析构函数说明

◆ RingBuffer() [1/2]

template<typename T>
z::RingBuffer< T >::RingBuffer ( int _Size)
inline

Construct a new Ring Buffer object with size

参数
_Sizesize of the buffer

◆ RingBuffer() [2/2]

template<typename T>
z::RingBuffer< T >::RingBuffer ( int _Size,
T & object )
inline

Construct a new Ring Buffer object with size and initial value

参数
_Sizesize of the buffer
objectinitial value

成员函数说明

◆ back()

template<typename T>
T & z::RingBuffer< T >::back ( )
inline

get the newest data from the buffer

返回
T& newest data reference

◆ front()

template<typename T>
T & z::RingBuffer< T >::front ( )
inline

get the oldest data from the buffer

返回
T& oldest data reference

◆ operator()()

template<typename T>
T & z::RingBuffer< T >::operator() ( int _Index)
inline

get data from the buffer

参数
_Indexindex of the data
返回
T& data

◆ operator[]()

template<typename T>
T & z::RingBuffer< T >::operator[] ( int _Index)
inline

get data from the buffer

参数
_Indexindex of the data
返回
T& data

◆ push()

template<typename T>
void z::RingBuffer< T >::push ( const T & _Data)
inline

push data to the buffer

参数
_Datadata to push

◆ size()

template<typename T>
int z::RingBuffer< T >::size ( )
inline

get the size of the buffer

返回
int size of the buffer

该类的文档由以下文件生成: