diff --git a/iocore/eventsystem/I_IOBuffer.h b/iocore/eventsystem/I_IOBuffer.h index 164ec1a9af7..4390bb1e256 100644 --- a/iocore/eventsystem/I_IOBuffer.h +++ b/iocore/eventsystem/I_IOBuffer.h @@ -1272,13 +1272,13 @@ class MIOBuffer */ struct MIOBufferAccessor { IOBufferReader * - reader() + reader() const { return entry; } MIOBuffer * - writer() + writer() const { return mbuf; } diff --git a/iocore/eventsystem/I_VIO.h b/iocore/eventsystem/I_VIO.h index b80522035c8..d2b2b10568f 100644 --- a/iocore/eventsystem/I_VIO.h +++ b/iocore/eventsystem/I_VIO.h @@ -25,17 +25,12 @@ #pragma once #define I_VIO_h -#include "tscore/ink_platform.h" -#include "I_EventSystem.h" #if !defined(I_IOBuffer_h) #error "include I_IOBuffer.h" ----include I_IOBuffer.h #endif -#include "tscore/ink_apidefs.h" - class Continuation; + +class Continuation; class VConnection; -class IOVConnection; -class MIOBuffer; class ProxyMutex; /** @@ -73,9 +68,12 @@ class ProxyMutex; class VIO { public: + explicit VIO(int aop); + VIO(); ~VIO() {} + /** Interface for the VConnection that owns this handle. */ - Continuation *get_continuation(); + Continuation *get_continuation() const; void set_continuation(Continuation *cont); /** @@ -95,15 +93,15 @@ class VIO @return The number of bytes to be processed by the operation. */ - int64_t ntodo(); + int64_t ntodo() const; ///////////////////// // buffer settings // ///////////////////// void set_writer(MIOBuffer *writer); void set_reader(IOBufferReader *reader); - MIOBuffer *get_writer(); - IOBufferReader *get_reader(); + MIOBuffer *get_writer() const; + IOBufferReader *get_reader() const; /** Reenable the IO operation. @@ -140,10 +138,7 @@ class VIO inkcoreapi void reenable_re(); void disable(); - bool is_disabled(); - - explicit VIO(int aop); - VIO(); + bool is_disabled() const; enum { NONE = 0, @@ -160,7 +155,6 @@ class VIO STAT, }; -public: /** Continuation to callback. @@ -225,5 +219,3 @@ class VIO private: bool _disabled = false; }; - -#include "I_VConnection.h" diff --git a/iocore/eventsystem/P_VIO.h b/iocore/eventsystem/P_VIO.h index 4eebf0698ca..b934e910f77 100644 --- a/iocore/eventsystem/P_VIO.h +++ b/iocore/eventsystem/P_VIO.h @@ -27,44 +27,45 @@ TS_INLINE VIO::VIO(int aop) : op(aop), buffer(), mutex(nullptr) {} -///////////////////////////////////////////////////////////// -// -// VIO::VIO() -// -///////////////////////////////////////////////////////////// TS_INLINE VIO::VIO() : buffer(), mutex(nullptr) {} TS_INLINE Continuation * -VIO::get_continuation() +VIO::get_continuation() const { return cont; } + TS_INLINE void VIO::set_writer(MIOBuffer *writer) { buffer.writer_for(writer); } + TS_INLINE void VIO::set_reader(IOBufferReader *reader) { buffer.reader_for(reader); } + TS_INLINE MIOBuffer * -VIO::get_writer() +VIO::get_writer() const { return buffer.writer(); } + TS_INLINE IOBufferReader * -VIO::get_reader() +VIO::get_reader() const { return (buffer.reader()); } + TS_INLINE int64_t -VIO::ntodo() +VIO::ntodo() const { return nbytes - ndone; } + TS_INLINE void VIO::done() { @@ -75,11 +76,6 @@ VIO::done() } } -///////////////////////////////////////////////////////////// -// -// VIO::set_continuation() -// -///////////////////////////////////////////////////////////// TS_INLINE void VIO::set_continuation(Continuation *acont) { @@ -96,11 +92,6 @@ VIO::set_continuation(Continuation *acont) return; } -///////////////////////////////////////////////////////////// -// -// VIO::reenable() -// -///////////////////////////////////////////////////////////// TS_INLINE void VIO::reenable() { @@ -110,11 +101,6 @@ VIO::reenable() } } -///////////////////////////////////////////////////////////// -// -// VIO::reenable_re() -// -///////////////////////////////////////////////////////////// TS_INLINE void VIO::reenable_re() { @@ -131,7 +117,7 @@ VIO::disable() } TS_INLINE bool -VIO::is_disabled() +VIO::is_disabled() const { return this->_disabled; }