Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor/types #1524

Merged
merged 8 commits into from
Dec 30, 2023
  •  
  •  
  •  
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,11 @@ endif (${CMAKE_BUILD_TYPE} STREQUAL DEBUG)
SET (ORION_LIBS
common
rest # verbName(Verb) from [email protected]; jsonRequestTreat from [email protected]
orionld_rest
orionld_mhd
orionld_service
orionld_serviceRoutines
orionld_forwarding
orionld_distOp
orionld_regMatch
orionld_troe
orionld_kjTree
orionld_mqtt
Expand Down Expand Up @@ -229,7 +231,6 @@ SET (ORION_LIBS
orionld_payloadCheck
orionld_kjTree # mongoBackend uses kjSort, that is temporarily in kjTree - to be moved to kjson
orionld_payloadCheck
orionld_forwarding
orionld_mqtt
orionld_q
orionld_mongoc # subCache needs mongoc
Expand Down Expand Up @@ -372,9 +373,11 @@ if (error EQUAL 0)
ADD_SUBDIRECTORY(src/lib/orionld/pernot)
ADD_SUBDIRECTORY(src/lib/orionld/socketService)
ADD_SUBDIRECTORY(src/lib/orionld/notifications)
ADD_SUBDIRECTORY(src/lib/orionld/forwarding)
ADD_SUBDIRECTORY(src/lib/orionld/regMatch)
ADD_SUBDIRECTORY(src/lib/orionld/distOp)
ADD_SUBDIRECTORY(src/lib/orionld/q)
ADD_SUBDIRECTORY(src/lib/orionld/rest)
ADD_SUBDIRECTORY(src/lib/orionld/mhd)
ADD_SUBDIRECTORY(src/lib/orionld/service)
ADD_SUBDIRECTORY(src/lib/orionld/serviceRoutines)
ADD_SUBDIRECTORY(src/lib/orionld/troe)
ADD_SUBDIRECTORY(src/lib/orionld/common)
Expand Down
7 changes: 5 additions & 2 deletions scripts/style_check_in_makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ function style_check
}


style_check src/lib/orionld/entityMaps
style_check src/lib/orionld/mhd
style_check src/lib/orionld/service
style_check src/lib/orionld/serviceRoutines
style_check src/lib/orionld/forwarding
style_check src/lib/orionld/regMatch
style_check src/lib/orionld/distOp
style_check src/lib/orionld/apiModel
style_check src/lib/orionld/regCache
style_check src/lib/orionld/mongoc
Expand All @@ -58,7 +62,6 @@ style_check src/lib/orionld/prometheus
style_check src/lib/orionld/payloadCheck
style_check src/lib/orionld/legacyDriver
style_check src/lib/orionld/q
style_check src/lib/orionld/rest
style_check src/lib/orionld/db
style_check src/lib/orionld/kjTree
style_check src/lib/orionld/context
Expand Down
4 changes: 2 additions & 2 deletions src/app/orionld/orionld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ extern "C"
#include "orionld/context/orionldCoreContext.h" // ORIONLD_CORE_CONTEXT_URL_*
#include "orionld/context/orionldContextFromUrl.h" // contextDownloadListInit, contextDownloadListRelease
#include "orionld/contextCache/orionldContextCacheRelease.h" // orionldContextCacheRelease
#include "orionld/rest/orionldServiceInit.h" // orionldServiceInit
#include "orionld/service/orionldServiceInit.h" // orionldServiceInit
#include "orionld/entityMaps/entityMapsRelease.h" // entityMapsRelease
#include "orionld/db/dbInit.h" // dbInit
#include "orionld/mqtt/mqttRelease.h" // mqttRelease
Expand All @@ -148,7 +148,7 @@ extern "C"
#include "orionld/troe/pgVersionGet.h" // pgVersionGet
#include "orionld/troe/pgConnectionPoolsFree.h" // pgConnectionPoolsFree
#include "orionld/troe/pgConnectionPoolsPresent.h" // pgConnectionPoolsPresent
#include "orionld/forwarding/distOpInit.h" // distOpInit
#include "orionld/distOp/distOpInit.h" // distOpInit

#include "orionld/version.h"
#include "orionld/orionRestServices.h"
Expand Down
2 changes: 1 addition & 1 deletion src/app/orionld/orionldRestServices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
#include "orionld/serviceRoutines/orionldPatchTemporalAttributeInstance.h" // orionldPatchTemporalAttributeInstance
#include "orionld/serviceRoutines/orionldPostTemporalAttributes.h" // orionldPostTemporalAttributes

#include "orionld/rest/OrionLdRestService.h" // OrionLdRestServiceSimplified
#include "orionld/types/OrionLdRestService.h" // OrionLdRestServiceSimplified
#include "orionld/orionldRestServices.h" // Own Interface


Expand Down
5 changes: 3 additions & 2 deletions src/lib/cache/CachedSubscription.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
#include "common/RenderFormat.h"
#include "apiTypesV2/HttpInfo.h" // HttpInfo
#include "apiTypesV2/SubscriptionExpression.h"
#include "orionld/q/QNode.h" // QNode
#include "orionld/context/OrionldContext.h" // OrionldContext

#include "orionld/types/QNode.h" // QNode
#include "orionld/types/Protocol.h" // Protocol
#include "orionld/types/OrionldAlteration.h" // OrionldAlterationTypes
#include "orionld/types/OrionldTenant.h" // OrionldTenant
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
2 changes: 1 addition & 1 deletion src/lib/mongoBackend/MongoGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ extern "C"
#include "orionld/common/tenantList.h" // tenant0
#include "orionld/common/dotForEq.h" // dotForEq
#include "orionld/common/performance.h" // REQUEST_PERFORMANCE, PERFORMANCE*, performanceTimestamps
#include "orionld/rest/OrionLdRestService.h" // OrionLdRestService
#include "orionld/types/OrionLdRestService.h" // OrionLdRestService
#include "orionld/serviceRoutines/orionldPostSubscriptions.h" // orionldPostSubscriptions
#endif

Expand Down
1 change: 1 addition & 0 deletions src/lib/orionld/common/orionldRequestSend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldHttpHeader.h" // OrionldHttpHeader
#include "orionld/context/orionldCoreContext.h" // orionldDefaultUrlContext, ...
#include "orionld/common/orionldState.h" // orionldState, debugCurl
#include "orionld/common/orionldRequestSend.h" // Own interface
Expand Down
32 changes: 2 additions & 30 deletions src/lib/orionld/common/orionldRequestSend.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,36 +25,8 @@
*
* Author: Ken Zangelin
*/
#include "orionld/common/OrionldResponseBuffer.h"



// -----------------------------------------------------------------------------
//
// OrionldHttpHeaderType -
//
typedef enum OrionldHttpHeaderType
{
HttpHeaderNone, // Marks the end of the vector
HttpHeaderContentType,
HttpHeaderAccept,
HttpHeaderLink,
HttpHeaderTenant,
HttpHeaderPath,
HttpHeaderXauth
} OrionldHttpHeaderType;



// -----------------------------------------------------------------------------
//
// OrionldHttpHeader -
//
typedef struct OrionldHttpHeader
{
OrionldHttpHeaderType type;
char* value;
} OrionldHttpHeader;
#include "orionld/types/OrionldResponseBuffer.h"
#include "orionld/types/OrionldHttpHeader.h"



Expand Down
5 changes: 2 additions & 3 deletions src/lib/orionld/common/orionldState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,12 @@ extern "C"

#include "orionld/types/OrionldGeoIndex.h" // OrionldGeoIndex
#include "orionld/types/OrionldTenant.h" // OrionldTenant
#include "orionld/types/QNode.h" // QNode
#include "orionld/types/PernotSubCache.h" // PernotSubCache
#include "orionld/db/dbConfiguration.h" // DB_DRIVER_MONGOC
#include "orionld/context/orionldCoreContext.h" // orionldCoreContext, ORIONLD_CORE_CONTEXT_URL_V*
#include "orionld/troe/troe.h" // TroeMode
#include "orionld/common/numberToDate.h" // numberToDate
#include "orionld/q/QNode.h" // QNode
#include "orionld/common/performance.h" // REQUEST_PERFORMANCE
#include "orionld/pernot/PernotSubCache.h" // PernotSubCache
#include "orionld/common/orionldState.h" // Own interface


Expand Down
14 changes: 7 additions & 7 deletions src/lib/orionld/common/orionldState.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,7 @@ extern "C"
#include "rest/Verb.h" // Verb
#include "parse/CompoundValueNode.h" // orion::CompoundValueNode

#include "orionld/common/performance.h" // REQUEST_PERFORMANCE
#include "orionld/common/OrionldResponseBuffer.h" // OrionldResponseBuffer
#include "orionld/kjTree/kjTreeLog.h" // Because it is so often used but then removed again ...
#include "orionld/types/OrionldResponseBuffer.h" // OrionldResponseBuffer
#include "orionld/types/OrionldProblemDetails.h" // OrionldProblemDetails
#include "orionld/types/OrionldGeoIndex.h" // OrionldGeoIndex
#include "orionld/types/OrionldPrefixCache.h" // OrionldPrefixCache
Expand All @@ -61,10 +59,12 @@ extern "C"
#include "orionld/types/OrionldAlteration.h" // OrionldAlteration
#include "orionld/types/StringArray.h" // StringArray
#include "orionld/types/EntityMap.h" // EntityMap
#include "orionld/forwarding/DistOp.h" // DistOp
#include "orionld/troe/troe.h" // TroeMode
#include "orionld/pernot/PernotSubCache.h" // PernotSubCache
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/PernotSubCache.h" // PernotSubCache
#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/types/DistOp.h" // DistOp
#include "orionld/types/TroeMode.h" // TroeMode
#include "orionld/common/performance.h" // REQUEST_PERFORMANCE
#include "orionld/kjTree/kjTreeLog.h" // Because it is so often used but then removed again ...



Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/common/responseFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ extern "C"

#include "rest/httpHeaderAdd.h" // httpHeaderLocationAdd, httpHeaderLinkAdd

#include "orionld/types/DistOpType.h" // DistOpType
#include "orionld/common/orionldState.h" // orionldState
#include "orionld/kjTree/kjChildCount.h" // kjChildCount
#include "orionld/kjTree/kjSort.h" // kjStringArraySort
#include "orionld/forwarding/DistOp.h" // DistOpType
#include "orionld/common/responseFix.h" // Own interface


Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/common/responseFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C"
#include "kjson/KjNode.h" // KjNode
}

