Class: Quark::MdkRuntime::Files::Subscription
- Inherits:
-
DatawireQuarkCore::QuarkObject
- Object
- DatawireQuarkCore::QuarkObject
- Quark::MdkRuntime::Files::Subscription
- Extended by:
- DatawireQuarkCore::Static
- Defined in:
- lib/mdk_runtime/files.rb
Overview
A specific file notification subscription.
Constant Summary
Constants included from DatawireQuarkCore::Static
DatawireQuarkCore::Static::Unassigned
Instance Attribute Summary collapse
-
#actor ⇒ Object
Returns the value of attribute actor.
-
#path ⇒ Object
Returns the value of attribute path.
-
#previous_listing ⇒ Object
Returns the value of attribute previous_listing.
-
#subscriber ⇒ Object
Returns the value of attribute subscriber.
Instance Method Summary collapse
- #__init_fields__ ⇒ Object
- #_getClass ⇒ Object
- #_getField(name) ⇒ Object
- #_setField(name, value) ⇒ Object
-
#initialize(actor, subscriber, path) ⇒ Subscription
constructor
A new instance of Subscription.
- #poll ⇒ Object
Methods included from DatawireQuarkCore::Static
_lazy_statics, static, unlazy_statics
Methods inherited from DatawireQuarkCore::QuarkObject
Constructor Details
#initialize(actor, subscriber, path) ⇒ Subscription
Returns a new instance of Subscription.
471 472 473 474 475 476 477 478 479 |
# File 'lib/mdk_runtime/files.rb', line 471 def initialize(actor, subscriber, path) self.__init_fields__ (self).subscriber = subscriber (self).actor = actor (self).path = path nil end |
Instance Attribute Details
#actor ⇒ Object
Returns the value of attribute actor.
464 465 466 |
# File 'lib/mdk_runtime/files.rb', line 464 def actor @actor end |
#path ⇒ Object
Returns the value of attribute path.
464 465 466 |
# File 'lib/mdk_runtime/files.rb', line 464 def path @path end |
#previous_listing ⇒ Object
Returns the value of attribute previous_listing.
464 465 466 |
# File 'lib/mdk_runtime/files.rb', line 464 def previous_listing @previous_listing end |
#subscriber ⇒ Object
Returns the value of attribute subscriber.
464 465 466 |
# File 'lib/mdk_runtime/files.rb', line 464 def subscriber @subscriber end |
Instance Method Details
#__init_fields__ ⇒ Object
559 560 561 562 563 564 565 566 567 |
# File 'lib/mdk_runtime/files.rb', line 559 def __init_fields__() self.path = nil self.actor = nil self.subscriber = nil self.previous_listing = ::DatawireQuarkCore::List.new([]) nil end |
#_getClass ⇒ Object
515 516 517 518 519 520 |
# File 'lib/mdk_runtime/files.rb', line 515 def _getClass() return "mdk_runtime.files._Subscription" nil end |
#_getField(name) ⇒ Object
522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 |
# File 'lib/mdk_runtime/files.rb', line 522 def _getField(name) if ((name) == ("path")) return (self).path end if ((name) == ("actor")) return (self).actor end if ((name) == ("subscriber")) return (self).subscriber end if ((name) == ("previous_listing")) return (self).previous_listing end return nil nil end |
#_setField(name, value) ⇒ Object
541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 |
# File 'lib/mdk_runtime/files.rb', line 541 def _setField(name, value) if ((name) == ("path")) (self).path = ::DatawireQuarkCore.cast(value) { ::String } end if ((name) == ("actor")) (self).actor = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.files.FileActorImpl } end if ((name) == ("subscriber")) (self).subscriber = ::DatawireQuarkCore.cast(value) { ::Quark.mdk_runtime.actors.Actor } end if ((name) == ("previous_listing")) (self).previous_listing = ::DatawireQuarkCore.cast(value) { ::DatawireQuarkCore::List } end nil end |
#poll ⇒ Object
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 |
# File 'lib/mdk_runtime/files.rb', line 484 def poll() new_listing = [] idx = 0 while ((idx) < ((new_listing).size)) do (self).actor._send(::Quark.mdk_runtime.files.FileContents.new((new_listing)[idx], ""), (self).subscriber) idx = (idx) + (1) end idx = 0 jdx = nil found = nil while ((idx) < ((@previous_listing).size)) do jdx = 0 found = false while ((jdx) < ((new_listing).size)) do if (((@previous_listing)[idx]) == ((new_listing)[jdx])) found = true break end jdx = (jdx) + (1) end if (!(found)) (self).actor._send(::Quark.mdk_runtime.files.FileDeleted.new((@previous_listing)[idx]), (self).subscriber) end idx = (idx) + (1) end (self).previous_listing = new_listing nil end |