Commit 44177aad authored by Frantisek Mikulu's avatar Frantisek Mikulu

driver code in shared_ptr

parent 77ae581b
Pipeline #4291 failed with stages
in 6 minutes and 50 seconds
......@@ -1222,7 +1222,7 @@ namespace iqrf {
IJsCacheService::StdDriver driver;
driver = m_iJsCacheService->getDriver(driverId, driverVer);
if (driver.isValid()) {
str2load += driver.getDriver();
str2load += *driver.getDriver();
}
else {
TRC_WARNING("Inconsistency in driver versions: " << PAR(driverId) << PAR(driverVer) << " no driver found");
......@@ -1556,12 +1556,12 @@ namespace iqrf {
", ?"
", ?"
");"
<< drv.getNotes()
<< *drv.getNotes()
<< name
<< version
<< standardId
<< drv.getVersionFlags()
<< drv.getDriver()
<< *drv.getDriver()
;
}
......
......@@ -958,11 +958,12 @@ namespace iqrf {
int versionFlag;
double version;
std::string driver, notes;
std::shared_ptr<std::string> notes(shape_new std::string());
std::shared_ptr<std::string> driver(shape_new std::string());
POINTER_GET_DOUBLE("", &doc, "/version", version, fname);
POINTER_GET_INT("", &doc, "/versionFlags", versionFlag, fname);
POINTER_GET_STRING("", &doc, "/driver", driver, fname);
POINTER_GET_STRING("", &doc, "/notes", notes, fname);
POINTER_GET_STRING("", &doc, "/driver", *driver, fname);
POINTER_GET_STRING("", &doc, "/notes", *notes, fname);
stdDriver.second = StdDriver(stdItem.first, stdItem.second.m_name, version, driver, notes, versionFlag);
} // for 3
} // for 2
......
......@@ -71,7 +71,13 @@ namespace iqrf {
StdDriver()
:m_valid(false)
{}
StdDriver(int id, const std::string& name, double version, const std::string& driver, const std::string& notes, int verFlags)
StdDriver(int id
, const std::string & name
, double version
, const std::shared_ptr<std::string> & driver
, const std::shared_ptr<std::string> & notes
, int verFlags
)
: m_valid(true)
,m_id(id)
,m_version(version)
......@@ -81,9 +87,9 @@ namespace iqrf {
,m_notes(notes)
{}
bool isValid() const { return m_valid; }
const std::string& getName() const { return m_name; }
const std::string& getDriver() const { return m_driver; }
const std::string& getNotes() const { return m_notes; }
const std::string & getName() const { return m_name; }
const std::shared_ptr<std::string> & getDriver() const { return m_driver; }
const std::shared_ptr<std::string> & getNotes() const { return m_notes; }
int getVersionFlags() const { return m_versionFlags; }
double getVersion() const { return m_version; }
int getId() const { return m_id; }
......@@ -93,8 +99,8 @@ namespace iqrf {
double m_version = 0;
int m_versionFlags = 0;
std::string m_name;
std::string m_driver;
std::string m_notes;
std::shared_ptr<std::string> m_driver;
std::shared_ptr<std::string> m_notes;
};
class Package
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment