Commit 40c857e1 authored by Karel Hanák's avatar Karel Hanák

Merge branch 'feature/JsCacheOptimize#178' into 'master'

JsCache optimization

See merge request !10
parents 77ae581b 424fecc2
Pipeline #4297 passed with stages
in 69 minutes and 3 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
......
......@@ -6,6 +6,7 @@
#include <string>
#include <functional>
#include <vector>
#include <memory>
#ifdef IJsCacheService_EXPORTS
#define IJsCacheService_DECLSPEC SHAPE_ABI_EXPORT
......@@ -71,7 +72,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 +88,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 +100,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