#include "orionld/forwarding/DistOp.h" // DistOpType
#include "orionld/types/DistOp.h" // DistOpType



Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/common/subCacheApiSubscriptionInsert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ extern "C"
#include "cache/subCache.h" // subCacheItemInsert
#include "common/RenderFormat.h" // RenderFormat, stringToRenderFormat

#include "orionld/q/QNode.h" // QNode
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/QNode.h" // QNode
#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/dbModel/dbModelToApiCoordinates.h" // dbModelToApiCoordinates
#include "orionld/mqtt/mqttParse.h" // mqttParse
#include "orionld/common/mimeTypeFromString.h" // mimeTypeFromString
Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/common/subCacheApiSubscriptionInsert.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ extern "C"
#include "common/RenderFormat.h" // RenderFormat
#include "cache/subCache.h" // CachedSubscription

#include "orionld/q/QNode.h" // QNode
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/QNode.h" // QNode
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/context/orionldAttributeExpand.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
*
* Author: Ken Zangelin
*/
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/context/OrionldContextItem.h" // OrionldContextItem
#include "orionld/types/OrionldContextItem.h" // OrionldContextItem
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextCreate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C"
#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/common/orionldState.h" // orionldState, kalloc


Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextCreate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* Author: Ken Zangelin
*/
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/context/orionldContextDownload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ extern "C"
}

