hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
DRCEFilesList.cpp
Go to the documentation of this file.
1 #include <utility>
2 
3 #include "DRCEFilesList.hpp"
4 
5 namespace HCE
6 {
7 namespace drce
8 {
9 //-----------------------------------------------------------------------------
11 : name(""), data(""), actionType(0)
12 {
13 }
14 //-----------------------------------------------------------------------------
15 FileItem::FileItem(const std::string& name_, const std::string& data_, unsigned int actionType_)
16 : name(name_), data(data_), actionType(actionType_)
17 {
18 }
19 //-----------------------------------------------------------------------------
21 : name(""), data(""), actionType(0)
22 {
23  (*this) = rhs;
24 }
25 //-----------------------------------------------------------------------------
27 : name(""), data(""), actionType(0)
28 {
29  (*this) = std::forward<FileItem>(rhs);
30 }
31 //-----------------------------------------------------------------------------
33 {
34  if (this!=&rhs)
35  {
36  name = rhs.name;
37  data = rhs.data;
38  actionType = rhs.actionType;
39  }
40  return *this;
41 }
42 //-----------------------------------------------------------------------------
44 {
45  if (this!=&rhs)
46  {
47  name = std::move(rhs.name);
48  data = std::move(rhs.data);
49  actionType = std::move(rhs.actionType);
50  }
51  return *this;
52 }
53 //-----------------------------------------------------------------------------
54 //-----------------------------------------------------------------------------
56 : files()
57 {
58 }
59 //-----------------------------------------------------------------------------
61 : files()
62 {
63  (*this) = rhs;
64 }
65 //-----------------------------------------------------------------------------
67 : files()
68 {
69  (*this) = std::forward<DRCEFilesList>(rhs);
70 }
71 //-----------------------------------------------------------------------------
73 {
74  if (this!=&rhs)
75  {
76  files = rhs.getFiles();
77  }
78  return *this;
79 }
80 //-----------------------------------------------------------------------------
82 {
83  if (this!=&rhs)
84  {
85  files = std::move(rhs.getFiles());
86  }
87  return *this;
88 }
89 //-----------------------------------------------------------------------------
90 void DRCEFilesList::addFileItem(const FileItem& fileItem)
91 {
92  files.push_back(fileItem);
93 }
94 //-----------------------------------------------------------------------------
96 {
97  files.push_back(std::move(std::forward<FileItem>(fileItem)));
98 }
99 //-----------------------------------------------------------------------------
100 void DRCEFilesList::addFileItem(const std::string& name, const std::string& data, unsigned int actionType)
101 {
102  files.push_back(std::move(std::forward<FileItem>(FileItem(name, data, actionType))));
103 }
104 //-----------------------------------------------------------------------------
106 {
107  return files.size();
108 }
109 //-----------------------------------------------------------------------------
111 {
112  return files[index];
113 }
114 //-----------------------------------------------------------------------------
115 // cppcheck-suppress unusedFunction
116 void DRCEFilesList::setFileItem(size_t index, const FileItem& fileItem)
117 {
118  files[index] = fileItem;
119 }
120 //-----------------------------------------------------------------------------
121 void DRCEFilesList::setFileItem(size_t index, FileItem&& fileItem)
122 {
123  files[index] = std::forward<FileItem>(fileItem);
124 }
125 //-----------------------------------------------------------------------------
127 {
128  files.clear();
129 }
130 //-----------------------------------------------------------------------------
131 //-----------------------------------------------------------------------------
132 } // namespace drce
133 } // namespace HCE