xref: /haiku/src/kits/debugger/model/SystemInfo.cpp (revision 44b874666af6b25da6311e5a1c506ee3761f4268)
1 /*
2  * Copyright 2013, Rene Gollent, rene@gollent.com.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "SystemInfo.h"
8 
9 
10 SystemInfo::SystemInfo()
11 	:
12 	fTeam(-1)
13 {
14 	memset(&fSystemInfo, 0, sizeof(system_info));
15 	memset(&fSystemName, 0, sizeof(utsname));
16 }
17 
18 
19 SystemInfo::SystemInfo(const SystemInfo &other)
20 {
21 	SetTo(other.fTeam, other.fSystemInfo, other.fSystemName);
22 }
23 
24 
25 SystemInfo::SystemInfo(team_id team, const system_info& info,
26 	const utsname& name)
27 {
28 	SetTo(team, info, name);
29 }
30 
31 
32 void
33 SystemInfo::SetTo(team_id team, const system_info& info, const utsname& name)
34 {
35 	fTeam = team;
36 	memcpy(&fSystemInfo, &info, sizeof(system_info));
37 	memcpy(&fSystemName, &name, sizeof(utsname));
38 }
39