From 7605c204bc156d1ae3373e4aa04cd56972a54ad0 Mon Sep 17 00:00:00 2001
From: Jason Wang <wangr1@ornl.gov>
Date: Thu, 28 Sep 2017 12:10:21 -0400
Subject: [PATCH] added Read() to Transport class

---
 source/adios2/toolkit/transport/Transport.h             | 7 +++++++
 source/adios2/toolkit/transport/file/FileDescriptor.cpp | 5 +++++
 source/adios2/toolkit/transport/file/FileDescriptor.h   | 2 ++
 source/adios2/toolkit/transport/file/FilePointer.cpp    | 5 +++++
 source/adios2/toolkit/transport/file/FilePointer.h      | 2 ++
 source/adios2/toolkit/transport/file/FileStream.cpp     | 5 +++++
 source/adios2/toolkit/transport/file/FileStream.h       | 2 ++
 source/adios2/toolkit/transport/wan/WANZmq.cpp          | 5 +++++
 source/adios2/toolkit/transport/wan/WANZmq.h            | 2 ++
 9 files changed, 35 insertions(+)

diff --git a/source/adios2/toolkit/transport/Transport.h b/source/adios2/toolkit/transport/Transport.h
index cfca583af..a85760343 100644
--- a/source/adios2/toolkit/transport/Transport.h
+++ b/source/adios2/toolkit/transport/Transport.h
@@ -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;
 
diff --git a/source/adios2/toolkit/transport/file/FileDescriptor.cpp b/source/adios2/toolkit/transport/file/FileDescriptor.cpp
index 879ca2b70..6d36ed55c 100644
--- a/source/adios2/toolkit/transport/file/FileDescriptor.cpp
+++ b/source/adios2/toolkit/transport/file/FileDescriptor.cpp
@@ -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()
diff --git a/source/adios2/toolkit/transport/file/FileDescriptor.h b/source/adios2/toolkit/transport/file/FileDescriptor.h
index fe010c6e3..79aea45e0 100644
--- a/source/adios2/toolkit/transport/file/FileDescriptor.h
+++ b/source/adios2/toolkit/transport/file/FileDescriptor.h
@@ -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;
 
diff --git a/source/adios2/toolkit/transport/file/FilePointer.cpp b/source/adios2/toolkit/transport/file/FilePointer.cpp
index e11c4f9fb..a01e2215f 100644
--- a/source/adios2/toolkit/transport/file/FilePointer.cpp
+++ b/source/adios2/toolkit/transport/file/FilePointer.cpp
@@ -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);
diff --git a/source/adios2/toolkit/transport/file/FilePointer.h b/source/adios2/toolkit/transport/file/FilePointer.h
index 6d1521a3d..885dfeba4 100644
--- a/source/adios2/toolkit/transport/file/FilePointer.h
+++ b/source/adios2/toolkit/transport/file/FilePointer.h
@@ -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;
diff --git a/source/adios2/toolkit/transport/file/FileStream.cpp b/source/adios2/toolkit/transport/file/FileStream.cpp
index 360939453..ff035299e 100644
--- a/source/adios2/toolkit/transport/file/FileStream.cpp
+++ b/source/adios2/toolkit/transport/file/FileStream.cpp
@@ -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();
diff --git a/source/adios2/toolkit/transport/file/FileStream.h b/source/adios2/toolkit/transport/file/FileStream.h
index 21df05a72..9443220cd 100644
--- a/source/adios2/toolkit/transport/file/FileStream.h
+++ b/source/adios2/toolkit/transport/file/FileStream.h
@@ -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;
diff --git a/source/adios2/toolkit/transport/wan/WANZmq.cpp b/source/adios2/toolkit/transport/wan/WANZmq.cpp
index 9d9e36441..7d002374d 100644
--- a/source/adios2/toolkit/transport/wan/WANZmq.cpp
+++ b/source/adios2/toolkit/transport/wan/WANZmq.cpp
@@ -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()
diff --git a/source/adios2/toolkit/transport/wan/WANZmq.h b/source/adios2/toolkit/transport/wan/WANZmq.h
index 167814b4f..692d70b01 100644
--- a/source/adios2/toolkit/transport/wan/WANZmq.h
+++ b/source/adios2/toolkit/transport/wan/WANZmq.h
@@ -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;
-- 
GitLab