Wyatt  1.0.1
MockHardwareInterface.cpp
1 //
2 // Created by Tucker Haydon on 4/21/17.
3 //
4 
5 #include "include/MockHardwareInterface.h"
6 #include <iostream>
7 
8 MockHardwareInterface::MockHardwareInterface() {
9  this->writeMessages = new std::list<IMessage*>;
10  this->isSet = 0;
11 }
12 
14  this->writeMessages->push_back(msg);
15 }
16 
17 std::list<IMessage*>* MockHardwareInterface::read() {
18  if(this->isSet == 0) {
19  return new std::list<IMessage*>;
20  } else {
21  isSet = 0;
22  return this->readMessages;
23  }
24 }
25 
26 void MockHardwareInterface::setReadMessages(std::list<IMessage*>* messages) {
27  this->isSet = 1;
28  this->readMessages = messages;
29 }
30 
31 std::list<IMessage*>* MockHardwareInterface::getWriteMessages(){
32  if(this->writeMessages == NULL) {
33  return new std::list<IMessage*>;
34  } else {
35  return this->writeMessages;
36  }
37 }
std::list< IMessage * > * read()