#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/common/orionldState.h" // orionldState, contextDownloadAttempts, ...
#include "orionld/types/OrionldResponseErrorType.h" // OrionldResponseErrorType
#include "orionld/types/OrionldHttpHeader.h"
#include "orionld/common/orionldState.h" // orionldState, contextDownloadAttempts, ...
#include "orionld/common/urlParse.h" // urlParse
#include "orionld/common/orionldRequestSend.h" // orionldRequestSend
#include "orionld/context/orionldContextDownload.h" // Own interface
Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ extern "C"
#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldContext.h" // OrionldContext, OrionldContextOrigin
#include "orionld/common/orionldState.h" // orionldState
#include "orionld/common/orionldError.h" // orionldError
#include "orionld/context/OrionldContext.h" // OrionldContext, OrionldContextOrigin
#include "orionld/context/orionldContextFromTree.h" // orionldContextFromTree
#include "orionld/context/orionldContextFromBuffer.h" // Own interface

Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromBuffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* Author: Ken Zangelin
*/
#include "orionld/context/OrionldContext.h" // OrionldContext, OrionldContextOrigin
#include "orionld/types/OrionldContext.h" // OrionldContext, OrionldContextOrigin



Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/context/orionldContextFromObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ extern "C"
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldProblemDetails.h" // OrionldProblemDetails, orionldProblemDetailsFill
#include "orionld/types/OrionldContextItem.h" // OrionldContextItem
#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/common/orionldState.h" // kalloc, orionldState
#include "orionld/context/OrionldContextItem.h" // OrionldContextItem
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/context/orionldContextCreate.h" // orionldContextCreate
#include "orionld/context/orionldContextUrlGenerate.h" // orionldContextUrlGenerate
#include "orionld/contextCache/orionldContextCache.h" // ORIONLD_CONTEXT_CACHE_HASH_ARRAY_SIZE
Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C"
#include "kjson/KjNode.h" // KjNode
}

