17 #ifndef CYBER_TOOLS_CYBER_RECORDER_RECORDER_H_ 18 #define CYBER_TOOLS_CYBER_RECORDER_RECORDER_H_ 23 #include <unordered_map> 29 #include "cyber/proto/record.pb.h" 30 #include "cyber/proto/topology_change.pb.h" 37 using apollo::cyber::proto::ChangeMsg;
38 using apollo::cyber::proto::RoleAttributes;
39 using apollo::cyber::proto::RoleType;
47 class Recorder :
public std::enable_shared_from_this<Recorder> {
49 Recorder(
const std::string& output,
bool all_channels,
50 const std::vector<std::string>& white_channels,
51 const std::vector<std::string>& black_channels);
52 Recorder(
const std::string& output,
bool all_channels,
53 const std::vector<std::string>& white_channels,
54 const std::vector<std::string>& black_channels,
55 const proto::Header& header);
61 bool is_started_ =
false;
62 bool is_stopping_ =
false;
63 std::shared_ptr<Node> node_ =
nullptr;
64 std::shared_ptr<RecordWriter> writer_ =
nullptr;
65 std::shared_ptr<std::thread> display_thread_ =
nullptr;
68 bool all_channels_ =
true;
69 std::vector<std::string> white_channels_;
70 std::vector<std::string> black_channels_;
71 proto::Header header_;
72 std::unordered_map<std::string, std::shared_ptr<ReaderBase>>
74 uint64_t message_count_;
75 uint64_t message_time_;
77 bool InitReadersImpl();
79 bool FreeReadersImpl();
81 bool InitReaderImpl(
const std::string& channel_name,
82 const std::string& message_type);
84 void TopologyCallback(
const ChangeMsg& msg);
86 void ReaderCallback(
const std::shared_ptr<RawMessage>& message,
87 const std::string& channel_name);
89 void FindNewChannel(
const RoleAttributes& role_attr);
98 #endif // CYBER_TOOLS_CYBER_RECORDER_RECORDER_H_
PlanningContext is the runtime context in planning. It is persistent across multiple frames...
Definition: atomic_hash_map.h:25
Definition: raw_message.h:31
elements in Cyber – Node, Channel, Service, Writer, Reader, Client and Server's relationship is pres...
Definition: topology_manager.h:64
Node is the fundamental building block of Cyber RT. every module contains and communicates through th...
Definition: node.h:44
Recorder(const std::string &output, bool all_channels, const std::vector< std::string > &white_channels, const std::vector< std::string > &black_channels)
Base Class for Reader Reader is identified by one apollo::cyber::proto::RoleAttribute, it contains the channel_name, channel_id that we subscribe, and host_name, process_id and node that we are located, and qos that describes our transportation quality.
Definition: reader_base.h:46
Topology Manager of Service related.
Definition: channel_manager.h:42
Definition: recorder.h:47