
#include <iostream>
using namespace std;

#include <visitbase.h>
#include <visitdataA.h>
#include <visitdataB.h>
#include <visitprint.h>
#include <visitdataC.h>


void test03()
{
  visitbase *pA = new visitdataA(13);
  visitbase *pB = new visitdataB("cat");

  visitbase *f = new visitprint();

  cout << "Try A(print)" << endl;
  (*pA)(f);
  cout << "Now try the reverse print(A)" << endl;
  (*f)(pA);
  
  cout << "Try B(print)" << endl;
  (*pB)(f);
  cout << "Now try the reverse print(B)" << endl;
  (*f)(pB);
  
  cout << endl;
  cout << "Now a new data member C is implemented" << endl;
  cout << "It has to work with the exiting print operator" << endl;

  visitbase *pC = new visitdataC(1,3);
  cout << "Try matching a print and a C with print(C)" << endl;
  (*f)(pC);

}


int main(int argc, char** argv)
{
  test03();


  return 0;
}


