Skip to content

Commit

Permalink
tidying up legacy headers
Browse files Browse the repository at this point in the history
  • Loading branch information
stephen-dixon committed Aug 7, 2024
1 parent 7925cd7 commit b0bae6c
Show file tree
Hide file tree
Showing 5 changed files with 173 additions and 222 deletions.
2 changes: 0 additions & 2 deletions source/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ set( SRC_FILES
udaPutAPI.cpp
udaClient.cpp
udaClientHostList.cpp
legacy_accAPI.cpp
legacy_client.cpp
)

set( HEADER_FILES
Expand Down
169 changes: 0 additions & 169 deletions source/client/legacy_accAPI.cpp

This file was deleted.

197 changes: 162 additions & 35 deletions source/client/legacy_accAPI.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef LEGACY_ACCAPI_H
#define LEGACY_ACCAPI_H
#ifndef UDA_LEGACY_ACCAPI_H
#define UDA_LEGACY_ACCAPI_H

#include <clientserver/export.h>
#include "udaClient.h"
Expand All @@ -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

Expand All @@ -55,4 +182,4 @@ extern "C" {
#endif


#endif // LEGACY_ACCAPI_H
#endif // UDA_LEGACY_ACCAPI_H
Loading

0 comments on commit b0bae6c

Please sign in to comment.