VLink 2.0.0
A high-performance communication middleware
载入中...
搜索中...
未找到
status.h 文件参考

DDS-compatible status type hierarchy for VLink publisher and subscriber callbacks. 更多...

#include <cstdint>
#include <iostream>
#include <memory>
#include <string>
#include <type_traits>
#include "../base/exception.h"
#include "../base/macros.h"
status.h 的引用(Include)关系图:
此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

 Abstract base class for all VLink status event objects. 更多...
 Placeholder status returned when the transport reports an unrecognised event type. 更多...

命名空间

类型定义

using vlink::Status::InstanceHandle = const void*
 Opaque handle type for DDS instance identifiers.
using vlink::Status::BasePtr = std::shared_ptr<Status::Base>
 Type alias for a shared pointer to a base status event.

枚举

enum  vlink::Status::Type : uint8_t {
  vlink::Status::kUnknown = 0 , vlink::Status::kPublicationMatched = 1 , vlink::Status::kOfferedDeadlineMissed = 2 , vlink::Status::kOfferedIncompatibleQos = 3 ,
  vlink::Status::kLivelinessLost = 4 , vlink::Status::kSubscriptionMatched = 5 , vlink::Status::kRequestedDeadlineMissed = 6 , vlink::Status::kLivelinessChanged = 7 ,
  vlink::Status::kSampleRejected = 8 , vlink::Status::kRequestedIncompatibleQos = 9 , vlink::Status::kSampleLost = 10
}
 Discriminator for concrete status event types. 更多...

函数

VLINK_EXPORT std::ostream & vlink::Status::operator<< (std::ostream &ostream, const BasePtr &status) noexcept
 Writes the human-readable description of status to ostream.

详细描述

DDS-compatible status type hierarchy for VLink publisher and subscriber callbacks.

The Status namespace defines an event-driven status reporting model that mirrors the DDS status change notification system. When a transport-level event occurs (e.g., a new subscriber appears, a deadline is missed), the middleware creates a concrete Status::Base subclass and delivers it to the registered status callback.

Status types are divided into two groups:

Writer-side (DataWriter / Publisher / Server / Setter):

Type Triggered when
kPublicationMatched A matching subscriber appeared or disappeared
kOfferedDeadlineMissed Writer failed to publish within its declared deadline
kOfferedIncompatibleQos A subscriber with incompatible QoS was discovered
kLivelinessLost Writer failed to assert liveliness within its duration

Reader-side (DataReader / Subscriber / Client / Getter):

Type Triggered when
kSubscriptionMatched A matching publisher appeared or disappeared
kRequestedDeadlineMissed Reader did not receive data within its declared deadline
kLivelinessChanged A writer's liveliness status changed
kSampleRejected An incoming sample was rejected (resource limit hit)
kRequestedIncompatibleQos A publisher with incompatible QoS was discovered
kSampleLost A sample was lost before it could be delivered

Concrete status structs (counters, handles, etc.) are defined in status_detail.h.

Usage
auto sub = vlink::Subscriber<MyMsg>::create("dds://my_topic");
sub->register_status_callback([](vlink::Status::BasePtr status) {
if (status->get_type() == vlink::Status::kSubscriptionMatched) {
auto matched = status->as<vlink::Status::SubscriptionMatched>();
VLOG_I("Matched publishers: ", matched->current_count);
}
});
#define VLOG_I(...)
定义 logger.h:850