-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- 重命名`byte_convertor`中的`format`参数为`data_format`,以提高清晰度。 - 在`cmake_generator`中,用`project_config`取代`config`变量名,增强可读性。 - 在`generator`中,通过添加文档字符串和改进命名规约,优化C++代码风格和可维护性。 - 在`html`模块中,添加和更新类的文档字符串,提供更清晰的API文档。 - 调整`package`模块的日志和错误处理,以提供更清晰的反馈。 - 在`src/atom/function/abi.hpp`中,优化`DemangleHelper`类的内部实现,避免潜在的溢出问题并提高效率。 BREAKING CHANGE: 函数参数的重命名可能会影响依赖于`byte_convertor`和`cmake_generator`模块的代码。请更新调用这些函数的代码,使用新的参数名称以确保兼容性。
- Loading branch information
Showing
65 changed files
with
3,713 additions
and
2,040 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#include "atom/components/component.hpp" | ||
#include <dlgs.h> | ||
#include "atom/components/registry.hpp" | ||
|
||
#include "atom/sysinfo/battery.hpp" | ||
#include "atom/sysinfo/cpu.hpp" | ||
#include "atom/sysinfo/disk.hpp" | ||
#include "atom/sysinfo/gpu.hpp" | ||
#include "atom/sysinfo/memory.hpp" | ||
#include "atom/sysinfo/os.hpp" | ||
#include "atom/sysinfo/wifi.hpp" | ||
|
||
#include "atom/log/loguru.hpp" | ||
|
||
using namespace atom::system; | ||
|
||
ATOM_MODULE(atom_io, [](Component &component) { | ||
DLOG_F(INFO, "Loading module {}", component.getName()); | ||
|
||
// ------------------------------------------------------------ | ||
// CPU | ||
// ------------------------------------------------------------ | ||
|
||
component.def("cpu_usage", &getCurrentCpuUsage, "cpu", | ||
"Get current CPU usage percentage"); | ||
component.def("cpu_temperature", &getCurrentCpuTemperature, "cpu", | ||
"Get current CPU temperature"); | ||
component.def("cpu_model", &getCPUModel, "cpu", "Get CPU model name"); | ||
component.def("cpu_identifier", &getProcessorIdentifier, "cpu", | ||
"Get CPU identifier"); | ||
component.def("cpu_frequency", &getProcessorFrequency, "cpu", | ||
"Get current CPU frequency"); | ||
component.def("physical_packages", &getNumberOfPhysicalPackages, "cpu", | ||
"Get number of physical CPU packages"); | ||
component.def("logical_cpus", &getNumberOfPhysicalCPUs, "cpu", | ||
"Get number of logical CPUs"); | ||
component.def("cache_sizes", &getCacheSizes, "cpu", "Get CPU cache sizes"); | ||
|
||
// ------------------------------------------------------------ | ||
// Memory | ||
// ------------------------------------------------------------ | ||
|
||
component.def("memory_usage", &getMemoryUsage, "memory", | ||
"Get current memory usage percentage"); | ||
component.def("total_memory", &getTotalMemorySize, "memory", | ||
"Get total memory size"); | ||
component.def("available_memory", &getAvailableMemorySize, "memory", | ||
"Get available memory size"); | ||
component.def("physical_memory_info", &getPhysicalMemoryInfo, "memory", | ||
"Get physical memory slot info"); | ||
component.def("virtual_memory_max", &getVirtualMemoryMax, "memory", | ||
"Get virtual memory max size"); | ||
component.def("virtual_memory_used", &getVirtualMemoryUsed, "memory", | ||
"Get virtual memory used size"); | ||
component.def("swap_memory_total", &getSwapMemoryTotal, "memory", | ||
"Get swap memory total size"); | ||
component.def("swap_memory_used", &getSwapMemoryUsed, "memory", | ||
"Get swap memory used size"); | ||
component.def("committed_memory", &getCommittedMemory, "memory", | ||
"Get committed memory"); | ||
component.def("uncommitted_memory", &getUncommittedMemory, "memory", | ||
"Get uncommitted memory"); | ||
|
||
component.defType<MemoryInfo>("memory_info"); | ||
component.defType<MemoryInfo::MemorySlot>("memory_slot"); | ||
component.def_v("memory_slot_type", &MemoryInfo::MemorySlot::type, "memory_slot", | ||
"Get memory slot type"); | ||
component.def("memory_slot_capacity", &MemoryInfo::MemorySlot::capacity, "memory_slot", | ||
"Get memory slot capacity"); | ||
component.def("memory_slot_clock_speed", &MemoryInfo::MemorySlot::clockSpeed, "memory_slot", | ||
"Get memory slot clock speed"); | ||
|
||
|
||
// ------------------------------------------------------------ | ||
// Disk | ||
// ------------------------------------------------------------ | ||
|
||
component.def("disk_usage", &getDiskUsage, "disk", | ||
"Get current disk usage percentage"); | ||
component.def("is_hotspot_connected", &isHotspotConnected, "wifi", | ||
"Check if the hotspot is connected"); | ||
component.def("wired_network", &getCurrentWiredNetwork, "wifi", | ||
"Get current wired network"); | ||
component.def("wifi_name", &getCurrentWifi, "wifi", | ||
"Get current wifi name"); | ||
component.def("current_ip", &getHostIPs, "network", | ||
"Get current IP address"); | ||
component.def("gpu_info", &getGPUInfo, "gpu", "Get GPU info"); | ||
|
||
DLOG_F(INFO, "Loaded module {}", component.getName()); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.