libGizmod/Processes.hpp

Go to the documentation of this file.
00001 
00012 /*
00013   
00014   Copyright (c) 2007, Tim Burrell
00015   Licensed under the Apache License, Version 2.0 (the "License");
00016   you may not use this file except in compliance with the License.
00017   You may obtain a copy of the License at 
00018 
00019         http://www.apache.org/licenses/LICENSE-2.0
00020 
00021   Unless required by applicable law or agreed to in writing, software
00022   distributed under the License is distributed on an "AS IS" BASIS,
00023   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00024   See the License for the specific language governing permissions and 
00025   limitations under the License. 
00026   
00027 */
00028 
00029 #ifndef __Processes_h
00030 #define __Processes_h
00031 
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035 
00036 #include <string>
00037 #include <map>
00038 #include <boost/shared_ptr.hpp>
00039 #include <boost/thread/mutex.hpp>
00040 
00042 // Namespace
00044 
00045 namespace Gizmod {
00046 
00048 // Process Class Definition
00050 
00055 class Process {
00056 public:
00057         // public member variables
00058         std::string                     Name;                           
00059         unsigned int                    PID;                            
00060         std::string                     State;                          
00061         
00062         // public functions
00063 
00064         // construction / deconstruction
00065         Process();                                                      
00066         virtual ~Process();                                             
00067         
00068 private:
00069         // private functions
00070         
00071         // private member variables
00072 };
00073         
00075 // Processes Class Definition
00077 
00082 class Processes {
00083 public:
00084         // public functions
00085 
00086         // construction / deconstruction
00087         Processes();                                                    
00088         virtual ~Processes();                                           
00089         
00090         // public static functions
00091         static int              isProcessRunning(std::string ProcessName); 
00092         static void             setTimeBetweenUpdates(float Seconds);   
00093         static void             updateProcessTree();                    
00094 
00095 private:
00096         // private functions
00097         
00098         // private member variables
00099         static unsigned long    mLastUpdateTime;                        
00100         static unsigned long    mMsBetweenUpdates;                      
00101         static boost::mutex     mMutexUpdate;                           
00102         static std::map< std::string, boost::shared_ptr<Process> > mProcesses;  
00103 };
00104 
00106 
00107 } // Gizmod namespace
00108 
00109 #endif // __Processes_h

Generated on Wed Nov 7 10:04:16 2007 for gizmod by  doxygen 1.5.3