libxr
1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
queue_typed_base.hpp
1
#pragma once
2
3
#include "libxr_def.hpp"
4
5
namespace
LibXR
6
{
22
template
<
typename
Derived,
typename
Data>
23
class
QueueTypedBase
24
{
25
public
:
26
using
ValueType
= Data;
27
34
ErrorCode
Push
(
const
Data& item)
35
{
36
return
static_cast<
Derived*
>
(
this
)->PushBytes(&item);
37
}
38
45
ErrorCode
Pop
(Data& item) {
return
static_cast<
Derived*
>
(
this
)->PopBytes(&item); }
46
52
ErrorCode
Pop
() {
return
static_cast<
Derived*
>
(
this
)->PopBytes(
nullptr
); }
53
};
54
}
// namespace LibXR
LibXR::QueueTypedBase
强类型队列的公共薄包装。
Definition
queue_typed_base.hpp:24
LibXR::QueueTypedBase::Pop
ErrorCode Pop()
丢弃一个队头元素。
Definition
queue_typed_base.hpp:52
LibXR::QueueTypedBase::Push
ErrorCode Push(const Data &item)
推入一个强类型元素。
Definition
queue_typed_base.hpp:34
LibXR::QueueTypedBase::Pop
ErrorCode Pop(Data &item)
弹出一个强类型元素。
Definition
queue_typed_base.hpp:45
LibXR::QueueTypedBase::ValueType
Data ValueType
队列元素类型。 Queue element type.
Definition
queue_typed_base.hpp:26
LibXR
LibXR 命名空间
Definition
ch32_can.hpp:14
LibXR::ErrorCode
ErrorCode
定义错误码枚举
Definition
libxr_def.hpp:136
src
structure
queue
queue_typed_base.hpp
Generated by
1.12.0