From b0bae6cfdfe3e3a614da54463f690ae3428d017e Mon Sep 17 00:00:00 2001 From: sdixon Date: Wed, 7 Aug 2024 16:09:21 +0100 Subject: [PATCH] tidying up legacy headers --- source/client/CMakeLists.txt | 2 - source/client/legacy_accAPI.cpp | 169 --------------------------- source/client/legacy_accAPI.h | 197 ++++++++++++++++++++++++++------ source/client/legacy_client.cpp | 12 -- source/client/legacy_client.h | 15 ++- 5 files changed, 173 insertions(+), 222 deletions(-) delete mode 100644 source/client/legacy_accAPI.cpp delete mode 100644 source/client/legacy_client.cpp diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index cbaccd81..a648bc06 100755 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -48,8 +48,6 @@ set( SRC_FILES udaPutAPI.cpp udaClient.cpp udaClientHostList.cpp - legacy_accAPI.cpp - legacy_client.cpp ) set( HEADER_FILES diff --git a/source/client/legacy_accAPI.cpp b/source/client/legacy_accAPI.cpp deleted file mode 100644 index 04fd1e58..00000000 --- a/source/client/legacy_accAPI.cpp +++ /dev/null @@ -1,169 +0,0 @@ -#include "legacy_accAPI.h" -#include "accAPI.h" - -#ifdef UDA_CLIENT_FLAGS_API - - DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) - { - return udaGetCurrentDataBlock(); - } - - int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) - { - return udaGetCurrentDataBlockIndex(); - } - - int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) - { - return udaGrowDataBlocks(); - } - - int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) - { - return udaGetNewDataHandle(); - } - - void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) - { - udaSetClientFlag(flag); - } - - void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) - { - udaResetClientFlag(flag); - } - - void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) - { - udaSetProperty(property); - } - - int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) - { - return udaGetProperty(property); - } - - void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) - { - udaResetProperty(property); - } - - void resetIdamProperties(CLIENT_FLAGS* client_flags) - { - udaResetProperties(); - } - - CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) - { - return udaSaveProperties(); - } - - void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) - { - udaRestoreProperties(cb); - } - - int getIdamLastHandle(CLIENT_FLAGS* client_flags) - { - return udaGetLastHandle(); - } - - void lockIdamThread(CLIENT_FLAGS* client_flags) - { - udaLockThread(); - } - - void unlockUdaThread(CLIENT_FLAGS* client_flags) - { - udaUnlockThread(); - } - - void freeIdamThread(CLIENT_FLAGS* client_flags) - { - udaFreeThread(); - } - -#else - - DATA_BLOCK* acc_getCurrentDataBlock() - { - return udaGetCurrentDataBlock(); - } - - int acc_getCurrentDataBlockIndex() - { - return udaGetCurrentDataBlockIndex(); - } - - int acc_growIdamDataBlocks() - { - return udaGrowDataBlocks(); - } - - int acc_getIdamNewDataHandle() - { - return udaGetNewDataHandle(); - } - - void setIdamClientFlag(unsigned int flag) - { - udaSetClientFlag(flag); - } - - void resetIdamClientFlag(unsigned int flag) - { - udaResetClientFlag(flag); - } - - void setIdamProperty(const char* property) - { - udaSetProperty(property); - } - - int getIdamProperty(const char* property) - { - return udaGetProperty(property); - } - - void resetIdamProperty(const char* property) - { - udaResetProperty(property); - } - - void resetIdamProperties() - { - udaResetProperties(); - } - - CLIENT_BLOCK saveIdamProperties() - { - return udaSaveProperties(); - } - - void restoreIdamProperties(CLIENT_BLOCK cb) - { - udaRestoreProperties(cb); - } - - int getIdamLastHandle() - { - return udaGetLastHandle(); - } - - void lockIdamThread() - { - udaLockThread(); - } - - void unlockUdaThread() - { - udaUnlockThread(); - } - - void freeIdamThread() - { - udaFreeThread(); - } - -#endif // UDA_LEGACY_API - diff --git a/source/client/legacy_accAPI.h b/source/client/legacy_accAPI.h index f7c0fa02..0e285133 100644 --- a/source/client/legacy_accAPI.h +++ b/source/client/legacy_accAPI.h @@ -1,5 +1,5 @@ -#ifndef LEGACY_ACCAPI_H -#define LEGACY_ACCAPI_H +#ifndef UDA_LEGACY_ACCAPI_H +#define UDA_LEGACY_ACCAPI_H #include #include "udaClient.h" @@ -12,40 +12,167 @@ extern "C" { #ifdef UDA_CLIENT_FLAGS_API // #warning "Using legacy API names with redundant \"client_flags\" arguments, these will be deprecated in future" - LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags); - LIBRARY_API int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags); - LIBRARY_API void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); - LIBRARY_API void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag); - LIBRARY_API void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags); - LIBRARY_API int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags); - LIBRARY_API void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags); - LIBRARY_API void resetIdamProperties(CLIENT_FLAGS* client_flags); - LIBRARY_API CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags); - LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags); - LIBRARY_API int getIdamLastHandle(CLIENT_FLAGS* client_flags); - LIBRARY_API void lockIdamThread(CLIENT_FLAGS* client_flags); - LIBRARY_API void unlockUdaThread(CLIENT_FLAGS* client_flags); - LIBRARY_API void freeIdamThread(CLIENT_FLAGS* client_flags); + LIBRARY_API inline DATA_BLOCK* acc_getCurrentDataBlock(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlock(); + } + + LIBRARY_API inline int acc_getCurrentDataBlockIndex(CLIENT_FLAGS* client_flags) + { + return udaGetCurrentDataBlockIndex(); + } + + LIBRARY_API inline int acc_growIdamDataBlocks(CLIENT_FLAGS* client_flags) + { + return udaGrowDataBlocks(); + } + + LIBRARY_API inline int acc_getIdamNewDataHandle(CLIENT_FLAGS* client_flags) + { + return udaGetNewDataHandle(); + } + + LIBRARY_API inline void setIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaSetClientFlag(flag); + } + + LIBRARY_API inline void resetIdamClientFlag(CLIENT_FLAGS* client_flags, unsigned int flag) + { + udaResetClientFlag(flag); + } + + LIBRARY_API inline void setIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaSetProperty(property); + } + + LIBRARY_API inline int getIdamProperty(const char* property, const CLIENT_FLAGS* client_flags) + { + return udaGetProperty(property); + } + + LIBRARY_API inline void resetIdamProperty(const char* property, CLIENT_FLAGS* client_flags) + { + udaResetProperty(property); + } + + LIBRARY_API inline void resetIdamProperties(CLIENT_FLAGS* client_flags) + { + udaResetProperties(); + } + + CLIENT_BLOCK saveIdamProperties(const CLIENT_FLAGS* client_flags) + { + return udaSaveProperties(); + } + + LIBRARY_API inline void restoreIdamProperties(CLIENT_BLOCK cb, CLIENT_FLAGS* client_flags) + { + udaRestoreProperties(cb); + } + + LIBRARY_API inline int getIdamLastHandle(CLIENT_FLAGS* client_flags) + { + return udaGetLastHandle(); + } + + LIBRARY_API inline void lockIdamThread(CLIENT_FLAGS* client_flags) + { + udaLockThread(); + } + + LIBRARY_API inline void unlockUdaThread(CLIENT_FLAGS* client_flags) + { + udaUnlockThread(); + } + + LIBRARY_API inline void freeIdamThread(CLIENT_FLAGS* client_flags) + { + udaFreeThread(); + } + #else - LIBRARY_API DATA_BLOCK* acc_getCurrentDataBlock(); - LIBRARY_API int acc_getCurrentDataBlockIndex(); - LIBRARY_API int acc_growIdamDataBlocks(); - LIBRARY_API int acc_getIdamNewDataHandle(); - LIBRARY_API void setIdamClientFlag(unsigned int flag); - LIBRARY_API void resetIdamClientFlag(unsigned int flag); - LIBRARY_API void setIdamProperty(const char* property); - LIBRARY_API int getIdamProperty(const char* property); - LIBRARY_API void resetIdamProperty(const char* property); - LIBRARY_API void resetIdamProperties(); - LIBRARY_API CLIENT_BLOCK saveIdamProperties(); - LIBRARY_API void restoreIdamProperties(CLIENT_BLOCK cb); - LIBRARY_API int getIdamLastHandle(); - LIBRARY_API void lockIdamThread(); - LIBRARY_API void unlockUdaThread(); - LIBRARY_API void freeIdamThread(); + LIBRARY_API inline DATA_BLOCK* acc_getCurrentDataBlock() + { + return udaGetCurrentDataBlock(); + } + + LIBRARY_API inline int acc_getCurrentDataBlockIndex() + { + return udaGetCurrentDataBlockIndex(); + } + + LIBRARY_API inline int acc_growIdamDataBlocks() + { + return udaGrowDataBlocks(); + } + + LIBRARY_API inline int acc_getIdamNewDataHandle() + { + return udaGetNewDataHandle(); + } + + LIBRARY_API inline void setIdamClientFlag(unsigned int flag) + { + udaSetClientFlag(flag); + } + + LIBRARY_API inline void resetIdamClientFlag(unsigned int flag) + { + udaResetClientFlag(flag); + } + + LIBRARY_API inline void setIdamProperty(const char* property) + { + udaSetProperty(property); + } + + LIBRARY_API inline int getIdamProperty(const char* property) + { + return udaGetProperty(property); + } + + LIBRARY_API inline void resetIdamProperty(const char* property) + { + udaResetProperty(property); + } + + LIBRARY_API inline void resetIdamProperties() + { + udaResetProperties(); + } + + LIBRARY_API inline CLIENT_BLOCK saveIdamProperties() + { + return udaSaveProperties(); + } + + LIBRARY_API inline void restoreIdamProperties(CLIENT_BLOCK cb) + { + udaRestoreProperties(cb); + } + + LIBRARY_API inline int getIdamLastHandle() + { + return udaGetLastHandle(); + } + + LIBRARY_API inline void lockIdamThread() + { + udaLockThread(); + } + + LIBRARY_API inline void unlockUdaThread() + { + udaUnlockThread(); + } + + LIBRARY_API inline void freeIdamThread() + { + udaFreeThread(); + } #endif @@ -55,4 +182,4 @@ extern "C" { #endif -#endif // LEGACY_ACCAPI_H +#endif // UDA_LEGACY_ACCAPI_H diff --git a/source/client/legacy_client.cpp b/source/client/legacy_client.cpp deleted file mode 100644 index a3c61cba..00000000 --- a/source/client/legacy_client.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "legacy_client.h" - -void idamFree(int handle) -{ - udaFree(handle); -} - -void idamFreeAll() -{ - udaFreeAll(); -} - diff --git a/source/client/legacy_client.h b/source/client/legacy_client.h index 761dd1b7..9c557c21 100644 --- a/source/client/legacy_client.h +++ b/source/client/legacy_client.h @@ -1,5 +1,5 @@ -#ifndef LEGACY_CLIENT_H -#define LEGACY_CLIENT_H +#ifndef UDA_LEGACY_CLIENT_H +#define UDA_LEGACY_CLIENT_H #include #include "udaClient.h" @@ -8,8 +8,15 @@ extern "C" { #endif -LIBRARY_API void idamFree(int handle); -LIBRARY_API void idamFreeAll(); +LIBRARY_API inline void idamFree(int handle) +{ + udaFree(handle); +} + +LIBRARY_API inline void idamFreeAll() +{ + udaFreeAll() +} #ifdef __cplusplus }