blocxx
BLOCXX_NAMESPACE::Timeout Class Reference

A timeout can be absolute, which means that it will happen at the specified DateTime. More...

#include <Timeout.hpp>

Public Types

enum  ETimeoutType { E_ABSOLUTE , E_RELATIVE , E_RELATIVE_WITH_RESET }
 

Public Member Functions

ETimeoutType getType () const
 
DateTime getAbsolute () const
 
float getRelative () const
 

Static Public Member Functions

static Timeout absolute (const DateTime &dt)
 
static Timeout relative (float seconds)
 
static Timeout relativeWithReset (float seconds)
 

Static Public Attributes

static Timeout infinite = relative( std::numeric_limits<float>::infinity() )
 

Private Member Functions

 Timeout ()
 
 Timeout (ETimeoutType type, const DateTime &dt)
 
 Timeout (ETimeoutType type, float seconds)
 

Private Attributes

ETimeoutType m_type
 
DateTime m_absolute
 
float m_seconds
 

Detailed Description

A timeout can be absolute, which means that it will happen at the specified DateTime.

A timeout can be relative, which means that it will happen at the specified interval after the call is made. A timeout can be relative with reset, which means that it will happen at the specified interval after "no activity" has occurred. "no activity" is dependent on the operation. A timeout can be infinite.

Definition at line 55 of file Timeout.hpp.

Member Enumeration Documentation

◆ ETimeoutType

Enumerator
E_ABSOLUTE 
E_RELATIVE 
E_RELATIVE_WITH_RESET 

Definition at line 64 of file Timeout.hpp.

Constructor & Destructor Documentation

◆ Timeout() [1/3]

BLOCXX_NAMESPACE::Timeout::Timeout ( )
private

Definition at line 93 of file Timeout.cpp.

Referenced by absolute(), relative(), and relativeWithReset().

◆ Timeout() [2/3]

BLOCXX_NAMESPACE::Timeout::Timeout ( ETimeoutType type,
const DateTime & dt )
private

Definition at line 97 of file Timeout.cpp.

◆ Timeout() [3/3]

BLOCXX_NAMESPACE::Timeout::Timeout ( ETimeoutType type,
float seconds )
private

Definition at line 103 of file Timeout.cpp.

Member Function Documentation

◆ absolute()

Timeout BLOCXX_NAMESPACE::Timeout::absolute ( const DateTime & dt)
static

Definition at line 50 of file Timeout.cpp.

References E_ABSOLUTE, and Timeout().

Referenced by BLOCXX_NAMESPACE::TimeoutTimer::asAbsoluteTimeout().

◆ getAbsolute()

DateTime BLOCXX_NAMESPACE::Timeout::getAbsolute ( ) const

◆ getRelative()

◆ getType()

◆ relative()

Timeout BLOCXX_NAMESPACE::Timeout::relative ( float seconds)
static

Definition at line 58 of file Timeout.cpp.

References E_RELATIVE, and Timeout().

Referenced by BLOCXX_NAMESPACE::ServerSocket::accept(), BLOCXX_NAMESPACE::TimeoutTimer::asRelativeTimeout(), BLOCXX_NAMESPACE::TimeoutTimer::asRelativeTimeout(), BLOCXX_NAMESPACE::Thread::definitiveCancel(), BLOCXX_NAMESPACE::Exec::executeProcessAndGatherOutput(), BLOCXX_NAMESPACE::RWLocker::getReadLock(), BLOCXX_NAMESPACE::RWLocker::getWriteLock(), BLOCXX_NAMESPACE::ThreadCounter::incThreadCount(), BLOCXX_NAMESPACE::PosixUnnamedPipe::PosixUnnamedPipe(), BLOCXX_NAMESPACE::PosixUnnamedPipe::PosixUnnamedPipe(), BLOCXX_NAMESPACE::ReadLock::ReadLock(), BLOCXX_NAMESPACE::Select::select(), BLOCXX_NAMESPACE::Select::selectRW(), BLOCXX_NAMESPACE::Socket::setConnectTimeout(), BLOCXX_NAMESPACE::Socket::setReceiveTimeout(), BLOCXX_NAMESPACE::Socket::setSendTimeout(), BLOCXX_NAMESPACE::Socket::setTimeouts(), BLOCXX_NAMESPACE::ThreadPool::shutdown(), BLOCXX_NAMESPACE::ThreadImpl::sleep(), BLOCXX_NAMESPACE::PosixExec::spawnImpl(), BLOCXX_NAMESPACE::Exec::system(), BLOCXX_NAMESPACE::Condition::timedWait(), BLOCXX_NAMESPACE::Semaphore::timedWait(), BLOCXX_NAMESPACE::ThreadPool::tryAddWork(), BLOCXX_NAMESPACE::Process::waitCloseTerm(), BLOCXX_NAMESPACE::Process::waitCloseTerm(), BLOCXX_NAMESPACE::ThreadCounter::waitForAll(), BLOCXX_NAMESPACE::Socket::waitForInput(), BLOCXX_NAMESPACE::SocketUtils::waitForIO(), BLOCXX_NAMESPACE::Socket::waitForOutput(), BLOCXX_NAMESPACE::WriteLock::WriteLock(), and BLOCXX_NAMESPACE::Process::~Process().

◆ relativeWithReset()

Timeout BLOCXX_NAMESPACE::Timeout::relativeWithReset ( float seconds)
static

Definition at line 66 of file Timeout.cpp.

References E_RELATIVE_WITH_RESET, and Timeout().

Referenced by BLOCXX_NAMESPACE::Exec::gatherOutput().

Member Data Documentation

◆ infinite

◆ m_absolute

DateTime BLOCXX_NAMESPACE::Timeout::m_absolute
private

Definition at line 82 of file Timeout.hpp.

Referenced by getAbsolute().

◆ m_seconds

float BLOCXX_NAMESPACE::Timeout::m_seconds
private

Definition at line 83 of file Timeout.hpp.

Referenced by getRelative().

◆ m_type

ETimeoutType BLOCXX_NAMESPACE::Timeout::m_type
private

Definition at line 81 of file Timeout.hpp.

Referenced by getType().


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