implementation.H

00001 /*
00002  * This file is part of the "Archon" framework.
00003  * (http://files3d.sourceforge.net)
00004  *
00005  * Copyright © 2006 by Kristian Spangsege and Brian Kristiansen.
00006  *
00007  * Permission to use, copy, modify, and distribute this software and
00008  * its documentation under the terms of the GNU General Public License is
00009  * hereby granted. No representations are made about the suitability of
00010  * this software for any purpose. It is provided "as is" without express
00011  * or implied warranty. See the GNU General Public License
00012  * (http://www.gnu.org/copyleft/gpl.html) for more details.
00013  *
00014  * The characters in this file are ISO8859-1 encoded.
00015  *
00016  * The documentation in this file is in "Doxygen" style
00017  * (http://www.doxygen.org).
00018  */
00019 
00020 #ifndef ARCHON_DISPLAY_IMPLEMENTATION_H
00021 #define ARCHON_DISPLAY_IMPLEMENTATION_H
00022 
00023 #include <stdexcept>
00024 #include <string>
00025 
00026 #include <archon/util/exception.H>
00027 #include <archon/util/ref.H>
00028 #include <archon/display/connection.H>
00029 
00030 namespace Archon
00031 {
00054   namespace Display
00055   {
00056     using namespace std;
00057     using namespace Utilities;
00058 
00059     // Fallback declarations. A fallback declaration for class Foo is
00060     // needed when the header that defines Foo includes this
00061     // header. In this case this header will not include "foo.H" due
00062     // to include guards, and Foo would be unknown.
00063     struct Connection;
00064 
00065 
00069     struct NoImplementationException: virtual Exception
00070     {
00071       NoImplementationException(string l): Exception(l) {}
00072     };
00073 
00080     struct NoDisplayException: virtual Exception
00081     {
00082       NoDisplayException(string l): Exception(l) {}
00083       NoDisplayException(string l, string m): Exception(l, m) {}
00084     };
00085 
00086 
00087     struct Implementation: virtual RefObjectBase
00088     {
00096       virtual string getMnemonic() = 0;
00097 
00112       virtual Ref<Connection> newConnection() throw(NoDisplayException) = 0;
00113     };
00114 
00115 
00126     Ref<Implementation> getDefaultImplementation() throw(NoImplementationException);
00127 
00135     int getNumberOfImplementations();
00136 
00146     Ref<Implementation> getImplementation(int index) throw(out_of_range);
00147   }
00148 }
00149 
00150 #endif // ARCHON_DISPLAY_IMPLEMENTATION_H

Generated on Sun Jul 30 22:55:42 2006 for Archon by  doxygen 1.4.4