OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
StdSchedulerProc Class Referenceabstract

#include <StdScheduler.h>

Inheritance diagram for StdSchedulerProc:
[legend]

Public Member Functions

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

Protected Member Functions

void Changed ()
 

Friends

class StdScheduler
 

Detailed Description

Definition at line 54 of file StdScheduler.h.

Constructor & Destructor Documentation

StdSchedulerProc::StdSchedulerProc ( )
inline

Definition at line 62 of file StdScheduler.h.

62 : scheduler(nullptr) {}
virtual StdSchedulerProc::~StdSchedulerProc ( )
inlinevirtual

Definition at line 63 of file StdScheduler.h.

63 { }

Member Function Documentation

void StdSchedulerProc::Changed ( )
protected

Definition at line 121 of file StdScheduler.cpp.

References s.

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

122 {
123  auto s = scheduler;
124  if (s)
125  s->Changed(this);
126 }
#define s

Here is the caller graph for this function:

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

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

Referenced by ExecuteUntil().

Here is the caller graph for this function:

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

Definition at line 46 of file StdScheduler.cpp.

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

Referenced by main().

47 {
48  // Infinite?
49  if (iTimeout < 0)
50  for (;;)
51  if (!Execute())
52  return false;
53  // Calculate endpoint
54  C4TimeMilliseconds tStopTime = C4TimeMilliseconds::Now() + iTimeout;
55  for (;;)
56  {
57  // Call execute with given timeout
58  if (!Execute(std::max(iTimeout, 0)))
59  return false;
60  // Calculate timeout
62  if (tTime >= tStopTime)
63  break;
64  iTimeout = tStopTime - tTime;
65  }
66  // All ok.
67  return true;
68 }
virtual bool Execute(int iTimeout=-1, pollfd *readyfds=0)=0
static C4TimeMilliseconds Now()

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void StdSchedulerProc::GetFDs ( std::vector< struct pollfd > &  )
inlinevirtual

Reimplemented in C4NetIOSimpleUDP, C4NetIOTCP, CStdNotifyProc, C4FileMonitor, and C4StdInProc.

Definition at line 76 of file StdScheduler.h.

Referenced by SCHNotify::registerAt:.

76 { }

Here is the caller graph for this function:

C4TimeMilliseconds StdSchedulerProc::GetNextTick ( C4TimeMilliseconds  tNow)
virtual

Reimplemented in C4NetIOUDP, C4Network2HTTPClient, C4Network2IO, and CStdTimerProc.

Definition at line 128 of file StdScheduler.cpp.

References C4TimeMilliseconds::PositiveInfinity.

Referenced by C4Network2HTTPClient::GetNextTick().

Here is the caller graph for this function:

virtual bool StdSchedulerProc::IsLowPriority ( )
inlinevirtual

Definition at line 86 of file StdScheduler.h.

86 { return false; }
virtual bool StdSchedulerProc::IsNotify ( )
inlinevirtual

Reimplemented in C4NetIO, and CStdNotifyProc.

Definition at line 87 of file StdScheduler.h.

Referenced by SCHAdditions::assignAdditionForProc:.

87 { return false; }

Here is the caller graph for this function:

bool StdSchedulerProc::IsSignaled ( )
virtual uint32_t StdSchedulerProc::TimerInterval ( )
inlinevirtual

Reimplemented in CStdTimerProc.

Definition at line 88 of file StdScheduler.h.

Referenced by SCHAdditions::assignAdditionForProc:.

88 { return 0; }

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class StdScheduler
friend

Definition at line 90 of file StdScheduler.h.


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