interface.h

Go to the documentation of this file.
00001 /* Tronc commun.
00002  *
00003  * PegSoft modules subsystem library (c) 2005 PegSoft
00004  * Contact us at pegsoft@pegsoft.net
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License version 2 as
00008  * published by the Free Software Foundation.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this software (the COPYING file); if not, write to the
00017  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
00018  * USA.
00019  *
00020  */
00021 
00027 #ifndef MODULES_INTERFACE_H
00028 #define MODULES_INTERFACE_H
00029 
00030 /*************************************************************************/
00031 
00032 namespace modules
00033 {
00034 
00035 /*************************************************************************/
00036 
00038 typedef uint32_t PSIID;
00039 
00040 /*************************************************************************/
00041 
00043 
00055 class Interface
00056 {
00057     public:
00059         static PSIID const IID = 0x4227894c;
00060     
00062         virtual ~Interface() { }
00063 };
00064 
00065 /*************************************************************************/
00066 
00068 
00072 class ErrorInterface : public Interface
00073 {
00074     public:
00076         static PSIID const IID = 0x42e694d6;
00077         
00079         static size_t const error_len = 1024;
00080         
00082         ErrorInterface() : Interface() { m_error[0] = '\0'; }
00084         ErrorInterface(ErrorInterface const &ei) : Interface(ei)
00085                 { m_error[0] = '\0'; }
00087         virtual ErrorInterface &operator=(ErrorInterface const &right);
00088         
00090         char const *error() const { return m_error; }
00091     protected:
00093         char m_error[error_len];
00094         
00096         void errorf(char const *format, ...) FORMAT(printf,2,3);
00097 };
00098 
00099 /*************************************************************************/
00100 
00101 } /* namespace modules */
00102 
00103 /*************************************************************************/
00104 
00105 #endif /* MODULES_INTERFACE_H */

Generated on Sun May 20 21:32:14 2007 for Epona API by  doxygen 1.4.6