Skip to content
Snippets Groups Projects
Commit acc392ad authored by williamfgc's avatar williamfgc Committed by GitHub
Browse files

Merge pull request #275 from JasonRuonanWang/dataman

added Read() to Transport class
parents cf9b469d 7605c204
No related branches found
No related tags found
No related merge requests found
......@@ -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