[SECARSP-143] Notifications component was implemented and integrated into Dashboard
[platform/core/security/suspicious-activity-monitor.git] / device-agent / daemon / device_list.h
1 /**
2  * Samsung Ukraine R&D Center (SRK under a contract between)
3  * LLC "Samsung Electronics Co", Ltd (Seoul, Republic of Korea)
4  * Copyright (C) 2017 Samsung Electronics Co., Ltd. All rights reserved.
5  */
6 /**
7  * @file   device_list.h
8  * @brief  Device info container
9  * @date   Created Jun 16, 2017
10  * @author Mail to: <A HREF="mailto:a.zabolotnyi@samsung.com">Andrey Zabolotnyi, a.zabolotnyi@samsung.com</A>
11  */
12
13 #ifndef __DEVICE_LIST_H__
14 #define __DEVICE_LIST_H__
15
16 #include <string>
17 #include <vector>
18
19 /**
20  * @brief A structure that contains info about a device
21  */
22 struct DeviceInfo {
23     std::string duid;       /**< Device unique ID */
24     std::string name;       /**< Device name */
25     std::string model;      /**< Device model */
26     std::string type;       /**< Device type */
27     bool                is_owned;   /**< Is the device owned */
28
29     static const int fields_count = 5; /**< Number of significant fields */
30
31     bool operator==(const DeviceInfo& r); /**< Equal operator */
32 };
33
34 /**
35  * @brief A container for device information
36  */
37 class DeviceList : public std::vector<DeviceInfo>
38 {
39 public:
40     /**
41      * @brief Loads device information from file
42      * @param file_name [in] file name
43      * @details This function throws std::runtime_error if failed
44      */
45     void loadFromFile(const std::string& file_name);
46
47     /**
48      * @brief Store device information to the file
49      * @param file_name [in] file name
50      * @details This function throws std::runtime_error if failed
51      */
52     void storeToFile(const std::string& file_name);
53 };
54
55 #endif // __DEVICE_LIST_H__