Class: Quark::MdkRuntime::QuarkRuntimeTime

Inherits:
DatawireQuarkCore::QuarkObject show all
Extended by:
DatawireQuarkCore::Static
Defined in:
lib/mdk_runtime.rb

Constant Summary

Constants included from DatawireQuarkCore::Static

DatawireQuarkCore::Static::Unassigned

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from DatawireQuarkCore::Static

_lazy_statics, static, unlazy_statics

Methods inherited from DatawireQuarkCore::QuarkObject

#to_s

Constructor Details

#initializeQuarkRuntimeTime

Returns a new instance of QuarkRuntimeTime.



1386
1387
1388
1389
1390
# File 'lib/mdk_runtime.rb', line 1386

def initialize()
    self.__init_fields__

    nil
end

Instance Attribute Details

#dispatcherObject

Returns the value of attribute dispatcher.



1379
1380
1381
# File 'lib/mdk_runtime.rb', line 1379

def dispatcher
  @dispatcher
end

#stoppedObject

Returns the value of attribute stopped.



1379
1380
1381
# File 'lib/mdk_runtime.rb', line 1379

def stopped
  @stopped
end

Instance Method Details

#__init_fields__Object



1464
1465
1466
1467
1468
1469
1470
# File 'lib/mdk_runtime.rb', line 1464

def __init_fields__()
    
    self.dispatcher = nil
    self.stopped = false

    nil
end

#_getClassObject



1432
1433
1434
1435
1436
1437
# File 'lib/mdk_runtime.rb', line 1432

def _getClass()
    
    return "mdk_runtime.QuarkRuntimeTime"

    nil
end

#_getField(name) ⇒ Object



1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
# File 'lib/mdk_runtime.rb', line 1439

def _getField(name)
    
    if ((name) == ("dispatcher"))
        return (self).dispatcher
    end
    if ((name) == ("stopped"))
        return (self).stopped
    end
    return nil

    nil
end

#_setField(name, value) ⇒ Object



1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
# File 'lib/mdk_runtime.rb', line 1452

def _setField(name, value)
    
    if ((name) == ("dispatcher"))
        (self).dispatcher = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.actors.MessageDispatcher }
    end
    if ((name) == ("stopped"))
        (self).stopped = ::DatawireQuarkCore.cast(value) { ::Object }
    end

    nil
end

#onMessage(origin, msg) ⇒ Object



1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/mdk_runtime.rb', line 1409

def onMessage(origin, msg)
    
    if ((self).stopped)
        return
    end
    sched = ::DatawireQuarkCore.cast(msg) { ::Quark.mdk_runtime.Schedule }
    seconds = (sched).seconds
    if ((seconds) == (0.0))
        seconds = 0.1
    end
    ::Quark.quark.concurrent.Context.runtime().schedule(::Quark.mdk_runtime._ScheduleTask.new(self, origin, (sched).event), seconds)

    nil
end

#onStart(dispatcher) ⇒ Object



1395
1396
1397
1398
1399
1400
# File 'lib/mdk_runtime.rb', line 1395

def onStart(dispatcher)
    
    (self).dispatcher = dispatcher

    nil
end

#onStopObject



1402
1403
1404
1405
1406
1407
# File 'lib/mdk_runtime.rb', line 1402

def onStop()
    
    (self).stopped = true

    nil
end

#timeObject



1424
1425
1426
1427
1428
1429
1430
# File 'lib/mdk_runtime.rb', line 1424

def time()
    
    milliseconds = (::Quark.quark.concurrent.Context.runtime().now()).to_f
    return (milliseconds) / (1000.0)

    nil
end