[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-multimedia
Subject: More MSOP stuff: dynamic casting and aliasing
From: Nicolas Brodu <nicolas.brodu () free ! fr>
Date: 2000-05-14 19:44:13
[Download RAW message or body]
Hi all,
I've also written dynamic casting and aliasing this WE. What it is:
Dynamic casting:
Suppose you have interface A : B {};
You can write
B b;
A a = b; // True as for standard C++ pointers
But now if you do
Object o = a;
You know that the object is a B, but cannot assign it to a B variable.
Now you can, by writing: B bb = DynamicCast(o);
If the cast wasn't possible, bb.isNull() will be true.
Aliasing:
This is very similar in functionalities to Stefan virtual ports, in the sense
that it provides masquarading and dynamic composition. Since Stefan complained
in the TODO about the virtual ports, I felt free to write something different.
Example: You have some effect filters, and would like to group-chain them and
treat the result as a single filter object. It is now possible. Supposing all
Effects have an "input" and an "output" port:
Effect e, f, g;
connect(e,f);
connect(f,g); // That makes the chain of effect
Object group;
alias(group,"input",e,"input"); // this create a port name "input" in group
alias(group,"gout",g,"output"); // and another named "gout" (for a change)
Now if you have
DataProducer d;
Player p;
You can do
connect(d,group,"input"); // In fact connect d to e
connect(group,"gout",p); // and g to p
group has become a single object that calls in fact the 3 others, transparently.
You'll find all this here again:
http://nicolas.brodu.free.fr/arts.tar.bz2
That's all, folks!
Nicolas
--
A shortcut is the longest distance between two points. (unknown author)
_______________________________________________
Kde-multimedia mailing list
Kde-multimedia@master.kde.org
http://master.kde.org/mailman/listinfo/kde-multimedia
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic