Owner-thread FIFO/priority buffer of semantic combat inputs. 更多...
#include <ActionInputBuffer.h>
Public 成员函数 | |
| ActionInputBuffer (std::uint32_t capacity, std::uint32_t lifetimeTicks) | |
| Construct with positive capacity and lifetime window in ticks. | |
| Result< void > | push (BufferedInput input) |
| Push one owning input at the supplied tick; full buffers reject. | |
| Result< void > | expire (SimulationTick now) |
| Drop entries older than lifetime relative to now. | |
| Result< BufferedInput > | consume (SubjectRef subject, const std::vector< std::string > &allows) |
| Consume the highest-priority buffered input that matches one of the allows. | |
| Result< BufferedInput > | peek (SubjectRef subject, const std::vector< std::string > &allows) const |
| Peek without consuming. | |
| void | clear (SubjectRef subject) |
| Clear every buffered command for one subject. | |
| void | clearAll () noexcept |
| Clear the entire buffer. | |
| std::size_t | size () const noexcept |
| Number of buffered commands. | |
详细描述
Owner-thread FIFO/priority buffer of semantic combat inputs.
Capacity and lifetime are measured in simulation ticks. Consume removes the matching command exactly once even when activation is later rejected.
在文件 ActionInputBuffer.h 第 32 行定义.
构造及析构函数说明
◆ ActionInputBuffer()
| eve::action::input::ActionInputBuffer::ActionInputBuffer | ( | std::uint32_t | capacity, |
| std::uint32_t | lifetimeTicks | ||
| ) |
Construct with positive capacity and lifetime window in ticks.
在文件 ActionInputBuffer.cpp 第 15 行定义.
成员函数说明
◆ clear()
| void eve::action::input::ActionInputBuffer::clear | ( | SubjectRef | subject | ) |
Clear every buffered command for one subject.
在文件 ActionInputBuffer.cpp 第 71 行定义.
◆ clearAll()
|
inlinenoexcept |
Clear the entire buffer.
在文件 ActionInputBuffer.h 第 51 行定义.
◆ consume()
| Result< BufferedInput > eve::action::input::ActionInputBuffer::consume | ( | SubjectRef | subject, |
| const std::vector< std::string > & | allows | ||
| ) |
Consume the highest-priority buffered input that matches one of the allows.
- 返回
- The consumed command, or NotFound when nothing matches.
在文件 ActionInputBuffer.cpp 第 56 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::NotFound, peek(), subject, eve::Status::success(), eve::Result< T >::success() , 以及 value.
◆ expire()
| Result< void > eve::action::input::ActionInputBuffer::expire | ( | SimulationTick | now | ) |
Drop entries older than lifetime relative to now.
在文件 ActionInputBuffer.cpp 第 32 行定义.
引用了 eve::Applied, eve::Status::success(), eve::Result< T >::success() , 以及 eve::detail::StrongUint64< Tag >::value().
◆ peek()
| Result< BufferedInput > eve::action::input::ActionInputBuffer::peek | ( | SubjectRef | subject, |
| const std::vector< std::string > & | allows | ||
| ) | const |
Peek without consuming.
在文件 ActionInputBuffer.cpp 第 41 行定义.
引用了 best, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::NotFound, subject , 以及 eve::Result< T >::success().
被这些函数引用 consume().
◆ push()
| Result< void > eve::action::input::ActionInputBuffer::push | ( | BufferedInput | input | ) |
Push one owning input at the supplied tick; full buffers reject.
在文件 ActionInputBuffer.cpp 第 18 行定义.
引用了 eve::Applied, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), input, eve::InvalidArgument, eve::Status::success() , 以及 eve::Result< T >::success().
◆ size()
|
inlinenoexcept |
Number of buffered commands.
在文件 ActionInputBuffer.h 第 53 行定义.
该类的文档由以下文件生成:
- src/modules/action/input/ActionInputBuffer.h
- src/modules/action/input/ActionInputBuffer.cpp