Skip to content

Commit

Permalink
REMOVE redundant Entities class (in favour of EntityVector)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Sep 5, 2024
1 parent c3fe132 commit b50c413
Show file tree
Hide file tree
Showing 27 changed files with 163 additions and 259 deletions.
5 changes: 3 additions & 2 deletions src/lib/apiTypesV2/BatchQuery.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#include "ngsi/StringList.h"
#include "ngsi/Request.h"
#include "ngsi/ScopeVector.h"
#include "apiTypesV2/Entities.h"

#include "apiTypesV2/EntityVector.h"



Expand All @@ -42,7 +43,7 @@
class BatchQuery
{
public:
Entities entities;
EntityVector entities;
StringList attributeV; // Deprecated
StringList attrsV;
ScopeVector scopeV;
Expand Down
5 changes: 3 additions & 2 deletions src/lib/apiTypesV2/BatchUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

#include "orionTypes/UpdateActionType.h"
#include "ngsi/Request.h"
#include "apiTypesV2/Entities.h"

#include "apiTypesV2/EntityVector.h"



Expand All @@ -42,7 +43,7 @@ class BatchUpdate
{
public:
ActionType updateActionType; // Mandatory
Entities entities; // Mandatory
EntityVector entities; // Mandatory

BatchUpdate();
~BatchUpdate();
Expand Down
2 changes: 0 additions & 2 deletions src/lib/apiTypesV2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
SET (SOURCES
Entity.cpp
EntityVector.cpp
Entities.cpp
Subscription.cpp
Registration.cpp
BatchQuery.cpp
Expand All @@ -35,7 +34,6 @@ SET (SOURCES
SET (HEADERS
Entity.h
EntityVector.h
Entities.h
Subscription.h
Registration.h
BatchQuery.h
Expand Down
146 changes: 0 additions & 146 deletions src/lib/apiTypesV2/Entities.cpp

This file was deleted.

67 changes: 0 additions & 67 deletions src/lib/apiTypesV2/Entities.h

This file was deleted.

3 changes: 1 addition & 2 deletions src/lib/jsonParseV2/parseEntitiesResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "common/errorMessages.h"
#include "alarmMgr/AlarmManager.h"
#include "alarmMgr/alarmMgr.h"
#include "apiTypesV2/Entities.h"
#include "rest/ConnectionInfo.h"
#include "rest/OrionError.h"
#include "jsonParseV2/parseEntityObject.h"
Expand All @@ -55,7 +54,7 @@
* of forwarded request so maybe it can be simplified)
*
*/
bool parseEntitiesResponse(ConnectionInfo* ciP, const char* payload, Entities* evP, OrionError* oeP)
bool parseEntitiesResponse(ConnectionInfo* ciP, const char* payload, EntityVector* evP, OrionError* oeP)
{
rapidjson::Document document;

Expand Down
3 changes: 1 addition & 2 deletions src/lib/jsonParseV2/parseEntitiesResponse.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "rapidjson/document.h"

#include "rest/ConnectionInfo.h"
#include "apiTypesV2/Entities.h"



Expand All @@ -43,7 +42,7 @@ extern bool parseEntitiesResponse
(
ConnectionInfo* ciP,
const char* payload,
Entities* evP,
EntityVector* evP,
OrionError* oeP
);

Expand Down
3 changes: 1 addition & 2 deletions src/lib/jsonParseV2/parseEntitiesResponseV1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "common/errorMessages.h"
#include "alarmMgr/AlarmManager.h"
#include "alarmMgr/alarmMgr.h"
#include "apiTypesV2/Entities.h"
#include "rest/ConnectionInfo.h"
#include "rest/OrionError.h"
#include "jsonParseV2/jsonParseTypeNames.h"
Expand Down Expand Up @@ -413,7 +412,7 @@ static std::string parseEntity(ConnectionInfo* ciP, rapidjson::Value::ConstMembe
* }
*
*/
bool parseEntitiesResponseV1(ConnectionInfo* ciP, const char* payload, Entities* evP, OrionError* oeP)
bool parseEntitiesResponseV1(ConnectionInfo* ciP, const char* payload, EntityVector* evP, OrionError* oeP)
{
rapidjson::Document document;

Expand Down
5 changes: 3 additions & 2 deletions src/lib/jsonParseV2/parseEntitiesResponseV1.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#include "rapidjson/document.h"

#include "rest/ConnectionInfo.h"
#include "apiTypesV2/Entities.h"

#include "apiTypesV2/EntityVector.h"



Expand All @@ -43,7 +44,7 @@ extern bool parseEntitiesResponseV1
(
ConnectionInfo* ciP,
const char* payload,
Entities* evP,
EntityVector* evP,
OrionError* oeP
);

Expand Down
4 changes: 2 additions & 2 deletions src/lib/jsonParseV2/parseEntityVector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include "ngsi/ContextAttribute.h"

#include "apiTypesV2/Entities.h"
#include "apiTypesV2/EntityVector.h"
#include "rest/ConnectionInfo.h"
#include "jsonParseV2/jsonParseTypeNames.h"
#include "jsonParseV2/parseEntityObject.h"
Expand All @@ -46,7 +46,7 @@ std::string parseEntityVector
(
ConnectionInfo* ciP,
const rapidjson::Value::ConstMemberIterator& iter,
Entities* evP,
EntityVector* evP,
bool idPatternAllowed,
bool attributesAllowed
)
Expand Down
3 changes: 1 addition & 2 deletions src/lib/jsonParseV2/parseEntityVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

#include "rapidjson/document.h"

#include "apiTypesV2/Entities.h"
#include "rest/ConnectionInfo.h"


Expand All @@ -42,7 +41,7 @@ extern std::string parseEntityVector
(
ConnectionInfo* ciP,
const rapidjson::Value::ConstMemberIterator& iter,
Entities* evP,
EntityVector* evP,
bool idPatternAllowed,
bool attributesAllowed
);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/ngsi10/QueryContextRequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void QueryContextRequest::fill(BatchQuery* bqP)
{
if (bqP->entities.vec.size() != 0)
{
entityIdVector.fill(bqP->entities.vec);
entityIdVector.fill(bqP->entities);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions src/lib/ngsi10/QueryContextResponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ void QueryContextResponse::release(void)
*
* QueryContextResponse::fill -
*/
void QueryContextResponse::fill(const Entities& entities)
void QueryContextResponse::fill(const EntityVector& entities)
{
for (int eIx = 0; eIx < entities.size(); eIx++)
for (unsigned int eIx = 0; eIx < entities.vec.size(); eIx++)
{
ContextElementResponse* cerP = new ContextElementResponse(entities.vec.vec[eIx]);
ContextElementResponse* cerP = new ContextElementResponse(entities.vec[eIx]);
contextElementResponseVector.push_back(cerP);
}
}
Expand Down
Loading

0 comments on commit b50c413

Please sign in to comment.