1 //**************************************************************************************************
2 //                                           CmdBase.hpp                                           *
3 //                                          -------------                                          *
4 // Description : This is the base class for all command classes. It has some characteristics of    *
5 //               structure in that some attributes have public access; this simplifies the class   *
6 //               interface.                                                                        *
7 // Started     : 2006-08-31                                                                        *
8 // Last Update : 2015-03-19                                                                        *
9 // Copyright   : (C) 2006 by MSWaters                                                              *
10 //**************************************************************************************************
11 
12 //**************************************************************************************************
13 //                                                                                                 *
14 //      This program is free software; you can redistribute it and/or modify it under the          *
15 //      terms of the GNU General Public License as published by the Free Software Foundation;      *
16 //      either version 3 of the License, or (at your option) any later version.                    *
17 //                                                                                                 *
18 //**************************************************************************************************
19 
20 #ifndef CMDBASE_HPP
21 #define CMDBASE_HPP
22 
23 // Application Includes
24 
25 #include "TypeDefs.hpp"
26 
27 //**************************************************************************************************
28 
29 class CmdBase : public wxString
30 {
31   protected :
32 
33     eTypeSimEng  m_eSimEng;
34     eTypeCmd     m_eCmdType;
35 
36     wxString     m_osErrMsg;
37 
38     virtual  bool  bValidate( void );
39 
40   public :
41 
42                    CmdBase( void );
43     virtual       ~CmdBase( );
44 
45     virtual  bool  bSetDefaults( void );
bIsValid(void)46              bool  bIsValid    ( void )             { return( m_osErrMsg.IsEmpty( ) ); }
47 
48     virtual  bool  bParse ( void ) = 0;
49     virtual  bool  bFormat( void ) = 0;
50 
51              bool  bSetString( wxString & ros );
52 
eGetSimEng(void)53                    eTypeSimEng  eGetSimEng ( void ) { return( m_eSimEng  ); }
eGetCmdType(void)54                    eTypeCmd     eGetCmdType( void ) { return( m_eCmdType ); }
rosGetErrMsg(void)55              const wxString & rosGetErrMsg ( void ) { return( m_osErrMsg ); }
56 
SetErrMsg(const wxString & rosErrMsg)57              void  SetErrMsg( const wxString & rosErrMsg )
58                                                     { if( bIsValid( ) ) m_osErrMsg = rosErrMsg; }
59 
60     virtual  CmdBase & operator = ( const CmdBase & roCmd  );
61 
62     virtual  void  Print( const wxString & rosPrefix=wxT("") );
63 };
64 
65 //**************************************************************************************************
66 
67 #endif // CMDBASE_HPP
68