package Ġcom . v cri st ian . com bus Ċ Ċ import Ġcom . v cri st ian . com bus . Communication Bus . Companion . instance Ġas ĠCom Bus ĊĊ Ċ /** Ċ Ġ* ĠSub scri bes Ġthe Ġreferenced Ġobject Ġto Ġexecuting Ġa Ġ[ list ening Callback ] Ġfunction Ċ Ġ* Ġupon Ġreceiving Ġsome Ġ[ event Class ] Ġobjects Ġand Ġadds Ġthis Ġsubscription Ċ Ġ* Ġto Ġthe Ġregistry Ġof Ġshared Ġinstance Ġof Ġ[ Communication Bus ] ĊĊ Ġ* Ġ@ author ĠC rist ian ĠV elin ci uc Ċ Ġ* Ċ Ġ* Ġ@ exception ĠUnsupportedOperationException Ġthrown Ġwhen Ġan Ġinstance Ġof ĠCommunication Bus Ġis Ġtransmitted Ġas Ġ[ receiver Object ] Ċ Ġ* Ċ Ġ* Ġ@ param Ġevent Class Ġexpected Ġ[ T ] Ġtype Ġof Ġobject Ġshould Ġtrigger Ġthis Ġlistener Ċ Ġ* Ġ@ param Ġlistening Callback Ġa Ġfunction Ġto Ġbe Ġtriggered Ġwhen Ġa Ġ[ T ] Ġtype Ġof Ġobject Ġis Ġreceived Ċ Ġ*/ Ċ fun Ġ< T : ĠAny > ĠAny . expect ( event Class : ĠClass < T >, Ġlistening Callback : Ġ( T ) Ġ-> ĠUnit ) Ġ{ ĊĠ ĠCom Bus . expect ( event Class , Ġthis , Ġlistening Callback ) Ċ } Ċ Ċ /** Ċ Ġ* ĠUn sub scri bes Ġsome Ġ[ receiver Object ] Ġfrom Ġreceiving Ġsome Ġ[ event Class ] Ġobjects Ġand Ġremoves Ċ Ġ* Ġthis Ġsubscription Ġfrom Ġthe Ġregistry Ġof Ġshared Ġinstance Ġof Ġ[ Communication Bus ] Ċ Ġ* Ċ Ġ* Ġ@ author ĠC rist ian ĠV elin ci uc Ċ Ġ* Ċ Ġ* Ġ@ param Ġevent Class Ġ[ T ] Ġtype Ġof Ġobject Ġthat Ġpotentially Ġtriggers Ġthis Ġ[ receiver Object ]' s Ġlistener Ċ Ġ*/ Ċ fun Ġ< T : ĠAny > ĠAny . dismiss ( event Class : ĠClass < T >) Ġ{ ĊĠ ĠCom Bus . dismiss ( event Class , Ġthis ) Ċ } Ċ Ċ /** Ċ Ġ* ĠUn sub scri bes Ġsome Ġ[ receiver Object ] Ġfrom Ġreceiving Ġany Ġevents Ġand Ġremoves Ċ Ġ* Ġit 's Ġsubscriptions Ġfrom Ġthe Ġregistry Ġof Ġshared Ġinstance Ġof Ġ[ Communication Bus ] Ċ Ġ* Ċ Ġ* Ġ@ author ĠC rist ian ĠV elin ci uc Ċ Ġ*/ Ċ fun ĠAny . dismiss () Ġ{ ĊĠ ĠCom Bus . dismiss ( this ) Ċ } Ċ Ċ /** Ċ Ġ* ĠEmit s Ġthe Ġgiven Ġ[ event Object ] Ġto Ġall Ġthe Ġavailable Ġlisteners Ġavailable Ġin Ġthe Ċ Ġ* Ġregistry Ġof Ġthe Ġshared Ġinstance Ġof Ġ[ Communication Bus ] Ċ Ġ* Ċ Ġ* Ġ@ author ĠC rist ian ĠV elin ci uc Ċ Ġ* Ċ Ġ* Ġ@ param Ġevent Object Ġan Ġinstance Ġof Ġsome Ġ[ T ] Ġclass Ġthat Ġsome Ġlistener Ġis Ġpotentially Ġexpecting Ġto Ġreceive Ċ Ġ*/ Ċ fun Ġ< T : ĠAny > Ġpost ( event Object : ĠT ) Ġ{ ĊĠ ĠCom Bus . post ( event Object ) Ċ } Ċ