libGizmod/GizmoEventCPUUsage.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 __GizmoEventCPUUsage_h
00030 #define __GizmoEventCPUUsage_h
00031 
00032 #if HAVE_CONFIG_H
00033 #include "config.h"
00034 #endif
00035 
00036 #include "GizmoEvent.hpp"
00037 #include "CPUUsage.hpp"
00038 #include <vector>
00039 #include <boost/shared_ptr.hpp>
00040 #include <boost/archive/text_oarchive.hpp>
00041 #include <boost/archive/text_iarchive.hpp>
00042 #include <boost/serialization/base_object.hpp>
00043 #include <boost/serialization/vector.hpp>
00044 #include <boost/serialization/shared_ptr.hpp>
00045 
00047 // Namespace
00049 
00050 namespace Gizmod {
00051 
00053 // Typedef, enum's
00055         
00057 // Class Definition
00059 
00066 class GizmoEventCPUUsage : public GizmoEvent {
00067 public:
00068         // public functions
00069         double                          getCPUUsage(size_t CPUIndex) const;     
00070         double                          getCPUUsageAvg(size_t CPUIndex) const;  
00071         size_t                          getNumCPUs() const;                     
00072         
00073         // construction / deconstruction
00074         GizmoEventCPUUsage();                                                   
00075         GizmoEventCPUUsage(std::vector< boost::shared_ptr<CPUUsageInfo> > const & Event, bool IsRemote = false); 
00076         virtual ~GizmoEventCPUUsage();                                          
00077 
00078 protected:
00079         // private functions
00080         
00081         // private member variables
00082         std::vector< boost::shared_ptr<CPUUsageInfo> > mEvent;                  
00083         
00084 private: 
00085         // serialization
00086         friend class boost::serialization::access;
00087         template<class Archive>
00088         void serialize(Archive & ar, const unsigned int version) {
00089                 ar & boost::serialization::base_object<GizmoEvent>(*this);
00090                 ar & mEvent;
00091         }       
00092 };
00093 
00095 
00096 } // Gizmod namespace
00097 
00098 #endif // __GizmoEventCPUUsage_h

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