Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Plugin system

Name: Anonymous 2005-07-31 22:10

How would you write a plugin system for an image-processing application where one plugin is "dependant" on another plugin? For example I have an histogram plugin who has to call the grayscale plugin before showing the histogram. I could hard-code the grayscale function but it's ugly and I would have to do the same for a lot of other plugins.

I'm writing this in Qt (Trolltech) and C++, and I use the QLibrary object (not that it really matters...)

Name: Anonymous 2005-08-03 22:29

Trees are a recursive structure after all.

Fair enough, I won't argue that. The problem itself may not be a tree, however, so recursive isn't a wonderful fit either. That's why you also need hackery with recursion to ensure you haven't visited the same node twice. I mentioned shoving a tree on a queue because recursion naturally fits best on a tree or list, so I'm showing the two approaches are similar.

Depth-first instead of breadth-first.  That's all there is to it.

The pseudocode in >>8 is depth-first. Don't believe me? Draw it out. Nor did >>12 specify what type of searching he was doing, so it's fair to assume it's also depth-first. Where'd you get the breadth-first from? Take your own advice and think.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List