Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » NEW: Dispatcher (templateable dispatcher helper for MVC pattern and more)
NEW: Dispatcher (templateable dispatcher helper for MVC pattern and more) [message #27267] Fri, 09 July 2010 13:24 Go to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
hi guys,

introducing here is the Dispatcher class, a templateable dispatcher with easy / simple / small interface (it a dispatcher, period).
template <class T>
class Dispatcher;


imagine cases where you need to pass object of information around, and have multiple destinations, maybe spread on various sheets of GUI, use Dispatcher to link them together and to forward stuff.

a class can have multiple
class MyCtrl
 : EditInt
 , public Dispatchable<Value>
 , public Dispatchable<int>

interfaces, needs to implement a
virtual void Dispatch(const T & o, unsigned param);

while param is just forwarded, Dispatcher does not care about it.

so the Dispatcher has got the same interface and just calls the same thing on each and every registered recepient.

it can use VectorMap internally, to help you access your stuff.

there is also a
class DispatcherGen;

a generic dispatcher, that can accept all types of Dispatchable<T> and dispatches only to supported instances.. it makes use of Any<> functionality, a genious class in Upp, just like One<> (not used here:)

the contained test applications demonstarete the use. there is not much to add as of documentations, it's a simple small class.

maybe you like it and add it to Bazaar.
cheers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: LED Ctrl (for characters and numbers)
Next Topic: Single Threaded RS232
Goto Forum:
  


Current Time: Mon Apr 29 16:07:21 CEST 2024

Total time taken to generate the page: 0.02104 seconds