diff --git a/src/apps/debugger/model/SystemInfo.cpp b/src/apps/debugger/model/SystemInfo.cpp new file mode 100644 index 0000000000..3a0b0c70fa --- /dev/null +++ b/src/apps/debugger/model/SystemInfo.cpp @@ -0,0 +1,38 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ + + +#include "SystemInfo.h" + + +SystemInfo::SystemInfo() + : + fTeam(-1) +{ + memset(&fSystemInfo, 0, sizeof(system_info)); + memset(&fSystemName, 0, sizeof(utsname)); +} + + +SystemInfo::SystemInfo(const SystemInfo &other) +{ + SetTo(other.fTeam, other.fSystemInfo, other.fSystemName); +} + + +SystemInfo::SystemInfo(team_id team, const system_info& info, + const utsname& name) +{ + SetTo(team, info, name); +} + + +void +SystemInfo::SetTo(team_id team, const system_info& info, const utsname& name) +{ + fTeam = team; + memcpy(&fSystemInfo, &info, sizeof(system_info)); + memcpy(&fSystemName, &name, sizeof(utsname)); +} diff --git a/src/apps/debugger/model/SystemInfo.h b/src/apps/debugger/model/SystemInfo.h new file mode 100644 index 0000000000..a6c6eb1b60 --- /dev/null +++ b/src/apps/debugger/model/SystemInfo.h @@ -0,0 +1,40 @@ +/* + * Copyright 2013, Rene Gollent, rene@gollent.com. + * Distributed under the terms of the MIT License. + */ +#ifndef SYSTEM_INFO_H +#define SYSTEM_INFO_H + +#include + +#include +#include + +#include "Types.h" + + +class SystemInfo { +public: + SystemInfo(); + SystemInfo(const SystemInfo& other); + SystemInfo(team_id team, + const system_info& info, + const utsname& name); + + void SetTo(team_id team, const system_info& info, + const utsname& name); + + team_id TeamID() const { return fTeam; } + + const system_info& GetSystemInfo() const { return fSystemInfo; } + + const utsname& GetSystemName() const { return fSystemName; } + +private: + team_id fTeam; + system_info fSystemInfo; + utsname fSystemName; +}; + + +#endif // SYSTEM_INFO_H