Routes each line-of-sight query to the backend that claimed its coordinate space. 更多...
#include <LineOfSightRouter.h>
Public 成员函数 | |
| LineOfSightRouter ()=default | |
| Line of sight router. | |
| LineOfSightRouter (const LineOfSightRouter &)=delete | |
| LineOfSightRouter & | operator= (const LineOfSightRouter &)=delete |
| Result< void > | addProvider (CoordinateSpace space, const ILineOfSightQuery *provider) |
| Claim one coordinate space for a backend. | |
| Result< void > | removeProvider (CoordinateSpace space, const ILineOfSightQuery *provider) |
Release a claimed space when provider is the one that claimed it. | |
| bool | hasProvider (CoordinateSpace space) const noexcept |
Whether some backend currently answers for space. | |
| std::vector< CoordinateSpace > | spaces () const |
| Claimed spaces in enum order, so a caller can report coverage deterministically. | |
| Result< LineOfSightResult > | query (const TargetLocation &from, const TargetLocation &to) const override |
| Answer one segment query by routing it to the backend for its coordinate space. | |
Public 成员函数 继承自 eve::sensing::ILineOfSightQuery | |
| virtual | ~ILineOfSightQuery ()=default |
| Releases ILineOfSightQuery resources. | |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::sensing::ILineOfSightQuery | |
| static constexpr const char * | capabilityName = "eve.sensing.ILineOfSightQuery" |
详细描述
Routes each line-of-sight query to the backend that claimed its coordinate space.
@thread Affine to the caller; it holds borrowed pointers and does no synchronization. Claim all backends during startup, before queries run. @reentrancy query invokes the selected backend synchronously and performs no locking.
在文件 LineOfSightRouter.h 第 37 行定义.
构造及析构函数说明
◆ LineOfSightRouter() [1/2]
|
default |
Line of sight router.
◆ LineOfSightRouter() [2/2]
|
delete |
成员函数说明
◆ addProvider()
| Result< void > eve::sensing::LineOfSightRouter::addProvider | ( | CoordinateSpace | space, |
| const ILineOfSightQuery * | provider | ||
| ) |
Claim one coordinate space for a backend.
- 参数
-
space Space this backend can interpret; it must be one of the four enum values. provider Backend to answer with.
- 返回
- Applied, InvalidArgument for a null provider, or Conflict when the space is taken. @ownership Borrowed: the router never owns or deletes the backend. The claiming module must keep it alive for as long as it is claimed. @lifetime Valid until removeProvider releases that exact space and provider.
在文件 LineOfSightRouter.cpp 第 52 行定义.
引用了 eve::Applied, eve::Conflict, index, eve::InvalidArgument, eve::Status::success() , 以及 eve::Result< T >::success().
◆ hasProvider()
|
noexcept |
◆ operator=()
|
delete |
◆ query()
|
overridevirtual |
Answer one segment query by routing it to the backend for its coordinate space.
- 返回
- The backend's answer, Rejected when the two endpoints are in different spaces, or Unsupported when no backend claimed that space.
实现了 eve::sensing::ILineOfSightQuery.
在文件 LineOfSightRouter.cpp 第 90 行定义.
引用了 eve::sensing::coordinateSpaceName(), from, index, eve::InvalidArgument, to , 以及 eve::Unsupported.
◆ removeProvider()
| Result< void > eve::sensing::LineOfSightRouter::removeProvider | ( | CoordinateSpace | space, |
| const ILineOfSightQuery * | provider | ||
| ) |
Release a claimed space when provider is the one that claimed it.
- 返回
- Applied when released, or NoOp when this provider does not own that space (so one module can never release another module's backend, and a double release is safe).
在文件 LineOfSightRouter.cpp 第 69 行定义.
引用了 eve::Applied, index, eve::NoOp, eve::Status::success() , 以及 eve::Result< T >::success().
◆ spaces()
| std::vector< CoordinateSpace > eve::sensing::LineOfSightRouter::spaces | ( | ) | const |
Claimed spaces in enum order, so a caller can report coverage deterministically.
在文件 LineOfSightRouter.cpp 第 82 行定义.
引用了 index.
该类的文档由以下文件生成:
- src/modules/sensing/LineOfSightRouter.h
- src/modules/sensing/LineOfSightRouter.cpp
Public 成员函数 继承自