PCMHostInfo.h
Go to the documentation of this file.00001 00002 // 00003 // This source file is a part of ParCompMark 00004 // Parallel Compositing Benchmark Framework 00005 // 00006 // for latest info see http://parcompmark.sourceforge.net 00007 00008 // 00009 // Copyright (C) 2006 IT2 ParCompMark Dev. Team 00010 // 00011 // This program is free software; you can redistribute it and/or 00012 // modify it under the terms of the GNU General Public License 00013 // as published by the Free Software Foundation; either version 2 00014 // of the License, or (at your option) any later version. 00015 // 00016 // This program is distributed in the hope that it will be useful, 00017 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00018 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00019 // GNU General Public License for more details. 00020 // 00021 // You should have received a copy of the GNU General Public License 00022 // along with this program; if not, write to the Free Software 00023 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00024 00027 00028 #ifndef __PCM_HOSTINFO_H__ 00029 # define __PCM_HOSTINFO_H__ 00030 00031 // 00032 // Inner includes 00033 // 00034 00035 # include "PCMPremeditations.h" 00036 00037 # include "PCMOutputNode.h" 00038 00039 # include "PCMLogger.h" 00040 00041 # include "PCMException.h" 00042 00043 # include "PCMContainer.h" 00044 00045 # include "PCMCPU.h" 00046 00047 # include "PCMGPU.h" 00048 00049 # include "PCMPointer.h" 00050 00051 # include "PCMOutputNode.h" 00052 00053 // 00054 // Outer includes 00055 // 00056 00057 # include <string> 00058 00059 # include <pcapi.h> 00060 00061 # include <tinyxml/tinyxml.h> 00062 00063 namespace ParCompMark 00064 { 00065 00070 class HostInfo:public OutputNode 00071 { 00072 00073 // 00074 // Unit test class 00075 // 00076 # ifdef PARCOMPMARK_TEST 00077 friend class ParCompMarkTest::TestHostInfo; 00078 # endif 00079 00080 // 00081 // Typedefs 00082 // 00083 00084 public: 00085 00087 typedef struct NetIDName 00088 00089 { 00091 std::string name; 00093 PCint ID; 00094 typedef ParCompMark::Pointer < NetIDName, 00095 DummyLock > Pointer; 00096 } NetIDName; 00097 00099 typedef ParCompMark::Pointer < HostInfo, 00100 Mutex > Pointer; 00101 00102 // 00103 // Variables 00104 // 00105 00107 00108 00109 protected: 00110 00116 Container < CPU, Mutex >::Pointer mCPUs; 00117 00123 Container < GPU, Mutex >::Pointer mGPUs; 00124 00130 Container < HostInfo::NetIDName, DummyLock >::Pointer mNetIDNames; 00131 00137 std::string mPCLibVersion; 00138 00144 PCint mPCNumNetworks; 00145 00151 std::string mPCVendor; 00152 00158 std::string mPCExtensions; 00159 00165 PCint mVolatileFrameletLimit; 00166 00172 PCint mRetainOutputLimit; 00173 00175 00176 // 00177 // Constructors & destructor 00178 // 00179 00181 00182 00183 public: 00184 00190 HostInfo(const std::string & name, const OutputNode::NodeType & type); 00191 00195 virtual ~ HostInfo(); 00196 00198 00199 // 00200 // Getters & setters 00201 // 00202 00204 00205 00206 public: 00207 00213 Container < CPU, Mutex >::Pointer & getCPUs(); 00214 00220 Container < GPU, Mutex >::Pointer & getGPUs(); 00221 00227 Container < HostInfo::NetIDName, DummyLock >::Pointer & getNetIDNames(); 00228 00234 const std::string & getPCLibVersion() const; 00235 00241 const PCint & getPCNumNetworks() const; 00242 00248 const std::string & getPCVendor() const; 00249 00255 const std::string & getPCExtensions() const; 00256 00262 const PCint & getVolatileFrameletLimit() const; 00263 00269 const PCint & getRetainOutputLimit() const; 00270 00272 00273 // 00274 // Class methods 00275 // 00276 00278 00279 00280 public: 00281 00287 static HostInfo::Pointer parseXML(TiXmlElement * &tiHostinfo); 00288 00290 00291 // 00292 // Methods 00293 // 00294 00296 00297 00298 public: 00299 00303 virtual void refreshData(); 00304 00309 virtual void refreshCPUs(OutputNode::Pointer & cpus); 00310 00315 virtual void refreshGPUs(OutputNode::Pointer & gpus); 00316 00318 00319 }; 00320 00321 // 00322 // Include header implementation 00323 // 00324 00325 # include "PCMHostInfo_impl.h" 00326 00327 } 00328 00329 #endif