
Mostly this consists of marking functions with override when applicable, and moving function bodies from .h to .cc files. Not inlining virtual functions with simple bodies such as { return false; } strikes me as probably losing more in readability than we gain in binary size and compilation time, but I guess it's just like any other case where enabling a generally good warning forces us to write slightly worse code in a couple of places. BUG=163 R=kjellander@webrtc.org, tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/47429004 Cr-Commit-Position: refs/heads/master@{#8656} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8656 4adac7df-926f-26a2-2b94-8c16560cd09d
83 lines
2.0 KiB
C++
83 lines
2.0 KiB
C++
/*
|
|
* Copyright 2008 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#ifndef WEBRTC_BASE_SYSTEMINFO_H__
|
|
#define WEBRTC_BASE_SYSTEMINFO_H__
|
|
|
|
#include <string>
|
|
|
|
#include "webrtc/base/basictypes.h"
|
|
|
|
namespace rtc {
|
|
|
|
class SystemInfo {
|
|
public:
|
|
enum Architecture {
|
|
SI_ARCH_UNKNOWN = -1,
|
|
SI_ARCH_X86 = 0,
|
|
SI_ARCH_X64 = 1,
|
|
SI_ARCH_ARM = 2
|
|
};
|
|
|
|
SystemInfo();
|
|
|
|
// The number of CPU Cores in the system.
|
|
int GetMaxPhysicalCpus();
|
|
// The number of CPU Threads in the system.
|
|
int GetMaxCpus();
|
|
// The number of CPU Threads currently available to this process.
|
|
int GetCurCpus();
|
|
// Identity of the CPUs.
|
|
Architecture GetCpuArchitecture();
|
|
std::string GetCpuVendor();
|
|
int GetCpuFamily();
|
|
int GetCpuModel();
|
|
int GetCpuStepping();
|
|
// Return size of CPU cache in bytes. Uses largest available cache (L3).
|
|
int GetCpuCacheSize();
|
|
// Estimated speed of the CPUs, in MHz. e.g. 2400 for 2.4 GHz
|
|
int GetMaxCpuSpeed();
|
|
int GetCurCpuSpeed();
|
|
// Total amount of physical memory, in bytes.
|
|
int64 GetMemorySize();
|
|
// The model name of the machine, e.g. "MacBookAir1,1"
|
|
std::string GetMachineModel();
|
|
|
|
// The gpu identifier
|
|
struct GpuInfo {
|
|
GpuInfo();
|
|
~GpuInfo();
|
|
std::string device_name;
|
|
std::string description;
|
|
int vendor_id;
|
|
int device_id;
|
|
std::string driver;
|
|
std::string driver_version;
|
|
};
|
|
bool GetGpuInfo(GpuInfo *info);
|
|
|
|
private:
|
|
int physical_cpus_;
|
|
int logical_cpus_;
|
|
int cache_size_;
|
|
Architecture cpu_arch_;
|
|
std::string cpu_vendor_;
|
|
int cpu_family_;
|
|
int cpu_model_;
|
|
int cpu_stepping_;
|
|
int cpu_speed_;
|
|
int64 memory_;
|
|
std::string machine_model_;
|
|
};
|
|
|
|
} // namespace rtc
|
|
|
|
#endif // WEBRTC_BASE_SYSTEMINFO_H__
|