Summary Files Commits Branches @commit @diff @stats
path: root / src / message.h
diff options
context:
space:
mode:
1 files changed, 10 insertions, 6 deletions
-rw-r--r--src/message.h16
diff --git a/src/message.h b/src/message.h
index c988059..fcc8258 100644
--- a/src/message.h
+++ b/src/message.h
@@ -10,19 +10,23 @@ class Message {
unsigned int received;
unsigned char* msg;
+ void free();
+ void copyFrom(const Message& other);
+
public:
- Message() = default;
Message(unsigned int can_id, const Frame& first_frame);
- Message(const Message& rhs);
- ~Message() {
- delete[] this->msg;
- }
+ /* 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);
};