17#ifndef CYBER_NODE_WRITER_BASE_H_
18#define CYBER_NODE_WRITER_BASE_H_
25#include "cyber/proto/role_attributes.pb.h"
75 virtual void GetReaders(std::vector<proto::RoleAttributes>* readers) {}
100 std::lock_guard<std::mutex> g(
lock_);
bool IsInit() const
Is Writer initialized?
WriterBase(const proto::RoleAttributes &role_attr)
Construct a new Writer Base object
virtual bool HasReader()
Is there any Reader that subscribes our Channel? You can publish message when this return true
const std::string & GetChannelName() const
Get Writer's Channel name
virtual void GetReaders(std::vector< proto::RoleAttributes > *readers)
Get all Readers that subscriber our writing channel
const uint64_t GetChannelId() const
Get Writer's Channel id
proto::RoleAttributes role_attr_
virtual bool Init()=0
Init the Writer
virtual void Shutdown()=0
Shutdown the Writer
optional string channel_name
optional uint64 channel_id