Tamas Titusz Ban
/
ELEC1620_ExamTemplate_2019
Template for the ELEC1620 End of year exam
StreamOut/Message.cpp@0:54721f063ac8, 2019-03-22 (annotated)
- Committer:
- el16ttb
- Date:
- Fri Mar 22 13:11:07 2019 +0000
- Revision:
- 0:54721f063ac8
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
el16ttb | 0:54721f063ac8 | 1 | #include "Message.h" |
el16ttb | 0:54721f063ac8 | 2 | |
el16ttb | 0:54721f063ac8 | 3 | Message::Message(char code, unsigned int data): |
el16ttb | 0:54721f063ac8 | 4 | _code(code), |
el16ttb | 0:54721f063ac8 | 5 | _data(data) |
el16ttb | 0:54721f063ac8 | 6 | { |
el16ttb | 0:54721f063ac8 | 7 | |
el16ttb | 0:54721f063ac8 | 8 | } |
el16ttb | 0:54721f063ac8 | 9 | |
el16ttb | 0:54721f063ac8 | 10 | Message::Message(): |
el16ttb | 0:54721f063ac8 | 11 | _code(0x0F), |
el16ttb | 0:54721f063ac8 | 12 | _data(0x00) |
el16ttb | 0:54721f063ac8 | 13 | { |
el16ttb | 0:54721f063ac8 | 14 | |
el16ttb | 0:54721f063ac8 | 15 | } |
el16ttb | 0:54721f063ac8 | 16 | |
el16ttb | 0:54721f063ac8 | 17 | Message::~Message(){} |
el16ttb | 0:54721f063ac8 | 18 | |
el16ttb | 0:54721f063ac8 | 19 | void Message::set(char code, unsigned int data){ |
el16ttb | 0:54721f063ac8 | 20 | _code = code; |
el16ttb | 0:54721f063ac8 | 21 | _data = data; |
el16ttb | 0:54721f063ac8 | 22 | } |
el16ttb | 0:54721f063ac8 | 23 | |
el16ttb | 0:54721f063ac8 | 24 | char Message::get_code(){ |
el16ttb | 0:54721f063ac8 | 25 | return _code; |
el16ttb | 0:54721f063ac8 | 26 | } |
el16ttb | 0:54721f063ac8 | 27 | |
el16ttb | 0:54721f063ac8 | 28 | unsigned int Message::get_data(){ |
el16ttb | 0:54721f063ac8 | 29 | return _data; |
el16ttb | 0:54721f063ac8 | 30 | } |
el16ttb | 0:54721f063ac8 | 31 |