processor_hpux.cpp

来自「Pegasus is an open-source implementation」· C++ 代码 · 共 719 行 · 第 1/2 页

CPP
719
字号
//%2006//////////////////////////////////////////////////////////////////////////// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation, The Open Group.// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; VERITAS Software Corporation; The Open Group.// Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;// EMC Corporation; Symantec Corporation; The Open Group.//// Permission is hereby granted, free of charge, to any person obtaining a copy// of this software and associated documentation files (the "Software"), to// deal in the Software without restriction, including without limitation the// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or// sell copies of the Software, and to permit persons to whom the Software is// furnished to do so, subject to the following conditions:// // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.////==============================================================================//// Author: Christopher Neufeld <neufeld@linuxcare.com>//         David Kennedy       <dkennedy@linuxcare.com>//// Modified By://         David Kennedy       <dkennedy@linuxcare.com>//         Christopher Neufeld <neufeld@linuxcare.com>//         Al Stone, Hewlett-Packard Company <ahs3@fc.hp.com>//         Jim Metcalfe, Hewlett-Packard Company//         Carlos Bonilla, Hewlett-Packard Company//         Mike Glantz, Hewlett-Packard Company <michael_glantz@hp.com>////%/////////////////////////////////////////////////////////////////////////////* ==========================================================================   Includes.   ========================================================================== */#include "ProcessorPlatform.h"#include <sys/utsname.h>               // for uname()#include <unistd.h>                    // for sysconf()#ifndef CPU_IA64_ARCHREV_0#define CPU_IA64_ARCHREV_0 0x300#endifPEGASUS_USING_STD;PEGASUS_USING_PEGASUS;Processor::Processor(){}Processor::~Processor(){}/*================================================================================NAME              : getCaptionDESCRIPTION       : returns ATTNASSUMPTIONS       : PRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/Boolean Processor::getCaption(String& s) const{  char t[32];  sprintf(t,"Processor %d",pInfo.psp_idx);  s = String(t);  return true;}/*================================================================================NAME              : getDescriptionDESCRIPTION       : returns pst_cmd (command line) as a string (contrast                  : this with ModulePath and Parameters below)ASSUMPTIONS       : PRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/Boolean Processor::getDescription(String& s) const{  s = "This is an instance of a PG_Processor";  return true;}/*================================================================================NAME              : getInstallDateDESCRIPTION       : ASSUMPTIONS       : PRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/Boolean Processor::getInstallDate(CIMDateTime& d) const{  // Not supported. This property is inherited from  // CIM_ManagedSystemElement, but has no useful meaning  // for a transient entity such as a process (there is a  // suitable property CreationDate below  return false;}/*================================================================================NAME              : getNameDESCRIPTION       : ASSUMPTIONS       : PRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/Boolean Processor::getName(String& s) const{  // Not supported. This property is inherited from  // CIM_ManagedSystemElement, but has no useful meaning  // for a transient entity such as a process (there is a  // suitable property CreationDate below  return false;}/*================================================================================NAME              : getStatusDESCRIPTION       : ASSUMPTIONS       : PRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/Boolean Processor::getStatus(String& s) const{  // This property is inherited from CIM_ManagedSystemElement  // We can't do very much, so if we're alive enough to execute  // this code, we return OK  s = "OK";  return true;}/*================================================================================NAME              : getDeviceIDDESCRIPTION       : ASSUMPTIONS       : NonePRE-CONDITIONS    :POST-CONDITIONS   : NOTES             : ================================================================================*/String Processor::getDeviceID(void) const{  char buf[100];// ATTN for now, we are returning the index  sprintf(buf,"%d",pInfo.psp_idx);  return String(buf);}// =============================================================================// NAME              : getPowerManagementSupported// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getPowerManagementSupported(Boolean& b) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getPowerManagementCapabilities// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getPowerManagementCapabilities(Array<Uint16>& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getAvailability// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getAvailability(Uint16& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getStatusInfo// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getStatusInfo(Uint16& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getLastErrorCode// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getLastErrorCode(Uint32& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getErrorDescription// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getErrorDescription(String& s) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getErrorCleared// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getErrorCleared(Boolean& b) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getOtherIdentifyingInfo// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getOtherIdentifyingInfo(Array<String>& s) const{  // not yet implemented  return false;}// =============================================================================// NAME              : PowerOnHours// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getPowerOnHours(Uint64& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : TotalPowerOnHours// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getTotalPowerOnHours(Uint64& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getIdentifyingDescriptions// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getIdentifyingDescriptions(Array<String>& s) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getAdditionalAvailability// DESCRIPTION       : // ASSUMPTIONS       : None// PRE-CONDITIONS    :// POST-CONDITIONS   : // NOTES             : // =============================================================================Boolean Processor::getAdditionalAvailability(Array<Uint16>& i) const{  // not yet implemented  return false;}// =============================================================================// NAME              : getMaxQuiesceTime// DESCRIPTION       : // ASSUMPTIONS       : None

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?