openthread-br  0.3.0-72c0388
Public Member Functions | List of all members
otbr::rest::Connection Class Reference

#include <src/rest/connection.hpp>

Inheritance diagram for otbr::rest::Connection:
otbr::MainloopProcessor

Public Member Functions

 Connection (steady_clock::time_point aStartTime, Resource *aResource, int aFd)
 
 ~Connection (void) override
 
void Init (void)
 
void Update (MainloopContext &aMainloop) override
 
void Process (const MainloopContext &aMainloop) override
 
bool IsComplete (void) const
 

Detailed Description

This class implements a Connection class of each socket connection.

Constructor & Destructor Documentation

◆ Connection()

otbr::rest::Connection::Connection ( steady_clock::time_point  aStartTime,
Resource aResource,
int  aFd 
)

The constructor is to initialize a socket connection instance.

Parameters
[in]aStartTimeThe reference start time of a connection which is set when created for the first time and maybe reset when transfer to wait callback or wait write state.
[in]aResourceA pointer to the resource handler.
[in]aFdThe file descriptor for the connection.

◆ ~Connection()

otbr::rest::Connection::~Connection ( void  )
override

The desctructor destroys the connection instance.

Member Function Documentation

◆ Init()

void otbr::rest::Connection::Init ( void  )

This method initializes the connection.

◆ IsComplete()

bool otbr::rest::Connection::IsComplete ( void  ) const

This method indicates whether this connection no longer need to be processed.

Return values
TRUEThis connection could be released in next loop.
FALSEThis connection still needs to be processed in next loop.

◆ Process()

void otbr::rest::Connection::Process ( const MainloopContext aMainloop)
overridevirtual

This method processes mainloop events.

Parameters
[in]aMainloopA reference to the mainloop context.

Implements otbr::MainloopProcessor.

◆ Update()

void otbr::rest::Connection::Update ( MainloopContext aMainloop)
overridevirtual

This method updates the mainloop context.

Parameters
[in,out]aMainloopA reference to the mainloop to be updated.

Implements otbr::MainloopProcessor.


The documentation for this class was generated from the following files: