Gizmo3D

gzService.h

Go to the documentation of this file.
00001 //******************************************************************************
00002 // File         : gzService.h
00003 // Module       : gzBase
00004 // Description  : Class definition of service features
00005 // Author       : Anders Modén      
00006 // Product      : GizmoBase 2.1.1
00007 //      
00008 // Copyright © 2003- Saab Training Systems AB, Sweden
00009 //          
00010 // NOTE:    GizmoBase is a platform abstraction utility layer for C++. It contains 
00011 //          design patterns and C++ solutions for the advanced programmer.
00012 //
00013 //
00014 // Revision History...                          
00015 //                                  
00016 // Who  Date    Description                     
00017 //                                  
00018 // AMO  041104  Created file    
00019 //
00020 //******************************************************************************
00021 #ifndef __GZ_SERVICE_H__
00022 #define __GZ_SERVICE_H__
00023 
00024 #include "gzBase.h"
00025 #include "gzLex.h"
00026 
00027 enum gzServiceStatus
00028 {
00029     GZ_SERVICE_STOPPED,
00030     GZ_SERVICE_PAUSED_RUNNING,
00031     GZ_SERVICE_RUNNING
00032 };
00033 
00034 //******************************************************************************
00035 // Class    : gzService
00036 //                                  
00037 // Purpose  : Service management
00038 //                                  
00039 // Notes    : - 
00040 //                                  
00041 // Revision History...                          
00042 //                                  
00043 // Who  Date    Description                     
00044 //                                  
00045 // AMO  041104  Created 
00046 //                                  
00047 //******************************************************************************
00048 class gzService 
00049 {
00050 public:
00051 
00052     GZ_BASE_EXPORT gzService(const gzString &name,const gzString &comment=GZ_EMPTY_STRING);
00053     GZ_BASE_EXPORT virtual ~gzService();
00054 
00055     GZ_BASE_EXPORT gzBool registerService(gzBool autostart=TRUE);
00056     GZ_BASE_EXPORT gzBool unregisterService();
00057 
00058     GZ_BASE_EXPORT gzBool exec(int argc, char *argv[]);
00059 
00060     GZ_BASE_EXPORT gzBool   startService();
00061     GZ_BASE_EXPORT gzBool   stopService();
00062     GZ_BASE_EXPORT gzBool   pauseService();
00063     GZ_BASE_EXPORT gzBool   continueService();
00064 
00065     GZ_BASE_EXPORT virtual gzVoid process(const gzArgumentParser &args,gzBool runAsService)=0;
00066 
00067     GZ_BASE_EXPORT gzBool   isRunning();
00068     GZ_BASE_EXPORT gzBool   isPaused();
00069     GZ_BASE_EXPORT gzBool   isRegistered();
00070 
00071     GZ_BASE_EXPORT gzVoid   setStatus(gzServiceStatus status);
00072 
00073     GZ_BASE_EXPORT const gzString &         getName();
00074     GZ_BASE_EXPORT const gzString &         getComment();
00075     GZ_BASE_EXPORT const gzArgumentParser & getArguments();
00076 
00077 
00078     // virtual callbacks
00079 
00080     GZ_BASE_EXPORT virtual gzVoid   onStop(){};
00081     GZ_BASE_EXPORT virtual gzVoid   onPause(){};
00082     GZ_BASE_EXPORT virtual gzVoid   onContinue(){};
00083 
00084 
00085 private:
00086 
00087     gzVoid runProcess();
00088 
00089     gzArgumentParser        m_args;
00090 
00091     gzString                m_name;
00092 
00093     gzString                m_comment;
00094 
00095     gzServiceStatus         m_status;
00096 };
00097 
00098 #endif //__GZ_SERVICE_H__

Documentation for Gizmo3D generated at Wed Feb 20 11:54:09 2008 by   Saab Training Systems AB, ¸ (c) 2003-and beyond