|
CARLA
|
Factory that creates publisher/subscriber middleware based on the active middleware selection. More...
#include <MiddlewareFactory.h>
Classes | |
| struct | MiddlewareResolution |
| Result of middleware resolution — whether resolution succeeded and which middleware to use. More... | |
Static Public Member Functions | |
| template<typename T > | |
| static std::unique_ptr< IPublisherMiddleware > | CreatePublisher () |
| Create a publisher middleware for traits type T. | |
| template<typename S > | |
| static std::unique_ptr< ISubscriberMiddleware > | CreateSubscriber () |
| Create a subscriber middleware for traits type S. | |
| static std::string | GetAvailableMiddlewareString () |
| Return a readable list of middleware implementations compiled into this binary. | |
| static Middleware | GetMiddleware () |
| static bool | IsMiddlewareAvailable (Middleware middleware) |
| Check whether a specific middleware was compiled into this binary. | |
| static MiddlewareResolution | ResolveMiddleware (Middleware requested) |
| Resolve the requested middleware strictly — no fallback to other middleware. | |
| static void | SetMiddleware (Middleware middleware) |
| Select the middleware for all subsequent publisher/subscriber creation. | |
Static Private Member Functions | |
| static Middleware & | GetActiveMiddleware () |
| Returns reference to the active middleware selection (function-local static for C++11 thread safety). | |
Factory that creates publisher/subscriber middleware based on the active middleware selection.
The middleware is set once at startup via SetMiddleware() before any entities are created. After the first entity is created, changing the middleware has undefined behavior.
Definition at line 36 of file MiddlewareFactory.h.
|
inlinestatic |
Create a publisher middleware for traits type T.
T must provide: T::msg_type — the message type
Definition at line 99 of file MiddlewareFactory.h.
References carla::ros2::CycloneDDS, carla::ros2::FastDDS, GetActiveMiddleware(), carla::log_error(), and carla::ros2::Zenoh.
|
inlinestatic |
Create a subscriber middleware for traits type S.
S must provide: S::msg_type — the message type
Definition at line 130 of file MiddlewareFactory.h.
References carla::ros2::CycloneDDS, carla::ros2::FastDDS, GetActiveMiddleware(), carla::log_error(), and carla::ros2::Zenoh.
|
inlinestaticprivate |
Returns reference to the active middleware selection (function-local static for C++11 thread safety).
Definition at line 160 of file MiddlewareFactory.h.
References carla::ros2::FastDDS.
Referenced by CreatePublisher(), CreateSubscriber(), GetMiddleware(), and SetMiddleware().
|
inlinestatic |
Return a readable list of middleware implementations compiled into this binary.
Delegates to the free function in Middleware.h.
Definition at line 91 of file MiddlewareFactory.h.
References carla::ros2::GetAvailableMiddlewareString().
Referenced by carla::ros2::GetAvailableMiddleware(), and TEST_F().
|
inlinestatic |
Definition at line 45 of file MiddlewareFactory.h.
References GetActiveMiddleware().
|
inlinestatic |
Check whether a specific middleware was compiled into this binary.
Definition at line 50 of file MiddlewareFactory.h.
References carla::ros2::CycloneDDS, carla::ros2::FastDDS, and carla::ros2::Zenoh.
Referenced by ResolveMiddleware(), TEST(), TEST(), and TEST().
|
inlinestatic |
Resolve the requested middleware strictly — no fallback to other middleware.
Returns {true, requested} if available, {false, requested} otherwise.
Definition at line 82 of file MiddlewareFactory.h.
References IsMiddlewareAvailable().
Referenced by carla::ros2::SetActiveMiddleware(), TEST_F(), TEST_F(), and TEST_F().
|
inlinestatic |
Select the middleware for all subsequent publisher/subscriber creation.
Must be called before any publisher or subscriber is initialized.
Definition at line 40 of file MiddlewareFactory.h.
References GetActiveMiddleware().
Referenced by carla::ros2::SetActiveMiddleware(), MiddlewareFactoryFixture::SetUp(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and TEST_F().