///////////////////////////////////////////////////////////// // Component.cpp - Demonstrate Component // // - Implements interface // // - Defines object factory // // - built as DLL // // // // Jim Fawcett, CSE775 - Distributed Objects, Spring 2015 // ///////////////////////////////////////////////////////////// /* * This component pretends to be a test driver */ #define TEST_EXPORTS // must define before including ITest.h #include "ITest.h" #include class TestDriver : public ITest { public: TestDriver(void); virtual ~TestDriver(void); virtual bool test(); // inherits static creational function }; TestDriver::TestDriver(void) { AddRef(); std::cout << "\n creating TestDriver instance"; } TestDriver::~TestDriver(void) { std::cout << "\n destroying TestDriver instance"; } ITest* ITest::createTest() { return new TestDriver; } TEST_API ITest* globalCreateTest() { return new TestDriver; } bool TestDriver::test() { // put calls into tested code here // and return pass status not the // automatic succeed below return true; }