Loading include/kinetic/byte_stream.h +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class ByteStreamInterface { virtual bool Read(void *buf, size_t n) = 0; virtual bool Write(const void *buf, size_t n) = 0; virtual IncomingValueInterface *ReadValue(size_t n) = 0; virtual bool WriteValue(const OutgoingValueInterface &value) = 0; virtual bool WriteValue(const OutgoingValueInterface &value, int* err) = 0; }; class PlainByteStream : public ByteStreamInterface { Loading @@ -44,7 +44,7 @@ class PlainByteStream : public ByteStreamInterface { bool Read(void *buf, size_t n); bool Write(const void *buf, size_t n); IncomingValueInterface *ReadValue(size_t n); bool WriteValue(const OutgoingValueInterface &value); bool WriteValue(const OutgoingValueInterface &value, int* err); private: int fd_; Loading @@ -59,7 +59,7 @@ class SslByteStream : public ByteStreamInterface { bool Read(void *buf, size_t n); bool Write(const void *buf, size_t n); IncomingValueInterface *ReadValue(size_t n); bool WriteValue(const OutgoingValueInterface &value); bool WriteValue(const OutgoingValueInterface &value, int* err); private: SSL *ssl_; Loading include/kinetic/message_stream.h +4 −4 Original line number Diff line number Diff line Loading @@ -41,8 +41,8 @@ class MessageStreamInterface { virtual ~MessageStreamInterface() {} virtual MessageStreamReadStatus ReadMessage(::google::protobuf::Message *message, IncomingValueInterface** value) = 0; virtual bool WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value) = 0; virtual int WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value, int* err) = 0; }; class MessageStream : public MessageStreamInterface { Loading @@ -51,8 +51,8 @@ class MessageStream : public MessageStreamInterface { ~MessageStream(); MessageStreamReadStatus ReadMessage(::google::protobuf::Message *message, IncomingValueInterface** value); bool WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value); int WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value, int* err); private: bool ReadHeader(uint32_t *message_size, uint32_t *value_size); Loading include/kinetic/mock_message_stream.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class MockMessageStream : public MessageStreamInterface { MockMessageStream() {} MOCK_METHOD2(ReadMessage, MessageStreamReadStatus(::google::protobuf::Message *message, IncomingValueInterface** value)); MOCK_METHOD2(WriteMessage, bool(const ::google::protobuf::Message &message, MOCK_METHOD2(WriteMessage, int(const ::google::protobuf::Message &message, const OutgoingValueInterface& value)); MOCK_METHOD0(BytesRead, int64_t()); MOCK_METHOD0(BytesWritten, int64_t()); Loading include/kinetic/outgoing_value.h +4 −4 Original line number Diff line number Diff line Loading @@ -31,16 +31,16 @@ class OutgoingValueInterface { public: virtual ~OutgoingValueInterface() {} virtual size_t size() const = 0; virtual bool TransferToSocket(int fd) const = 0; virtual bool ToString(std::string *result) const = 0; virtual bool TransferToSocket(int fd, int* err) const = 0; virtual bool ToString(std::string *result, int* err) const = 0; }; class OutgoingStringValue : public OutgoingValueInterface { public: explicit OutgoingStringValue(const std::string &s); size_t size() const; bool TransferToSocket(int fd) const; bool ToString(std::string *result) const; bool TransferToSocket(int fd, int* err) const; bool ToString(std::string *result, int* err) const; private: const std::string s_; Loading include/kinetic/reader_writer.h +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace kinetic { class ReaderWriter { public: explicit ReaderWriter(int fd); bool Read(void *buf, size_t n); bool Read(void *buf, size_t n, int* err); bool Write(const void *buf, size_t n); private: Loading Loading
include/kinetic/byte_stream.h +3 −3 Original line number Diff line number Diff line Loading @@ -35,7 +35,7 @@ class ByteStreamInterface { virtual bool Read(void *buf, size_t n) = 0; virtual bool Write(const void *buf, size_t n) = 0; virtual IncomingValueInterface *ReadValue(size_t n) = 0; virtual bool WriteValue(const OutgoingValueInterface &value) = 0; virtual bool WriteValue(const OutgoingValueInterface &value, int* err) = 0; }; class PlainByteStream : public ByteStreamInterface { Loading @@ -44,7 +44,7 @@ class PlainByteStream : public ByteStreamInterface { bool Read(void *buf, size_t n); bool Write(const void *buf, size_t n); IncomingValueInterface *ReadValue(size_t n); bool WriteValue(const OutgoingValueInterface &value); bool WriteValue(const OutgoingValueInterface &value, int* err); private: int fd_; Loading @@ -59,7 +59,7 @@ class SslByteStream : public ByteStreamInterface { bool Read(void *buf, size_t n); bool Write(const void *buf, size_t n); IncomingValueInterface *ReadValue(size_t n); bool WriteValue(const OutgoingValueInterface &value); bool WriteValue(const OutgoingValueInterface &value, int* err); private: SSL *ssl_; Loading
include/kinetic/message_stream.h +4 −4 Original line number Diff line number Diff line Loading @@ -41,8 +41,8 @@ class MessageStreamInterface { virtual ~MessageStreamInterface() {} virtual MessageStreamReadStatus ReadMessage(::google::protobuf::Message *message, IncomingValueInterface** value) = 0; virtual bool WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value) = 0; virtual int WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value, int* err) = 0; }; class MessageStream : public MessageStreamInterface { Loading @@ -51,8 +51,8 @@ class MessageStream : public MessageStreamInterface { ~MessageStream(); MessageStreamReadStatus ReadMessage(::google::protobuf::Message *message, IncomingValueInterface** value); bool WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value); int WriteMessage(const ::google::protobuf::Message &message, const OutgoingValueInterface& value, int* err); private: bool ReadHeader(uint32_t *message_size, uint32_t *value_size); Loading
include/kinetic/mock_message_stream.h +1 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,7 @@ class MockMessageStream : public MessageStreamInterface { MockMessageStream() {} MOCK_METHOD2(ReadMessage, MessageStreamReadStatus(::google::protobuf::Message *message, IncomingValueInterface** value)); MOCK_METHOD2(WriteMessage, bool(const ::google::protobuf::Message &message, MOCK_METHOD2(WriteMessage, int(const ::google::protobuf::Message &message, const OutgoingValueInterface& value)); MOCK_METHOD0(BytesRead, int64_t()); MOCK_METHOD0(BytesWritten, int64_t()); Loading
include/kinetic/outgoing_value.h +4 −4 Original line number Diff line number Diff line Loading @@ -31,16 +31,16 @@ class OutgoingValueInterface { public: virtual ~OutgoingValueInterface() {} virtual size_t size() const = 0; virtual bool TransferToSocket(int fd) const = 0; virtual bool ToString(std::string *result) const = 0; virtual bool TransferToSocket(int fd, int* err) const = 0; virtual bool ToString(std::string *result, int* err) const = 0; }; class OutgoingStringValue : public OutgoingValueInterface { public: explicit OutgoingStringValue(const std::string &s); size_t size() const; bool TransferToSocket(int fd) const; bool ToString(std::string *result) const; bool TransferToSocket(int fd, int* err) const; bool ToString(std::string *result, int* err) const; private: const std::string s_; Loading
include/kinetic/reader_writer.h +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,7 @@ namespace kinetic { class ReaderWriter { public: explicit ReaderWriter(int fd); bool Read(void *buf, size_t n); bool Read(void *buf, size_t n, int* err); bool Write(const void *buf, size_t n); private: Loading