evilMain.cpp

Go to the documentation of this file.
00001 
00002 // The client just includes the basic *.hpp forms without having the worry
00003 // about implicit or explicit instantiation!
00004 #include "EvilBase.hpp"
00005 #include "AEvil.hpp"
00006 #include "BEvil.hpp"
00007 
00008 
00009 template<class T>
00010 void testEvil(const T& obj)
00011 {
00012 
00013   using Teuchos::RCP;
00014   using Teuchos::rcp_dynamic_cast;
00015   using EvilPack::EvilBase;
00016   using EvilPack::AEvil;
00017   using EvilPack::BEvil;
00018 
00019   RCP<AEvil<T> > aEvil = 
00020     rcp_dynamic_cast<AEvil<T> >(EvilBase<T>::createEvil("AEvil"));
00021   RCP<BEvil<T> > bEvil =
00022     rcp_dynamic_cast<BEvil<T> >(EvilBase<T>::createEvil("BEvil"));
00023 
00024   aEvil->soundOff(obj);
00025   bEvil->soundOff(obj);
00026   aEvil->callBEvil(*bEvil, obj);
00027   bEvil->callAEvil(*aEvil, obj);
00028 
00029 }
00030 
00031 
00032 int main()
00033 {
00034   testEvil<double>(1.0);
00035   testEvil<int>(2);
00036   return 0;
00037 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Tue Oct 20 10:13:59 2009 for Teuchos Package Browser (Single Doxygen Collection) by  doxygen 1.6.1