libmoost
/home/mhx/git/github/libmoost/test/pdl/test_class_4.cpp
Go to the documentation of this file.
00001 /* vim:set ts=3 sw=3 sts=3 et: */
00028 #include <iostream>
00029 
00030 #include <boost/lexical_cast.hpp>
00031 #include <boost/thread.hpp>
00032 
00033 #include "test_class_4.h"
00034 
00035 extern "C" void pdl_test_c4_load();
00036 extern "C" void pdl_test_c4_unload();
00037 extern "C" void pdl_test_c4_ctor();
00038 extern "C" void pdl_test_c4_dtor();
00039 
00040 namespace
00041 {
00042    struct watcher
00043    {
00044       watcher() { pdl_test_c4_load(); }
00045       ~watcher() { pdl_test_c4_unload(); }
00046    };
00047 
00048    watcher w;
00049 }
00050 
00051 my_test_class::my_test_class()
00052 {
00053    pdl_test_c4_ctor();
00054 }
00055 
00056 my_test_class::~my_test_class()
00057 {
00058    pdl_test_c4_dtor();
00059 }
00060 
00061 int my_test_class::do_it()
00062 {
00063    boost::this_thread::sleep(boost::posix_time::microseconds(200));
00064    return 0;
00065 }
00066 
00067 PDL_EXPORT_DYNAMIC_CLASS(my_test_class)