cpp_photon/include/Application.hpp

77 lines
1.7 KiB
C++
Raw Normal View History

2005-02-07 02:00:48 +00:00
//This file is part of Photon (http://photon.sourceforge.net)
//Copyright (C) 2004-2005 James Turk
//
// Author:
// James Turk (jpt2433@rit.edu)
//
// Version:
2005-07-19 01:31:37 +00:00
// $Id: Application.hpp,v 1.9 2005/07/19 01:31:37 cozman Exp $
2005-02-07 02:00:48 +00:00
2005-02-13 22:12:02 +00:00
#ifndef PHOTON_APPLICATION_HPP
#define PHOTON_APPLICATION_HPP
2005-02-07 02:00:48 +00:00
#include <vector>
#include <string>
2005-03-01 07:51:04 +00:00
#include <boost/utility.hpp>
2005-02-13 22:12:02 +00:00
#include "types.hpp"
#include "util/VersionInfo.hpp"
2005-03-15 19:21:51 +00:00
#include "Task.hpp"
2005-02-13 22:12:02 +00:00
2005-02-07 02:00:48 +00:00
namespace photon
{
// Class: Application
2005-07-19 01:31:37 +00:00
// Abstract main class, all photon applications should derive from Application.
2005-02-27 07:43:37 +00:00
//
2005-02-07 02:00:48 +00:00
// Derived classes are made entrypoint via <ENTRYPOINT>.
2005-03-15 19:21:51 +00:00
class Application
2005-02-07 02:00:48 +00:00
{
2005-03-15 19:21:51 +00:00
// Group: (Con/De)structors
2005-02-07 02:00:48 +00:00
public:
// Function: Application
// Default constructor, initializes the internal state & dependencies.
2005-02-16 04:26:22 +00:00
Application();
2005-02-07 02:00:48 +00:00
// Function: ~Application
// Default destructor, shuts down dependencies.
virtual ~Application();
2005-03-15 19:21:51 +00:00
// Group: Main
public:
2005-02-07 02:00:48 +00:00
// Function: main
// Pure virtual, must be defined by derived class, using some preprocessor
// magic (<MAINCLASS>) on the derived class
2005-07-19 01:31:37 +00:00
// this becomes the entry point for a Photon application.
2005-02-07 02:00:48 +00:00
//
// Parameters:
// args - <ArgList> containing arguments passed to program.
//
// Returns: 0 upon success, other upon failure.
// (Same as main in Standard C/C++).
//
// See Also:
// <ENTRYPOINT>
2005-03-15 19:21:51 +00:00
virtual int main(const StrVec& args)=0;
2005-02-27 07:43:37 +00:00
2005-03-15 19:21:51 +00:00
// behind the scenes
2005-03-01 07:51:04 +00:00
public:
2005-03-15 19:21:51 +00:00
static void setInitOptions(const char* arg0);
2005-02-13 22:12:02 +00:00
// Group: API Initialization
private:
2005-05-15 02:50:52 +00:00
util::VersionInfo initPhysFS();
2005-02-27 07:43:37 +00:00
2005-02-13 22:12:02 +00:00
private:
2005-03-01 07:51:04 +00:00
// version number for photon
2005-02-16 04:26:22 +00:00
util::VersionInfo photonVer_;
2005-02-27 07:43:37 +00:00
2005-02-16 04:26:22 +00:00
static std::string arg0_;
2005-02-07 02:00:48 +00:00
};
}
2005-02-13 22:12:02 +00:00
#endif //PHOTON_APPLICATION_HPP