-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MSVC, C++11) Add Network information(interface index, MAC, IPv4, Description) #65
base: main
Are you sure you want to change the base?
Conversation
use "Win32_CacheMemory" to get CPU cache size, because "Win32_Processor" can not get L1 cache
Data type of "AdapterRAM " is "uint32", using "int" will cause overflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution. All in all good work! Please address the issues stated in the comments so that I can merge your pull-request.
Also make sure that all files are in line with the coding style (.clang-format)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add dummy implementations for Linux (and OSX) for this classes member functions? They can just return "" but they need to be implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I will try
@@ -36,6 +36,7 @@ class CPU { | |||
~CPU() = default; | |||
|
|||
int id() const; | |||
const std::string& processorId() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this information is useful at all. Maybe just remove it for the time being
@@ -0,0 +1,35 @@ | |||
// Copyright MRsoymilk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot accept copyrighted content for this project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add Linux (and maybe OSX) dummy implementations for this classes member functions too?
Network() = default; | ||
std::string _interfaceIndex{}; | ||
std::string _mac{}; | ||
std::string _ipv4{}, _ipv6{}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please write them in separate statements for readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once you have added the dummy implementations, you can add the linux and OSX cpp files here too
@@ -0,0 +1,24 @@ | |||
// Copyright MRsoymilk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot accept Copyright code for this project
@@ -91,7 +91,7 @@ std::vector<double> CPU::threadsUtilisation() const { | |||
std::vector<CPU> getAllCPUs() { | |||
utils::WMI::_WMI wmi; | |||
const std::wstring query_string( | |||
L"SELECT Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed, L2CacheSize, L3CacheSize " | |||
L"SELECT Name, Manufacturer, NumberOfCores, NumberOfLogicalProcessors, MaxClockSpeed, ProcessorId " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove ProcessorId
@@ -0,0 +1,80 @@ | |||
// Copyright (c) MRsoymilk <codermrsoymilk@gmail.com> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i cannot accept copyright code for this project
@@ -11,9 +11,10 @@ namespace utils { | |||
namespace WMI { | |||
|
|||
_WMI::_WMI() { | |||
auto res = CoInitializeSecurity(nullptr, -1, nullptr, nullptr, RPC_C_AUTHN_LEVEL_DEFAULT, RPC_C_IMP_LEVEL_IMPERSONATE, | |||
HRESULT res{-1}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better initialize res with the return value of the first statement
it seems a lot of things that need to be modified and it will take me some time to do |
The information shows below: