refactor: simplifying message queue
This commit is contained in:
@@ -16,12 +16,11 @@
|
||||
#include "SPITSocket.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
|
||||
/**
|
||||
* clears all unconfirmed SPITObjects not created by this SPIT_Client.
|
||||
*/
|
||||
void SPITObject::clearUnconfirmedSPITObjects(SpitRepo<SPITObject>& repo) {
|
||||
auto& entries = repo.getRepo();
|
||||
void SPITObject::clearUnconfirmedSPITObjects(SpitRepo<SPITObject> &repo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); i++) {
|
||||
SPITObject *ptrSPITObject = i->second.get();
|
||||
if (ptrSPITObject->getCreatedByClient() == false && ptrSPITObject->getConfirmed() == false) {
|
||||
@@ -30,8 +29,8 @@ void SPITObject::clearUnconfirmedSPITObjects(SpitRepo<SPITObject>& repo) {
|
||||
}
|
||||
}
|
||||
|
||||
void SPITObject::eventProjectClosed(SpitRepo<SPITObject>& repo, SpitRepo<SPITObject>& remoteRepo) {
|
||||
auto& entries = repo.getRepo();
|
||||
void SPITObject::eventProjectClosed(SpitRepo<SPITObject> &repo, SpitRepo<SPITObject> &remoteRepo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); i++) {
|
||||
SPITObject *ptrSPITObject = i->second.get();
|
||||
if (ptrSPITObject->getCreatedByClient() == true) {
|
||||
@@ -46,8 +45,8 @@ void SPITObject::eventProjectClosed(SpitRepo<SPITObject>& repo, SpitRepo<SPITObj
|
||||
* sets confirmed = false for all SPITObjects.
|
||||
* This should be called when the client has loaded a project.
|
||||
*/
|
||||
void SPITObject::setConfirmedFalse(SpitRepo<SPITObject>& repo) {
|
||||
auto& entries = repo.getRepo();
|
||||
void SPITObject::setConfirmedFalse(SpitRepo<SPITObject> &repo) {
|
||||
auto &entries = repo.getRepo();
|
||||
for (auto i = entries.begin(); i != entries.end(); i++) {
|
||||
i->second->setConfirmed(false);
|
||||
}
|
||||
@@ -215,13 +214,6 @@ void SPITObject::fillMessageOP(SPIT_Message::RemoveSPITObject &p_RemoveSPITObjec
|
||||
p_RemoveSPITObject.setID(m_ID);
|
||||
}
|
||||
|
||||
void SPITObject::setID(const string &id) {
|
||||
m_ID = id;
|
||||
}
|
||||
void SPITObject::setCreatedByClient(bool p_CreatedByClient) {
|
||||
m_CreatedByClient = p_CreatedByClient;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is used by the server and client to tell if the other side has registered the changes.
|
||||
* @param p_Confirmed
|
||||
|
||||
Reference in New Issue
Block a user