]> git.stg.codes - stg.git/commitdiff
Added resetable service conf.
authorMaxim Mamontov <faust.madf@gmail.com>
Sun, 20 Oct 2013 09:36:40 +0000 (12:36 +0300)
committerMaxim Mamontov <faust.madf@gmail.com>
Sun, 20 Oct 2013 09:36:40 +0000 (12:36 +0300)
include/stg/service_conf.h

index ca58154b2a08d53612b64f6419f4f6e4cdbcfa6b..ce2cff2ec484344a032b216118abf62cf33ba671 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <string>
 
 
 #include <string>
 
+#include "resetable.h"
 #include "os_int.h"
 
 struct SERVICE_CONF
 #include "os_int.h"
 
 struct SERVICE_CONF
@@ -30,6 +31,38 @@ double      cost;
 uint8_t     payDay;
 };
 
 uint8_t     payDay;
 };
 
+struct SERVICE_CONF_RES
+{
+SERVICE_CONF_RES()
+    : name(), comment(),
+      cost(), payDay()
+{}
+
+SERVICE_CONF_RES & operator=(const SERVICE_CONF & conf)
+{
+name = conf.name;
+comment = conf.comment;
+cost = conf.cost;
+payDay = conf.payDay;
+return *this;
+}
+
+SERVICE_CONF GetData() const
+{
+SERVICE_CONF sc;
+sc.name = name.data();
+sc.comment = comment.data();
+sc.cost = cost.data();
+sc.payDay = payDay.data();
+return sc;
+}
+
+RESETABLE<std::string> name;
+RESETABLE<std::string> comment;
+RESETABLE<double>      cost;
+RESETABLE<uint8_t>     payDay;
+};
+
 inline
 bool operator==(const SERVICE_CONF & a, const SERVICE_CONF & b)
 {
 inline
 bool operator==(const SERVICE_CONF & a, const SERVICE_CONF & b)
 {