OpenClonk
SCHTimer Class Reference
Inheritance diagram for SCHTimer:
[legend]
Collaboration diagram for SCHTimer:
[legend]

Instance Methods

(void) - registerAt:
 
(void) - unregisterFrom:
 
(id) - initWithProc:
 
(bool) - shouldExecuteProc
 
(void) - changed
 

Protected Attributes

__weak SCHAdditionsschedulerAdditions
 
StdSchedulerProcproc
 

Detailed Description

Definition at line 45 of file StdSchedulerMac.mm.

Method Documentation

◆ changed

- (void) changed

Definition at line 71 of file StdSchedulerMac.mm.

194 {
195  [schedulerAdditions changed:self];
196 }

Referenced by StdScheduler::Changed().

Here is the caller graph for this function:

◆ initWithProc:

- (id) initWithProc: (StdSchedulerProc*)  _proc

Definition at line 71 of file StdSchedulerMac.mm.

169  :(StdSchedulerProc *) _proc
170 {
171  if (self = [super init])
172  {
173  proc = _proc;
174  return self;
175  } else
176  return nil;
177 }
StdSchedulerProc * proc

◆ registerAt:

- (void) registerAt: (SCHAdditions*)  _additions

Reimplemented from SCHAddition.

Definition at line 71 of file StdSchedulerMac.mm.

215  :(SCHAdditions*) _additions
216 {
217  [super registerAt:_additions];
218  auto loop = _additions.runLoop;
219  timer = [NSTimer timerWithTimeInterval:proc->TimerInterval()/1000.0 target:self selector:@selector(run:) userInfo:nil repeats:YES];
220  [loop addTimer:timer forMode:NSDefaultRunLoopMode];
221 }
__weak NSRunLoop * runLoop

◆ shouldExecuteProc

- (bool) shouldExecuteProc

Definition at line 71 of file StdSchedulerMac.mm.

179 {
180  if (!proc)
181  return false;
182  auto s = schedulerAdditions;
183  return s && !s.scheduler->IsInManualLoop();
184 }
#define s
__weak SCHAdditions * schedulerAdditions

Referenced by SCHNotify::registerAt:.

Here is the caller graph for this function:

◆ unregisterFrom:

- (void) unregisterFrom: (SCHAdditions*)  _additions

Reimplemented from SCHAddition.

Definition at line 71 of file StdSchedulerMac.mm.

222  :(SCHAdditions*) _additions
223 {
224  [timer invalidate];
225  timer = nil;
226  [super unregisterFrom:_additions];
227 }

Member Data Documentation

◆ proc

- (StdSchedulerProc*) proc
protectedinherited

Definition at line 28 of file StdSchedulerMac.mm.

Referenced by SCHNotify::registerAt:.

◆ schedulerAdditions

- (__weak SCHAdditions*) schedulerAdditions
protectedinherited

Definition at line 27 of file StdSchedulerMac.mm.


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