Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions iocore/eventsystem/I_IOBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -1272,13 +1272,13 @@ class MIOBuffer
*/
struct MIOBufferAccessor {
IOBufferReader *
reader()
reader() const
{
return entry;
}

MIOBuffer *
writer()
writer() const
{
return mbuf;
}
Expand Down
28 changes: 10 additions & 18 deletions iocore/eventsystem/I_VIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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);

/**
Expand All @@ -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.
Expand Down Expand Up @@ -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,
Expand All @@ -160,7 +155,6 @@ class VIO
STAT,
};

public:
/**
Continuation to callback.

Expand Down Expand Up @@ -225,5 +219,3 @@ class VIO
private:
bool _disabled = false;
};

#include "I_VConnection.h"
36 changes: 11 additions & 25 deletions iocore/eventsystem/P_VIO.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -75,11 +76,6 @@ VIO::done()
}
}

/////////////////////////////////////////////////////////////
//
// VIO::set_continuation()
//
/////////////////////////////////////////////////////////////
TS_INLINE void
VIO::set_continuation(Continuation *acont)
{
Expand All @@ -96,11 +92,6 @@ VIO::set_continuation(Continuation *acont)
return;
}

/////////////////////////////////////////////////////////////
//
// VIO::reenable()
//
/////////////////////////////////////////////////////////////
TS_INLINE void
VIO::reenable()
{
Expand All @@ -110,11 +101,6 @@ VIO::reenable()
}
}

/////////////////////////////////////////////////////////////
//
// VIO::reenable_re()
//
/////////////////////////////////////////////////////////////
TS_INLINE void
VIO::reenable_re()
{
Expand All @@ -131,7 +117,7 @@ VIO::disable()
}

TS_INLINE bool
VIO::is_disabled()
VIO::is_disabled() const
{
return this->_disabled;
}