base_application.h

Go to the documentation of this file.
00001 #ifndef BASE_APPLICATION_CLASS
00002 #define BASE_APPLICATION_CLASS
00003 
00005 // Name   : base_application
00006 // Author : Chris Koeritz
00008 // Copyright (c) 2000-$now By Author.  This program is free software; you can
00009 // redistribute it and/or modify it under the terms of the GNU General Public
00010 // License as published by the Free Software Foundation:
00011 //     http://www.gnu.org/licenses/gpl.html
00012 // or under the terms of the GNU Library license:
00013 //     http://www.gnu.org/licenses/lgpl.html
00014 // at your preference.  Those licenses describe your legal rights to this
00015 // software, and no other rights or warranties apply.
00016 // Please send updates for this code to: fred@gruntose.com -- Thanks, fred.
00018 
00019 #include <basis/contracts.h>
00020 #include <loggers/logging_macros.h>
00021 
00022 namespace application {
00023 
00025 
00031 class base_application : public virtual basis::nameable
00032 {
00033 public:
00034   virtual const char *class_name() const = 0;  // must be provided by implementor.
00035 
00036   virtual int execute() = 0;
00038 
00040 };
00041 
00043 
00044 #if 0
00045 
00047 class example_application : public base_application
00048 {
00049 public:
00050   example_application() : base_application() {}
00051   DEFINE_CLASS_NAME("example_application");
00052   int execute() { /* do stuff and return final exit value. */ }
00053 };
00054 
00056 int __example__main(int argc, char *argv[])
00057 {
00058   example_application root_program;
00059   return root_program.execute();
00060 }
00061 
00062 #endif // example guard.
00063 
00064 } //namespace.
00065 
00066 #endif // outer guard.
00067 
Generated on Sat Jan 28 04:22:04 2012 for hoople2 project by  doxygen 1.6.3