#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ extern "C"
#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/common/orionldState.h" // orionldState, kalloc, coreContextUrl
#include "orionld/common/orionldError.h" // orionldError
#include "orionld/context/orionldCoreContext.h" // orionldCoreContextP
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/context/orionldContextUrlGenerate.h" // orionldContextUrlGenerate
#include "orionld/context/orionldContextSimplify.h" // orionldContextSimplify
#include "orionld/context/orionldContextFromUrl.h" // orionldContextFromUrl
Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C"
#include "kjson/KjNode.h" // KjNode
}

#include "orionld/context/OrionldContext.h" // OrionldContext, OrionldContextOrigin
#include "orionld/types/OrionldContext.h" // OrionldContext, OrionldContextOrigin



Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromUrl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#include "logMsg/logMsg.h" // LM_*
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldContext.h" // OrionldContext
#include "orionld/common/orionldState.h" // orionldState
#include "orionld/common/orionldError.h" // orionldError
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/context/orionldContextFromBuffer.h" // orionldContextFromBuffer
#include "orionld/contextCache/orionldContextCacheLookup.h" // orionldContextCacheLookup
#include "orionld/context/orionldContextDownload.h" // orionldContextDownload
Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextFromUrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* Author: Ken Zangelin
*/
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
4 changes: 2 additions & 2 deletions src/lib/orionld/context/orionldContextHashTablesFill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ extern "C"
#include "logMsg/traceLevels.h" // Lmt*

#include "orionld/types/OrionldProblemDetails.h" // OrionldProblemDetails, orionldProblemDetailsFill
#include "orionld/types/OrionldContextItem.h" // OrionldContextItem
#include "orionld/types/OrionldContext.h" // OrionldContext, OrionldContextHashTables
#include "orionld/common/orionldState.h" // orionldState, kalloc
#include "orionld/context/OrionldContext.h" // OrionldContext, OrionldContextHashTables
#include "orionld/contextCache/orionldContextCache.h" // ORIONLD_CONTEXT_CACHE_HASH_ARRAY_SIZE
#include "orionld/context/OrionldContextItem.h" // OrionldContextItem
#include "orionld/context/orionldContextPrefixExpand.h" // orionldContextPrefixExpand
#include "orionld/context/orionldContextHashTablesFill.h" // Own interface

Expand Down
2 changes: 1 addition & 1 deletion src/lib/orionld/context/orionldContextHashTablesFill.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extern "C"
}

#include "orionld/types/OrionldProblemDetails.h" // OrionldProblemDetails, orionldProblemDetailsFill
#include "orionld/context/OrionldContext.h" // OrionldContext
#include "orionld/types/OrionldContext.h" // OrionldContext



Expand Down
Loading
Loading