Skip to content
Snippets Groups Projects
Commit 7605c204 authored by Wang, Ruonan's avatar Wang, Ruonan
Browse files

added Read() to Transport class

parent cf9b469d
No related branches found
No related tags found
1 merge request!275added Read() to Transport class
......@@ -72,6 +72,13 @@ public:
*/
virtual void Write(const char *buffer, size_t size) = 0;
/**
* Reads from file stream
* @param buffer raw data to read from file stream
* @param size number of bytes to read from file stream
*/
virtual void Read(char *buffer, size_t size) = 0;
/** flushes current contents to physical medium without closing */
virtual void Flush() = 0;
......
......@@ -159,6 +159,11 @@ void FileDescriptor::Write(const char *buffer, size_t size)
}
}
void FileDescriptor::Read(char *buffer, size_t size)
{
// TODO: Implement read function
}
void FileDescriptor::Flush() {}
void FileDescriptor::Close()
......
......@@ -32,6 +32,8 @@ public:
void Write(const char *buffer, size_t size) final;
void Read(char *buffer, size_t size) final;
/** Does nothing, each write is supposed to flush */
void Flush() final;
......
......@@ -136,6 +136,11 @@ void FilePointer::Write(const char *buffer, size_t size)
}
}
void FilePointer::Read(char *buffer, size_t size)
{
// TODO: Implement read function
}
void FilePointer::Flush()
{
const int status = std::fflush(m_File);
......
......@@ -39,6 +39,8 @@ public:
void Write(const char *buffer, size_t size) final;
void Read(char *buffer, size_t size) final;
void Flush() final;
void Close() final;
......
......@@ -115,6 +115,11 @@ void FileStream::Write(const char *buffer, size_t size)
}
}
void FileStream::Read(char *buffer, size_t size)
{
// TODO: Implement read function
}
void FileStream::Flush()
{
m_FileStream.flush();
......
......@@ -36,6 +36,8 @@ public:
void Write(const char *buffer, size_t size) final;
void Read(char *buffer, size_t size) final;
void Flush() final;
void Close() final;
......
......@@ -148,6 +148,11 @@ void WANZmq::Write(const char *buffer, size_t size)
*/
}
void WANZmq::Read(char *buffer, size_t size)
{
// TODO: Implement read function
}
void WANZmq::Flush() {}
void WANZmq::Close()
......
......@@ -40,6 +40,8 @@ public:
void Write(const char *buffer, size_t size) final;
void Read(char *buffer, size_t size) final;
void Flush() final;
void Close() final;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment