OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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

- (void) changed

Definition at line 193 of file StdSchedulerMac.mm.

References SCHAdditions::changed:, and SCHAddition::schedulerAdditions.

Referenced by StdScheduler::Changed().

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

Here is the call graph for this function:

Here is the caller graph for this function:

- (id) initWithProc: (StdSchedulerProc*)  _proc

Definition at line 169 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
- (void) registerAt: (SCHAdditions*)  _additions

Reimplemented from SCHAddition.

Definition at line 215 of file StdSchedulerMac.mm.

References SCHAddition::registerAt:, and SCHAdditions::runLoop.

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

Here is the call graph for this function:

- (bool) shouldExecuteProc

Definition at line 178 of file StdSchedulerMac.mm.

References s, and SCHAddition::schedulerAdditions.

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

Reimplemented from SCHAddition.

Definition at line 222 of file StdSchedulerMac.mm.

References SCHAddition::unregisterFrom:.

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

Here is the call graph for this function:

Member Data Documentation

- (StdSchedulerProc*) proc
protectedinherited

Definition at line 28 of file StdSchedulerMac.mm.

- (__weak SCHAdditions*) schedulerAdditions
protectedinherited

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