SourceForge Project Site
Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

FSMObject.h

Go to the documentation of this file.
00001 #if !defined(AFX_FSMOBJECT_H__4F9C75B5_BAD4_42EF_83C4_B8819F85CD2E__INCLUDED_)
00002 #define AFX_FSMOBJECT_H__4F9C75B5_BAD4_42EF_83C4_B8819F85CD2E__INCLUDED_
00003 
00004 #if _MSC_VER > 1000
00005 #pragma once
00006 #endif // _MSC_VER > 1000
00007 
00008 /*
00009  * The Finite State Machine (FSM) Library
00010  * Copyright (C) 2002 Siemens C-LAB Paderborn
00011  * All rights reserved.
00012  *
00013  * This program is  free  software;  you can redistribute it and/or modify it
00014  * under the terms of the  GNU Lesser General Public License  as published by 
00015  * the  Free Software Foundation;  either version 2.1 of the License,  or (at 
00016  * your option) any later version.
00017  *
00018  * This  program  is  distributed in  the  hope that it will  be useful,  but
00019  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00020  * or  FITNESS FOR A  PARTICULAR PURPOSE.  See the  GNU Lesser General Public  
00021  * License for more details.
00022  *
00023  * You should  have received  a copy of the GNU Lesser General Public License
00024  * along with  this program;  if not, write to the  Free Software Foundation,
00025  * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
00026  */
00027 
00028 // $Log: FSMObject.h,v $
00029 // Revision 1.4  2002/08/20 14:48:41  vofka
00030 // FiniteStateMachine-config.h removed from installing. Loading exported to the loader class. Saver introduced. Error codes exported to FSMErrorCodes.
00031 //
00032 // Revision 1.3  2002/08/13 11:06:32  vofka
00033 // automake support added
00034 //
00035 // Revision 1.2  2002/07/22 17:20:59  vofka
00036 // SimpleTransition, PushTransition, PopTransition added, not implemented yet
00037 //
00038 // Revision 1.1  2002/06/28 11:10:36  vofka
00039 // first time on sourceforge.net cvs
00040 //
00041 // Revision 1.4  2002/06/20 12:22:10  bobka
00042 // LGPL license
00043 //
00044 // Revision 1.3  2001/11/28 15:42:00  bobka
00045 // a lot of changes
00046 //
00047 // Revision 1.2  2001/11/23 09:27:57  bobka
00048 // Load/Save funktioniert.
00049 // FSM* im Fileformat entfernt.
00050 // streams entfernt.
00051 // Laeuft unter Win32 und unter WinCE (WinCE_STL Modul auschecken)
00052 // static library unter WinCE funktioniert nicht, nur DLL.
00053 //
00054 // Revision 1.1  2001/11/15 10:37:32  bobka
00055 // initial checkin
00056 // not tested on linux!
00057 //
00058 
00059 #include <string>
00060 
00062 namespace FSM {
00063         using std::string;
00064 
00065 
00066 class CFiniteStateMachine;
00067 class CFSMSaver;
00068 
00069 
00070 class CFSMObject  
00071 {
00072                 friend class CFiniteStateMachine;
00073                 friend class CFSMSaver;
00074 
00075         public:
00076 
00077                 // Every Object knows his FSM
00078                 CFiniteStateMachine *GetFSM() const;
00079 
00084                 const char*     GetNameOfClass() const; // GetClassName confuses VC.Net
00085 
00086                 // Overloadable
00087                 virtual bool SetParameter(const char* paramName, const char* paramValue);
00088 
00089         protected:
00090                 // services for derived
00091                 void SetFSM(CFiniteStateMachine *ptr);
00092                 void SetClassName(const char *name);
00093 
00094                 // overloadables
00095                 
00100                 virtual bool SaveParameters(CFSMSaver* out) const;
00101                 
00110                 virtual void DeleteThis() =0;
00111                 
00112                 CFSMObject();
00113                 virtual ~CFSMObject();
00114         private:
00115 
00116                 // Identify Classname
00117                 string ClassName;
00118 
00119                 // Pointer to my Statemachine
00120                 CFiniteStateMachine *myStateMachine;
00121 };
00122 
00123 }; // namespace FSM
00124 
00125 #endif // !defined(AFX_FSMOBJECT_H__4F9C75B5_BAD4_42EF_83C4_B8819F85CD2E__INCLUDED_)

© 2002 by C-LAB
generated by doxygen