[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Messaging system



Hi,

Just some notes from me...

>Their concern was that message receivers had to inherit from the class
>ppMessageReceiver, or something
>like that.  The writer pointed to a document discussing this issue.

[...]
>The requirement that a receiver derive from ppMessageReceiver is due to
>an added
>feature we have,  that is, when a receiver is destroyed, the connection
>between it and the
>sender is automatically destroyed.
>
>If we went without this feature we could get some lovely flexibilty.
>Any member of any C++
>class, or even just straight C functions could be used as message
>receivers without having to be
>modified or wrapped.   It would not be  difficult to add this
>functionality to the existing system
>anyway,  the question is whether it is worth it.

Actually we already can connect to plain C functions (have a look at the
ppConnectToFunction calls). For standalone functions the mechanism
described above isnīt implemented, because functions usually are
not dynamically allocated ;)

So the ppMessageReceiver problem is only present if we have methods
as target. And this only poses a problem if the receiving object is part of some
code that may not be modified. This should be really (!!) uncommon.

If someone wants to have some non-PPlay class as receiver in his own 
program she just had to inherit her own version from ppMessageReceiver
- that usually doesnīt matter.

I think the added comfort (and robustness!!) of the current version is worth
the little inconvenience (As long as we donīt know a really better solution ;).

Cu
	Christian

PS: Currently the system has some problems concerning handlers with return
types (it simply discards all return values and returns some undefined value).
Iīm currently developing a fix for this thogether with the original author. Expect it
to be incorporated soon.