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
5namespace LibXR
6{
22template <typename Derived, typename Data>
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)
46 {
47 return static_cast<Derived*>(this)->PopBytes(&item);
48 }
49
56 {
57 return static_cast<Derived*>(this)->PopBytes(nullptr);
58 }
59};
60} // namespace LibXR
强类型队列的公共薄包装。
ErrorCode Pop()
丢弃一个队头元素。
ErrorCode Push(const Data &item)
推入一个强类型元素。
ErrorCode Pop(Data &item)
弹出一个强类型元素。
Data ValueType
队列元素类型。 Queue element type.
LibXR 命名空间
Definition ch32_can.hpp:14
ErrorCode
定义错误码枚举