101template <
typename MsgT, SecurityType SecT = SecurityType::kWithoutSecurity>
105 using UniquePtr = std::unique_ptr<Publisher<MsgT, SecT>>;
108 using SharedPtr = std::shared_ptr<Publisher<MsgT, SecT>>;
153 template <
typename ConfT,
typename = std::enable_if_t<std::is_base_of_v<Conf, ConfT>>>
227 bool publish(
const MsgT& msg,
bool force =
false);
242 bool publish_fbb(
const void* fbb,
bool force =
false);
256 bool write_bytes(
const Bytes& data);
258 bool write_intra(
const IntraData& intra_data);
274template <
typename MsgT>
Versatile 128-byte byte buffer with SBO, five ownership modes and compression helpers.
定义 bytes.h:113
std::function< void(bool)> ConnectCallback
Callback invoked when the peer connection state changes.
定义 node_impl.h:148
void mark_as_setter()
Changes this publisher's role to kSetter (field-writer).
定义 publisher-inl.h:185
NodeImpl::ConnectCallback ConnectCallback
Callback type fired when subscriber presence changes.
定义 publisher.h:111
void detect_subscribers(ConnectCallback &&callback)
Registers a callback invoked when subscriber presence changes.
定义 publisher-inl.h:91
Publisher(const ConfT &conf, InitType type=InitType::kWithInit)
Constructs a publisher from a typed transport configuration object.
定义 publisher-inl.h:52
bool publish(const MsgT &msg, bool force=false)
Serialises and publishes msg to all current subscribers.
定义 publisher-inl.h:111
bool has_subscribers() const
Returns true if at least one subscriber is currently present.
定义 publisher-inl.h:106
static constexpr ImplType kImplType
Node role identifier (kPublisher).
定义 publisher.h:114
bool publish_fbb(const void *fbb, bool force=false)
Publishes a pre-finished FlatBufferBuilder buffer directly.
定义 publisher-inl.h:168
bool wait_for_subscribers(std::chrono::milliseconds timeout=Timeout::kDefaultInterval)
Blocks until at least one subscriber is present or the timeout expires.
定义 publisher-inl.h:96
static constexpr Serializer::Type kMsgType
Serializer type resolved at compile time from MsgT.
定义 publisher.h:117
std::unique_ptr< Publisher< MsgT, SecT > > UniquePtr
Unique-pointer alias for heap allocation.
定义 publisher.h:105
std::shared_ptr< Publisher< MsgT, SecT > > SharedPtr
Shared-pointer alias for heap allocation.
定义 publisher.h:108
static SharedPtr create_shared(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Publisher on the heap wrapped in a shared_ptr.
定义 publisher-inl.h:45
static UniquePtr create_unique(const std::string &url_str, InitType type=InitType::kWithInit)
Creates a Publisher on the heap wrapped in a unique_ptr.
定义 publisher-inl.h:39
Convenience alias for Publisher with message security enabled.
定义 publisher.h:275
constexpr Type get_type_of() noexcept
Deduces the Type enumerator for T at compile time.
定义 serializer-inl.h:160
Type
Identifies the serialisation codec to use for a given C++ type.
定义 serializer.h:123
constexpr bool is_supported(Type type) noexcept
Returns true when type identifies a supported serializer.
定义 serializer-inl.h:157
InitType
Controls whether a node is initialised immediately at construction.
定义 types.h:132
@ kWithInit
Initialise immediately in the constructor.
定义 types.h:134
ImplType
Bitmask identifying the role of a VLink node implementation.
定义 types.h:89
@ kPublisher
Event publisher (N-to-N broadcast).
定义 types.h:93
std::shared_ptr< IntraDataType > IntraData
Shared-ownership handle for an IntraDataType payload.
定义 intra_data.h:96
@ kWithSecurity
Encrypted and authenticated transport.
定义 types.h:150
Base CRTP template for all VLink communication nodes.
Abstract base class for all transport-specific publisher implementations.
static constexpr std::chrono::milliseconds kDefaultInterval
Default wait timeout: 5 seconds.
定义 types.h:201