18 #ifndef __igstkSerialCommunicationSimulator_h
19 #define __igstkSerialCommunicationSimulator_h
50 typedef std::ifstream FileType;
53 void SetFileName(
const char* filename);
89 unsigned int numberOfBytes );
93 unsigned int &bytesRead );
96 virtual void PrintSelf( std::ostream& os, itk::Indent indent )
const;
101 typedef std::map<BinaryData, std::vector<BinaryData> > ResponseTableType;
104 typedef std::map<BinaryData, std::vector<double> > ResponseTimeType;
108 typedef std::map<BinaryData, unsigned> ResponseCounterType;
114 std::string m_FileName;
117 ResponseTableType m_ResponseTable;
120 ResponseTimeType m_TimeTable;
123 ResponseCounterType m_CounterTable;
132 #endif // __igstkSerialCommunicationSimulator_h
virtual ResultType InternalPurgeBuffers(void)
Purge the input and output buffers.
virtual void InternalSleep(unsigned int milliseconds)
Sleep for the amount of time specified in milliseconds.
virtual ResultType InternalSendBreak(void)
Send a serial break.
virtual ResultType InternalUpdateParameters(void)
Sets up communication on the open port as per the communication parameters.
#define igstkStandardClassTraitsMacro(classname, superclassname)
Convenience macro for traits of a non-templated class.
const char * GetFileName() const
Get the file name for the recorded data.
virtual ResultType InternalWrite(const char *message, unsigned int numberOfBytes)
Write data.
~SerialCommunicationSimulator()
Destructor.
SerialCommunicationSimulator()
Constructor.
virtual void PrintSelf(std::ostream &os, itk::Indent indent) const
Print object information.
Communication::ResultType ResultType
virtual ResultType InternalClosePort(void)
Closes serial port.
This class simulates serial communication via a file.
This class implements communication over a serial port via RS-232.
SerialCommunication::ResultType ResultType
virtual ResultType InternalOpenPort(void)
Opens serial port for communication;.
BinaryData representing a binary data chunk.
virtual ResultType InternalRead(char *data, unsigned int numberOfBytes, unsigned int &bytesRead)
Read data.