From 3c7e81d3baba06cb1bf37de84aeaa6cad277652a Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 6 Jan 2010 17:05:45 +0000 Subject: Wow, ok, well, I added some more error handling, that's positive, also switched conditions and functions to a plugger system like views, and all of them now load builtin and external plugins flawlessly. It's actually a lot of fun. I also added the example/test plugin condition "random" it randomly builds targets...it's not really useful... --- src/plugins/pluginConditionRandom.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/plugins/pluginConditionRandom.cpp (limited to 'src/plugins') diff --git a/src/plugins/pluginConditionRandom.cpp b/src/plugins/pluginConditionRandom.cpp new file mode 100644 index 0000000..42a4e00 --- /dev/null +++ b/src/plugins/pluginConditionRandom.cpp @@ -0,0 +1,31 @@ +#include "condition.h" +#include + +class ConditionRandom : public Condition +{ +public: + ConditionRandom() + { + } + + virtual ~ConditionRandom() + { + } + + virtual bool shouldExec( class Runner &, class Target & ) + { + if( (random()/(double)RAND_MAX) >= .5 ) + return true; + return false; + } + + virtual Condition *clone() + { + return new ConditionRandom(); + } +}; + +#include +PluginInterface3( pluginConditionRandom, random, ConditionRandom, Condition, + "Mike Buland", 0, 1 ); + -- cgit v1.2.3