#ifndef ISO_TP_MESSAGE #define ISO_TP_MESSAGE #include #include "frame.h" class Message { unsigned int can_id; unsigned int size; unsigned int received; unsigned char latest_index; unsigned char* msg; void free(); void copyFrom(const Message& other); public: Message(unsigned int can_id, const Frame& first_frame); /* Rule of 4 */ Message() = default; ~Message(); Message(const Message& other); Message& operator=(const Message& other); /* Logic */ void receive_frame(const Frame& f); bool expects_more_frames() const; /* IO */ friend std::ostream& operator<<(std::ostream& os, const Message& m); }; std::ostream& operator<<(std::ostream& os, const Message& m); #endif /* ISO_TP_MESSAGE */