OpenClonk
CStdNotifyProc Class Referenceabstract

#include <StdScheduler.h>

Inheritance diagram for CStdNotifyProc:
[legend]
Collaboration diagram for CStdNotifyProc:
[legend]

Public Member Functions

 CStdNotifyProc ()
 
void Notify ()
 
bool CheckAndReset ()
 
bool IsNotify () override
 
 ~CStdNotifyProc () override
 
void GetFDs (std::vector< struct pollfd > &checkfds) override
 
virtual bool Execute (int iTimeout=-1, pollfd *readyfds=nullptr)=0
 
bool ExecuteUntil (int iTimeout=-1)
 
virtual C4TimeMilliseconds GetNextTick (C4TimeMilliseconds tNow)
 
bool IsSignaled ()
 
virtual bool IsLowPriority ()
 
virtual uint32_t TimerInterval ()
 

Protected Member Functions

void Changed ()
 

Detailed Description

Definition at line 140 of file StdScheduler.h.

Constructor & Destructor Documentation

◆ CStdNotifyProc()

CStdNotifyProc::CStdNotifyProc ( )

◆ ~CStdNotifyProc()

CStdNotifyProc::~CStdNotifyProc ( )
override

Member Function Documentation

◆ Changed()

void StdSchedulerProc::Changed ( )
protectedinherited

Definition at line 108 of file StdScheduler.cpp.

109 {
110  auto s = scheduler;
111  if (s)
112  s->Changed(this);
113 }
#define s

References s.

Referenced by C4NetIOTCP::Accept(), C4NetIOTCP::AddConnectWait(), C4NetIOUDP::AddPeer(), C4NetIOTCP::Listen(), and CStdTimerProc::SetDelay().

Here is the caller graph for this function:

◆ CheckAndReset()

bool CStdNotifyProc::CheckAndReset ( )

Referenced by C4InteractiveThreadNotifyProc::Execute().

Here is the caller graph for this function:

◆ Execute()

virtual bool StdSchedulerProc::Execute ( int  iTimeout = -1,
pollfd *  readyfds = nullptr 
)
pure virtualinherited

Implemented in C4ApplicationSec1Timer, C4Network2::InitialConnect, C4NetIO, C4FileMonitor, C4InteractiveThreadNotifyProc, C4StdInProc, C4Network2IO, C4NetIOTCP, C4NetIOUDP, C4NetIOSimpleUDP, and C4HTTPClient.

Referenced by StdSchedulerProc::ExecuteUntil(), and SCHNotify::registerAt:.

Here is the caller graph for this function:

◆ ExecuteUntil()

bool StdSchedulerProc::ExecuteUntil ( int  iTimeout = -1)
inherited

Definition at line 33 of file StdScheduler.cpp.

34 {
35  // Infinite?
36  if (iTimeout < 0)
37  for (;;)
38  if (!Execute())
39  return false;
40  // Calculate endpoint
41  C4TimeMilliseconds tStopTime = C4TimeMilliseconds::Now() + iTimeout;
42  for (;;)
43  {
44  // Call execute with given timeout
45  if (!Execute(std::max(iTimeout, 0)))
46  return false;
47  // Calculate timeout
49  if (tTime >= tStopTime)
50  break;
51  iTimeout = tStopTime - tTime;
52  }
53  // All ok.
54  return true;
55 }
static C4TimeMilliseconds Now()
virtual bool Execute(int iTimeout=-1, pollfd *readyfds=nullptr)=0

References StdSchedulerProc::Execute(), and C4TimeMilliseconds::Now().

Referenced by main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetFDs()

void CStdNotifyProc::GetFDs ( std::vector< struct pollfd > &  checkfds)
overridevirtual

Reimplemented from StdSchedulerProc.

◆ GetNextTick()

C4TimeMilliseconds StdSchedulerProc::GetNextTick ( C4TimeMilliseconds  tNow)
virtualinherited

Reimplemented in CStdTimerProc, C4Network2IO, C4NetIOUDP, and C4HTTPClient.

Definition at line 115 of file StdScheduler.cpp.

References C4TimeMilliseconds::PositiveInfinity.

◆ IsLowPriority()

virtual bool StdSchedulerProc::IsLowPriority ( )
inlinevirtualinherited

Definition at line 82 of file StdScheduler.h.

82 { return false; }

◆ IsNotify()

bool CStdNotifyProc::IsNotify ( )
inlineoverridevirtual

Reimplemented from StdSchedulerProc.

Definition at line 147 of file StdScheduler.h.

147 { return true; }

◆ IsSignaled()

bool StdSchedulerProc::IsSignaled ( )
inherited

◆ Notify()

void CStdNotifyProc::Notify ( )

Referenced by C4InteractiveThread::PushEvent().

Here is the caller graph for this function:

◆ TimerInterval()

virtual uint32_t StdSchedulerProc::TimerInterval ( )
inlinevirtualinherited

Reimplemented in CStdTimerProc.

Definition at line 84 of file StdScheduler.h.

84 { return 0; }

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