title: Trigger added methods of derived class by method in base class
body: <p>I want to implement a simple test structure. Here is how I created base class and derived class.</p>
  <p><em>testBase.h:</em></p>
  <pre><code>class TestBase {
  public:
      TestBase() {}
      virtual void TestStart() = 0;
      virtual void TestEnd() = 0;
      void RunTest() {  
          // I need code here to trigger a chain of calls
      }
  };
  </code></pre>
  <p><em>classifierTest.h:</em></p>
  <pre><code>#include &quot;testBase.h&quot;
  
  class ClassifierTest: public TestBase
  {
  public:
      ClassifierTest() {
      
      }
      void TestStart();
      void TestEnd();
  
      void Test1();
      void Test2();
      void Test3();
  };
  </code></pre>
  <p><em>classifierTest.cpp:</em></p>
  <pre><code>#include &quot;classifierTest.h&quot;
  
  void ClassifierTest::TestStart() {
  
  }
  
  void ClassifierTest::TestEnd() {
  
  }
  
  void ClassifierTest::Test1(){
  
  }
  
  void ClassifierTest::Test2(){
  
  }
  
  void ClassifierTest::Test3(){
  
  }
  </code></pre>
  <p><em>main function:</em></p>
  <pre><code>ClassifierTest *classifierTest = new ClassifierTest();
  classifierTest-&gt;RunTest();
  </code></pre>
  <p>Suppose <code>Test1()</code>, <code>Test2()</code> and <code>Test3()</code> are my test methods, and <strong>I may add more tests here in future</strong>.
  My goal is that when I call <code>RunTest()</code> in the main function, then these test methods are called one by one, after <code>TestStart()</code>, and before <code>TestEnd()</code>.</p>
  <p>so they would run like:</p>
  <ul>
  <li><code>TestStart()</code></li>
  <li><code>Test1()</code></li>
  <li><code>TestEnd()</code></li>
  <li><code>TestStart()</code></li>
  <li><code>Test2()</code></li>
  <li><code>TestEnd()</code></li>
  <li><code>TestStart()</code></li>
  <li><code>Test3()</code></li>
  <li><code>TestEnd()</code></li>
  </ul>
  <p>I don't want to specifically add test method in the base class. But the question is how to trigger these chain of calls from RunTest(). So the base trigger methods that it doesn't know about them.</p>
  <p>I believe it should be sth like reflection in .net?</p>