From 49bcbf23a01e26e3e712e308431d91de6eb4e58c Mon Sep 17 00:00:00 2001 From: sdixon Date: Fri, 26 Jan 2024 16:12:28 +0000 Subject: [PATCH] running clang-format --- source/cache/memcache.hpp | 20 +- source/client2/client.hpp | 48 ++-- source/client2/client_environment.hpp | 16 +- source/client2/client_xdr_stream.hpp | 18 +- source/client2/closedown.hpp | 21 +- source/client2/connection.hpp | 40 ++- source/client2/exceptions.hpp | 71 ++---- source/client2/generate_errors.hpp | 19 +- source/client2/handle.hpp | 12 +- source/client2/host_list.hpp | 21 +- source/client2/make_request_block.hpp | 14 +- source/client2/thread_client.hpp | 18 +- source/clientserver/manageSockets.cpp | 2 +- source/include/accAPI.h | 28 +-- source/include/accessors.h | 16 +- source/include/client.h | 32 +-- source/include/clientAPI.h | 2 +- source/include/errorLog.h | 2 +- source/include/legacy.h | 247 +++++++++---------- source/include/pluginStructs.h | 2 +- source/include/struct.h | 59 ++--- source/include/udaGetAPI.h | 2 +- source/include/udaPlugin.h | 12 +- source/plugins/uda_plugin_base.hpp | 61 ++--- source/server2/apply_XML.hpp | 15 +- source/server2/get_data.hpp | 14 +- source/server2/get_plugin_address.hpp | 9 +- source/server2/make_server_request_block.hpp | 23 +- source/server2/plugins.hpp | 20 +- source/server2/server.hpp | 30 +-- source/server2/server_environment.hpp | 16 +- source/server2/xdr_protocol.hpp | 28 +-- 32 files changed, 472 insertions(+), 466 deletions(-) mode change 100755 => 100644 source/cache/memcache.hpp mode change 100755 => 100644 source/client2/client_xdr_stream.hpp mode change 100755 => 100644 source/client2/closedown.hpp mode change 100755 => 100644 source/client2/connection.hpp mode change 100755 => 100644 source/client2/generate_errors.hpp mode change 100755 => 100644 source/client2/host_list.hpp mode change 100755 => 100644 source/client2/make_request_block.hpp mode change 100755 => 100644 source/server2/apply_XML.hpp mode change 100755 => 100644 source/server2/get_plugin_address.hpp mode change 100755 => 100644 source/server2/make_server_request_block.hpp mode change 100755 => 100644 source/server2/server_environment.hpp diff --git a/source/cache/memcache.hpp b/source/cache/memcache.hpp old mode 100755 new mode 100644 index fe8159e3..f0fbd21a --- a/source/cache/memcache.hpp +++ b/source/cache/memcache.hpp @@ -1,12 +1,14 @@ #ifndef UDA_CACHE_MEMCACHE_H #define UDA_CACHE_MEMCACHE_H -#include "udaStructs.h" -#include "genStructs.h" #include "export.h" +#include "genStructs.h" +#include "udaStructs.h" -namespace uda { -namespace cache { +namespace uda +{ +namespace cache +{ struct UdaCache; @@ -15,15 +17,15 @@ UdaCache* open_cache(); void free_cache(); int cache_write(uda::cache::UdaCache* cache, const REQUEST_DATA* request_data, DATA_BLOCK* data_block, - LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, - ENVIRONMENT environment, int protocolVersion, uint32_t flags, - LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); + LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, ENVIRONMENT environment, + int protocolVersion, uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, + int malloc_source); DATA_BLOCK* cache_read(uda::cache::UdaCache* cache, const REQUEST_DATA* request_data, LOGMALLOCLIST* logmalloclist, USERDEFINEDTYPELIST* userdefinedtypelist, ENVIRONMENT environment, int protocolVersion, uint32_t flags, LOGSTRUCTLIST* log_struct_list, unsigned int private_flags, int malloc_source); -} -} +} // namespace cache +} // namespace uda #endif // UDA_CACHE_MEMCACHE_H diff --git a/source/client2/client.hpp b/source/client2/client.hpp index 79d8708e..6a492e87 100644 --- a/source/client2/client.hpp +++ b/source/client2/client.hpp @@ -1,26 +1,28 @@ #pragma once #ifndef UDA_SOURCE_CLIENT2_CLIENT_H -#define UDA_SOURCE_CLIENT2_CLIENT_H +# define UDA_SOURCE_CLIENT2_CLIENT_H -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include -#include "udaStructs.h" -#include +# include "udaStructs.h" +# include -#include "connection.hpp" -#include "host_list.hpp" -#include "accAPI.h" +# include "accAPI.h" +# include "connection.hpp" +# include "host_list.hpp" constexpr auto DefaultHost = "localhost"; constexpr auto DefaultPort = 56565; -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ constexpr int ClientVersion = 8; @@ -34,7 +36,7 @@ struct MetadataBlock { class Client { -public: + public: Client(); int get(std::string_view data_signal, std::string_view data_source); @@ -49,8 +51,8 @@ class Client DATA_BLOCK* current_data_block(); DATA_BLOCK* data_block(int handle); int new_handle(); - void set_flag(unsigned int flag, bool private_flag=false); - void reset_flag(unsigned int flag, bool private_flag=false); + void set_flag(unsigned int flag, bool private_flag = false); + void reset_flag(unsigned int flag, bool private_flag = false); void set_property(const char* property); int get_property(const char* property); void reset_property(const char* property); @@ -66,7 +68,7 @@ class Client Client(const Client&) = delete; Client& operator=(const Client&) = delete; -private: + private: int get_requests(RequestBlock& request_block, int* indices); void concat_errors(UDA_ERROR_STACK* error_stack); const char* get_server_error_stack_record_msg(int record); @@ -78,7 +80,7 @@ class Client int alt_rank_ = 0; ENVIRONMENT environment_ = {}; ClientFlags client_flags_ = {}; - uint32_t private_flags_= 0; + uint32_t private_flags_ = 0; ClientBlock client_block_ = {}; ServerBlock server_block_ = {}; std::vector data_blocks_ = {}; @@ -94,8 +96,8 @@ class Client bool reopen_logs_ = false; std::string client_username_ = "client"; int protocol_version_ = ClientVersion; - USERDEFINEDTYPELIST* userdefinedtypelist_ = nullptr; // List of all known User Defined Structure Types - LOGMALLOCLIST* logmalloclist_ = nullptr; // List of all Heap Allocations for Data + USERDEFINEDTYPELIST* userdefinedtypelist_ = nullptr; // List of all known User Defined Structure Types + LOGMALLOCLIST* logmalloclist_ = nullptr; // List of all Heap Allocations for Data NTREE* full_ntree_ = nullptr; LOGSTRUCTLIST log_struct_list_ = {}; int malloc_source_ = UDA_MALLOC_SOURCE_NONE; @@ -112,7 +114,7 @@ class Client int fetch_hierarchical_data(DATA_BLOCK* data_block); }; -} -} +} // namespace client +} // namespace uda -#endif //UDA_SOURCE_CLIENT2_CLIENT_H +#endif // UDA_SOURCE_CLIENT2_CLIENT_H diff --git a/source/client2/client_environment.hpp b/source/client2/client_environment.hpp index 7af45eb4..f5599d45 100644 --- a/source/client2/client_environment.hpp +++ b/source/client2/client_environment.hpp @@ -1,17 +1,19 @@ #pragma once #ifndef UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H -#define UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H +# define UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H -#include "udaStructs.h" +# include "udaStructs.h" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ Environment load_environment(bool* env_host, bool* env_port); void print_client_environment(const Environment& environment); -} -} +} // namespace client +} // namespace uda -#endif //UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H +#endif // UDA_SOURCE_CLIENT2_CLIENT_ENVIRONMENT_H diff --git a/source/client2/client_xdr_stream.hpp b/source/client2/client_xdr_stream.hpp old mode 100755 new mode 100644 index c393d9d7..c77d92e3 --- a/source/client2/client_xdr_stream.hpp +++ b/source/client2/client_xdr_stream.hpp @@ -1,20 +1,22 @@ #pragma once #ifndef UDA_CLIENT_CLIENTXDRSTREAM_H -#define UDA_CLIENT_CLIENTXDRSTREAM_H +# define UDA_CLIENT_CLIENTXDRSTREAM_H -#include -#include +# include +# include -#include "export.h" -#include "connection.hpp" +# include "connection.hpp" +# include "export.h" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ std::pair createXDRStream(IoData* io_data); } -} +} // namespace uda #endif // UDA_CLIENT_CLIENTXDRSTREAM_H diff --git a/source/client2/closedown.hpp b/source/client2/closedown.hpp old mode 100755 new mode 100644 index c52bd89e..2323671d --- a/source/client2/closedown.hpp +++ b/source/client2/closedown.hpp @@ -1,13 +1,15 @@ #pragma once #ifndef UDA_CLIENT_CLOSEDOWN_H -#define UDA_CLIENT_CLOSEDOWN_H +# define UDA_CLIENT_CLOSEDOWN_H -#include -#include "export.h" +# include "export.h" +# include -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ enum class ClosedownType { CLOSE_SOCKETS = 0, @@ -16,11 +18,10 @@ enum class ClosedownType { class Connection; -int -closedown(ClosedownType type, Connection* connection, XDR* client_input, XDR* client_output, bool* reopen_logs, - bool* env_host, bool* env_port); +int closedown(ClosedownType type, Connection* connection, XDR* client_input, XDR* client_output, bool* reopen_logs, + bool* env_host, bool* env_port); -} -} +} // namespace client +} // namespace uda #endif // UDA_CLIENT_CLOSEDOWN_H diff --git a/source/client2/connection.hpp b/source/client2/connection.hpp old mode 100755 new mode 100644 index de84db11..cbeefef2 --- a/source/client2/connection.hpp +++ b/source/client2/connection.hpp @@ -1,18 +1,20 @@ #pragma once #ifndef UDA_CLIENT_CONNECTION_H -#define UDA_CLIENT_CONNECTION_H +# define UDA_CLIENT_CONNECTION_H -#include +# include -#include -#include "udaStructs.h" -#include "export.h" +# include "export.h" +# include "udaStructs.h" +# include -#include "closedown.hpp" +# include "closedown.hpp" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ class HostList; @@ -20,24 +22,20 @@ struct IoData { int* client_socket; }; -class Connection { -public: - explicit Connection(Environment& environment) - : environment(environment) - , socket_list() - {} +class Connection +{ + public: + explicit Connection(Environment& environment) : environment(environment), socket_list() {} int open(); int reconnect(XDR** client_input, XDR** client_output, time_t* tv_server_start, int* user_timeout); int create(XDR* client_input, XDR* client_output, const HostList& host_list); void close_down(ClosedownType type); - IoData io_data() { - return IoData{ &client_socket }; - } + IoData io_data() { return IoData{&client_socket}; } -private: + private: int client_socket = -1; Environment& environment; - std::vector socket_list; // List of open sockets + std::vector socket_list; // List of open sockets int find_socket(int fh); void close_socket(int fh); @@ -46,7 +44,7 @@ class Connection { int writeout(void* iohandle, char* buf, int count); int readin(void* iohandle, char* buf, int count); -} -} +} // namespace client +} // namespace uda #endif // UDA_CLIENT_CONNECTION_H diff --git a/source/client2/exceptions.hpp b/source/client2/exceptions.hpp index c8d021ba..1db246e9 100644 --- a/source/client2/exceptions.hpp +++ b/source/client2/exceptions.hpp @@ -1,77 +1,60 @@ #pragma once #ifndef UDA_SOURCE_CLIENT2_EXCEPTIONS_H -#define UDA_SOURCE_CLIENT2_EXCEPTIONS_H +# define UDA_SOURCE_CLIENT2_EXCEPTIONS_H -#include -#include -#include -#include +# include +# include +# include +# include -namespace uda { -namespace exceptions { +namespace uda +{ +namespace exceptions +{ class UDAException : std::exception { -public: - UDAException(std::string_view msg) - { - msg_ = msg; - } + public: + UDAException(std::string_view msg) { msg_ = msg; } - template - UDAException(std::string_view msg, Args... args) + template UDAException(std::string_view msg, Args... args) { boost::format formatter{msg.data()}; msg_ = format(formatter, args...); } - const char* what() const noexcept override - { - return msg_.c_str(); - } + const char* what() const noexcept override { return msg_.c_str(); } -protected: + protected: std::string msg_; - std::string format(boost::format& formatter) { - return formatter.str(); - } + std::string format(boost::format& formatter) { return formatter.str(); } - template - std::string format(boost::format& formatter, Arg arg, Args... args) { + template std::string format(boost::format& formatter, Arg arg, Args... args) + { formatter = formatter % arg; return format(formatter, args...); } }; -class ClientError: UDAException +class ClientError : UDAException { -public: - ClientError(std::string_view msg) - : UDAException(msg) - {} + public: + ClientError(std::string_view msg) : UDAException(msg) {} - template - ClientError(std::string_view msg, Args... args) - : UDAException(msg, args...) - {} + template ClientError(std::string_view msg, Args... args) : UDAException(msg, args...) {} }; class ServerError : UDAException { -public: - ServerError(std::string_view msg) - : UDAException(msg) - {} + public: + ServerError(std::string_view msg) : UDAException(msg) {} - template - ServerError(std::string_view msg, Args... args) - : UDAException(msg, args...) - {} + template ServerError(std::string_view msg, Args... args) : UDAException(msg, args...) {} }; -} -} +} // namespace exceptions +} // namespace uda -#endif //UDA_SOURCE_CLIENT2_EXCEPTIONS_H +#endif // UDA_SOURCE_CLIENT2_EXCEPTIONS_H diff --git a/source/client2/generate_errors.hpp b/source/client2/generate_errors.hpp old mode 100755 new mode 100644 index 7ad914ea..392dd85d --- a/source/client2/generate_errors.hpp +++ b/source/client2/generate_errors.hpp @@ -1,21 +1,24 @@ #pragma once #ifndef UDA_CLIENT_GENERATEERRORS_H -#define UDA_CLIENT_GENERATEERRORS_H +# define UDA_CLIENT_GENERATEERRORS_H -#include "export.h" +# include "export.h" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ -int error_model(int model, int param_n, float *params, int data_n, float *data, int *asymmetry, float *errhi, float *errlo); -int synthetic_model(int model, int param_n, float *params, int data_n, float *data); +int error_model(int model, int param_n, float* params, int data_n, float* data, int* asymmetry, float* errhi, + float* errlo); +int synthetic_model(int model, int param_n, float* params, int data_n, float* data); int generate_synthetic_data(int handle); int generate_synthetic_dim_data(int handle, int ndim); int generate_data_error(int handle); int generate_dim_data_error(int handle, int ndim); -} -} +} // namespace client +} // namespace uda #endif // UDA_CLIENT_GENERATEERRORS_H \ No newline at end of file diff --git a/source/client2/handle.hpp b/source/client2/handle.hpp index b73471c2..c0caabfd 100644 --- a/source/client2/handle.hpp +++ b/source/client2/handle.hpp @@ -1,14 +1,16 @@ #pragma once #ifndef UDA_SOURCE_CLIENT2_HANDLE_H -#define UDA_SOURCE_CLIENT2_HANDLE_H +# define UDA_SOURCE_CLIENT2_HANDLE_H -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ void free_handle(int handle); } -} +} // namespace uda -#endif //UDA_SOURCE_CLIENT2_HANDLE_H +#endif // UDA_SOURCE_CLIENT2_HANDLE_H diff --git a/source/client2/host_list.hpp b/source/client2/host_list.hpp old mode 100755 new mode 100644 index c00b76e2..69410013 --- a/source/client2/host_list.hpp +++ b/source/client2/host_list.hpp @@ -1,28 +1,31 @@ #ifndef UDA_CLIENT_HOSTLIST_H #define UDA_CLIENT_HOSTLIST_H -#include -#include #include +#include +#include #include "export.h" #include -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ -class HostList { -public: +class HostList +{ + public: HostList(); ~HostList() = default; [[nodiscard]] const HostData* find_by_alias(std::string_view alias) const; [[nodiscard]] const HostData* find_by_name(std::string_view name) const; -private: + private: std::vector hosts_; }; -} -} +} // namespace client +} // namespace uda #endif // UDA_CLIENT_HOSTLIST_H diff --git a/source/client2/make_request_block.hpp b/source/client2/make_request_block.hpp old mode 100755 new mode 100644 index 86f5a318..f40d5d6e --- a/source/client2/make_request_block.hpp +++ b/source/client2/make_request_block.hpp @@ -1,18 +1,20 @@ #pragma once #ifndef UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H -#define UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H +# define UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H -#include "udaStructs.h" -#include "export.h" +# include "export.h" +# include "udaStructs.h" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ int make_request_block(const Environment* environment, const char** signals, const char** sources, int count, REQUEST_BLOCK* request_block); } -} +} // namespace uda #endif // UDA_CLIENT_MAKECLIENTREQUESTBLOCK_H \ No newline at end of file diff --git a/source/client2/thread_client.hpp b/source/client2/thread_client.hpp index 1ba18a23..e91453ba 100644 --- a/source/client2/thread_client.hpp +++ b/source/client2/thread_client.hpp @@ -5,15 +5,17 @@ #include "client.hpp" -namespace uda { -namespace client { +namespace uda +{ +namespace client +{ class ThreadClient { -public: + public: static uda::client::Client& instance(); -private: + private: ThreadClient() = default; ~ThreadClient() = default; @@ -23,7 +25,7 @@ class ThreadClient static void init_client(); }; -[[nodiscard]] DATA_BLOCK *get_data_block(int handle); +[[nodiscard]] DATA_BLOCK* get_data_block(int handle); [[nodiscard]] char* get_data(int handle); [[nodiscard]] char* get_synthetic_data(int handle); void set_synthetic_data(int handle, char* data); @@ -51,7 +53,7 @@ void set_data_err_lo(int handle, char* err_lo); void set_data_err_type(int handle, int type); void set_data_err_asymmetry(int handle, int asymmetry); -} -} +} // namespace client +} // namespace uda -#endif //UDA_SOURCE_CLIENT2_PERTHREADSINGLETON_H +#endif // UDA_SOURCE_CLIENT2_PERTHREADSINGLETON_H diff --git a/source/clientserver/manageSockets.cpp b/source/clientserver/manageSockets.cpp index 57255b97..7d4ac766 100644 --- a/source/clientserver/manageSockets.cpp +++ b/source/clientserver/manageSockets.cpp @@ -10,8 +10,8 @@ # include # include #else -# include # include +# include # define strcasecmp _stricmp # include #endif diff --git a/source/include/accAPI.h b/source/include/accAPI.h index 2354f714..acc82a27 100644 --- a/source/include/accAPI.h +++ b/source/include/accAPI.h @@ -15,15 +15,15 @@ extern "C" { #define UDA_NUM_CLIENT_THREADS 30 -LIBRARY_API DATA_BLOCK* udaGetCurrentDataBlock(); +LIBRARY_API DATA_BLOCK* udaGetCurrentDataBlock(); -LIBRARY_API int udaGetCurrentDataBlockIndex(); +LIBRARY_API int udaGetCurrentDataBlockIndex(); LIBRARY_API int udaGrowDataBlocks(); -LIBRARY_API int udaGetNewDataHandle(); +LIBRARY_API int udaGetNewDataHandle(); -LIBRARY_API void udaFreeDataBlocks(); +LIBRARY_API void udaFreeDataBlocks(); LIBRARY_API void udaSetPrivateFlag(unsigned int flag); @@ -117,13 +117,13 @@ LIBRARY_API int udaGetErrorAsymmetry(int handle); LIBRARY_API int udaGetErrorModelId(const char* model); -LIBRARY_API char* udaGetSyntheticData(int handle); +LIBRARY_API char* udaGetSyntheticData(int handle); -LIBRARY_API char* udaGetSyntheticDimData(int handle, int ndim); +LIBRARY_API char* udaGetSyntheticDimData(int handle, int ndim); -LIBRARY_API void udaSetSyntheticData(int handle, char* data); +LIBRARY_API void udaSetSyntheticData(int handle, char* data); -LIBRARY_API void udaSetSyntheticDimData(int handle, int ndim, char* data); +LIBRARY_API void udaSetSyntheticDimData(int handle, int ndim, char* data); LIBRARY_API char* udaGetSyntheticData(int handle); @@ -139,11 +139,11 @@ LIBRARY_API char* udaGetDataErrHi(int handle); LIBRARY_API int udaGetDataErrAsymmetry(int handle); -LIBRARY_API void udaSetDataErrAsymmetry(int handle, int asymmetry); +LIBRARY_API void udaSetDataErrAsymmetry(int handle, int asymmetry); -LIBRARY_API void udaSetDataErrType(int handle, int type); +LIBRARY_API void udaSetDataErrType(int handle, int type); -LIBRARY_API void udaSetDataErrLo(int handle, char* errlo); +LIBRARY_API void udaSetDataErrLo(int handle, char* errlo); LIBRARY_API char* udaGetDimErrLo(int handle, int ndim); @@ -151,11 +151,11 @@ LIBRARY_API char* udaGetDimErrHi(int handle, int ndim); LIBRARY_API int udaGetDimErrAsymmetry(int handle, int ndim); -LIBRARY_API void udaSetDimErrAsymmetry(int handle, int ndim, int asymmetry); +LIBRARY_API void udaSetDimErrAsymmetry(int handle, int ndim, int asymmetry); -LIBRARY_API void udaSetDimErrType(int handle, int ndim, int type); +LIBRARY_API void udaSetDimErrType(int handle, int ndim, int type); -LIBRARY_API void udaSetDimErrLo(int handle, int ndim, char* errlo); +LIBRARY_API void udaSetDimErrLo(int handle, int ndim, char* errlo); LIBRARY_API char* udaGetError(int handle); diff --git a/source/include/accessors.h b/source/include/accessors.h index a6664021..158c5cd7 100644 --- a/source/include/accessors.h +++ b/source/include/accessors.h @@ -23,7 +23,7 @@ extern "C" { * @return the Tree Node containing the named element. */ LIBRARY_API NTREE* udaFindNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - const char** lastname); + const char** lastname); /** Find (search type B) and return a Pointer to the named Data Tree Node with a data structure of the same name. * The name of the structure is also returned. @@ -36,7 +36,7 @@ LIBRARY_API NTREE* udaFindNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, * @return the Data Tree Node with the structure name. */ LIBRARY_API NTREE* udaFindNTreeStructure2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - const char** lastname); + const char** lastname); /** Find (search type A) and return a Pointer to the Data Tree Node with a data structure that contains a named element. * @@ -142,8 +142,8 @@ LIBRARY_API int udaMaxCountVlenStructureArray(NTREE* tree, const char* target, i * @return An integer returning an error code: 0 => OK. */ LIBRARY_API int udaRegulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, - USERDEFINEDTYPELIST* userdefinedtypelist, const char* target, - unsigned int count); + USERDEFINEDTYPELIST* userdefinedtypelist, const char* target, + unsigned int count); /** Regularise the Shape of All VLEN structured data arrays in the data tree: necessary for accessing in some languages, * e.g. IDL. @@ -154,7 +154,7 @@ LIBRARY_API int udaRegulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* * @return An integer returning an error code: 0 => OK. */ LIBRARY_API int udaRegulariseVlenData(LOGMALLOCLIST* logmalloclist, NTREE* tree, - USERDEFINEDTYPELIST* userdefinedtypelist); + USERDEFINEDTYPELIST* userdefinedtypelist); //--------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------- @@ -242,10 +242,10 @@ LIBRARY_API void udaPrintImage(const char* image, int imagecount); * @return Void */ LIBRARY_API void udaDefineField(COMPOUNDFIELD* field, const char* name, const char* desc, int* offset, - unsigned short type_id); + unsigned short type_id); -LIBRARY_API void udaDefineCompoundField(COMPOUNDFIELD* field, const char* type, const char* name, char* desc, int offset, - int size); +LIBRARY_API void udaDefineCompoundField(COMPOUNDFIELD* field, const char* type, const char* name, char* desc, + int offset, int size); #ifdef __cplusplus } diff --git a/source/include/client.h b/source/include/client.h index fc0cc8ed..285af637 100644 --- a/source/include/client.h +++ b/source/include/client.h @@ -74,37 +74,37 @@ LIBRARY_API const char* udaGetBuildVersion(); */ LIBRARY_API const char* udaGetBuildDate(); -LIBRARY_API const char* udaGetServerHost(); +LIBRARY_API const char* udaGetServerHost(); -LIBRARY_API int udaGetServerPort(); +LIBRARY_API int udaGetServerPort(); -LIBRARY_API int udaGetServerSocket(); +LIBRARY_API int udaGetServerSocket(); -LIBRARY_API const char* udaGetClientDOI(); +LIBRARY_API const char* udaGetClientDOI(); -LIBRARY_API const char* udaGetServerDOI(); +LIBRARY_API const char* udaGetServerDOI(); -LIBRARY_API const char* udaGetClientOSName(); +LIBRARY_API const char* udaGetClientOSName(); -LIBRARY_API const char* udaGetServerOSName(); +LIBRARY_API const char* udaGetServerOSName(); -LIBRARY_API int udaGetClientVersion(); +LIBRARY_API int udaGetClientVersion(); -LIBRARY_API int udaGetServerVersion(); +LIBRARY_API int udaGetServerVersion(); -LIBRARY_API int udaGetServerErrorCode(); +LIBRARY_API int udaGetServerErrorCode(); -LIBRARY_API const char* udaGetServerErrorMsg(); +LIBRARY_API const char* udaGetServerErrorMsg(); -LIBRARY_API int udaGetServerErrorStackSize(); +LIBRARY_API int udaGetServerErrorStackSize(); -LIBRARY_API int udaGetServerErrorStackRecordType(int record); +LIBRARY_API int udaGetServerErrorStackRecordType(int record); -LIBRARY_API int udaGetServerErrorStackRecordCode(int record); +LIBRARY_API int udaGetServerErrorStackRecordCode(int record); -LIBRARY_API const char* udaGetServerErrorStackRecordLocation(int record); +LIBRARY_API const char* udaGetServerErrorStackRecordLocation(int record); -LIBRARY_API const char* udaGetServerErrorStackRecordMsg(int record); +LIBRARY_API const char* udaGetServerErrorStackRecordMsg(int record); LIBRARY_API void udaCloseAllConnections(); diff --git a/source/include/clientAPI.h b/source/include/clientAPI.h index 648682b6..e4fc38c9 100644 --- a/source/include/clientAPI.h +++ b/source/include/clientAPI.h @@ -11,7 +11,7 @@ extern "C" { LIBRARY_API int udaClientAPI(const char* file, const char* signal, int pass, int exp_number); LIBRARY_API int udaClientFileAPI(const char* file, const char* signal, const char* format); LIBRARY_API int udaClientFileAPI2(const char* file, const char* format, const char* owner, const char* signal, - int exp_number, int pass); + int exp_number, int pass); LIBRARY_API int udaClientTestAPI(const char* file, const char* signal, int pass, int exp_number); #ifdef __cplusplus diff --git a/source/include/errorLog.h b/source/include/errorLog.h index 9f5159ef..76184e7e 100644 --- a/source/include/errorLog.h +++ b/source/include/errorLog.h @@ -35,7 +35,7 @@ LIBRARY_API void udaCloseError(void); #define UDA_ADD_ERROR(ERR, MSG) udaAddError(UDA_CODE_ERROR_TYPE, __func__, ERR, MSG) #define UDA_ADD_SYS_ERROR(MSG) udaAddError(UDA_SYSTEM_ERROR_TYPE, __func__, errno, MSG) #define UDA_THROW_ERROR(ERR, MSG) \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, ERR, MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, ERR, MSG); \ return ERR; #endif // UDA_CLIENTSERVER_ERRORLOG_H diff --git a/source/include/legacy.h b/source/include/legacy.h index ef578b43..8054474d 100644 --- a/source/include/legacy.h +++ b/source/include/legacy.h @@ -3,7 +3,7 @@ #ifndef UDA_LEGACY_H # define UDA_LEGACY_H -// to delete just used for debugging... +// to delete just used for debugging... // #include "client.h" // #include "clientAPI.h" // #include "accAPI.h" @@ -44,8 +44,8 @@ inline int idamGetAPIWithHost(const char* data_object, const char* data_source, return udaGetAPIWithHost(data_object, data_source, host, port); } -inline int idamGetBatchAPIWithHost(const char** uda_signals, const char** sources, int count, int* handles, const char* host, - int port) +inline int idamGetBatchAPIWithHost(const char** uda_signals, const char** sources, int count, int* handles, + const char* host, int port) { return udaGetBatchAPIWithHost(uda_signals, sources, count, handles, host, port); } @@ -207,7 +207,8 @@ inline void acc_freeDataBlocks() inline char* acc_getSyntheticData(int handle) { - return udaGetSyntheticData(handle); ; + return udaGetSyntheticData(handle); + ; } inline char* acc_getSyntheticDimData(int handle, int ndim) @@ -232,86 +233,86 @@ inline int acc_growIdamDataBlocks() inline int acc_getIdamNewDataHandle() { - return udaGetNewDataHandle(); + return udaGetNewDataHandle(); } inline void setIdamPrivateFlag(unsigned int flag) { - return udaSetPrivateFlag(flag); + return udaSetPrivateFlag(flag); } inline void resetIdamPrivateFlag(unsigned int flag) { - return udaResetPrivateFlag(flag); + return udaResetPrivateFlag(flag); } inline void setIdamClientFlag(unsigned int flag) { - return udaSetClientFlag(flag); + return udaSetClientFlag(flag); } inline void resetIdamClientFlag(unsigned int flag) { - return udaResetClientFlag(flag); + return udaResetClientFlag(flag); } inline void setIdamProperty(const char* property) { - return udaSetProperty(property); + return udaSetProperty(property); } inline int getIdamProperty(const char* property) { - return udaGetProperty(property); + return udaGetProperty(property); } inline void resetIdamProperty(const char* property) { - return udaResetProperty(property); + return udaResetProperty(property); } inline void resetIdamProperties() { - return udaResetProperties(); + return udaResetProperties(); } inline CLIENT_BLOCK saveIdamProperties() { - return udaSaveProperties(); + return udaSaveProperties(); } inline void restoreIdamProperties(CLIENT_BLOCK cb) { - return udaRestoreProperties(cb); + return udaRestoreProperties(cb); } inline CLIENT_BLOCK* getIdamProperties(int handle) { - return udaGetProperties(handle); + return udaGetProperties(handle); } inline CLIENT_BLOCK* getIdamDataProperties(int handle) { - return udaGetDataProperties(handle); + return udaGetDataProperties(handle); } # ifndef __APPLE__ inline int getIdamMemoryFree() { - return udaGetMemoryFree(); + return udaGetMemoryFree(); } inline int getIdamMemoryUsed() { - return udaGetMemoryUsed(); + return udaGetMemoryUsed(); } # endif inline void putIdamErrorModel(int handle, int model, int param_n, const float* params) { - return udaPutErrorModel(handle, model, param_n, params); + return udaPutErrorModel(handle, model, param_n, params); } inline void putIdamDimErrorModel(int handle, int ndim, int model, int param_n, const float* params) @@ -326,153 +327,153 @@ inline void putIdamServer(const char* host, int port) inline void putIdamServerHost(const char* host) { - return udaPutServerHost(host); + return udaPutServerHost(host); } inline void putIdamServerPort(int port) { - return udaPutServerPort(port); + return udaPutServerPort(port); } inline void putIdamServerSocket(int socket) { - return udaPutServerSocket(socket); + return udaPutServerSocket(socket); } inline void getIdamServer(const char** host, int* port, int* socket) { - return udaGetServer(host, port, socket); + return udaGetServer(host, port, socket); } inline int getIdamErrorCode(int handle) { - return udaGetErrorCode(handle); + return udaGetErrorCode(handle); } inline const char* getIdamErrorMsg(int handle) { - return udaGetErrorMsg(handle); + return udaGetErrorMsg(handle); } inline int getIdamSourceStatus(int handle) { - return udaGetSourceStatus(handle); + return udaGetSourceStatus(handle); } inline int getIdamSignalStatus(int handle) { - return udaGetSignalStatus(handle); + return udaGetSignalStatus(handle); } inline int getIdamDataStatus(int handle) { - return udaGetDataStatus(handle); + return udaGetDataStatus(handle); } inline int getIdamLastHandle() { - return udaGetLastHandle(); + return udaGetLastHandle(); } inline int getIdamDataNum(int handle) { - return udaGetDataNum(handle); + return udaGetDataNum(handle); } inline int getIdamRank(int handle) { - return udaGetRank(handle); + return udaGetRank(handle); } inline int getIdamOrder(int handle) { - return udaGetOrder(handle); + return udaGetOrder(handle); } inline unsigned int getIdamCachePermission(int handle) { - return udaGetCachePermission(handle); + return udaGetCachePermission(handle); } inline unsigned int getIdamTotalDataBlockSize(int handle) { - return udaGetTotalDataBlockSize(handle); + return udaGetTotalDataBlockSize(handle); } inline int getIdamDataType(int handle) { - return udaGetDataType(handle); + return udaGetDataType(handle); } inline int getIdamDataOpaqueType(int handle) { - return udaGetDataOpaqueType(handle); + return udaGetDataOpaqueType(handle); } inline void* getIdamDataOpaqueBlock(int handle) { - return udaGetDataOpaqueBlock(handle); + return udaGetDataOpaqueBlock(handle); } inline int getIdamDataOpaqueCount(int handle) { - return udaGetDataOpaqueCount(handle); + return udaGetDataOpaqueCount(handle); } inline void getIdamErrorModel(int handle, int* model, int* param_n, float* params) { - return udaGetErrorModel(handle, model, param_n, params); + return udaGetErrorModel(handle, model, param_n, params); } inline int getIdamErrorType(int handle) { - return udaGetErrorType(handle); + return udaGetErrorType(handle); } inline int getIdamDataTypeId(const char* type) { - return udaGetDataTypeId(type); + return udaGetDataTypeId(type); } inline int getIdamDataTypeSize(int type) { - return udaGetDataTypeSize(type); + return udaGetDataTypeSize(type); } /* * redefinition ? */ -//TODO check if something was lost in renaming here? +// TODO check if something was lost in renaming here? // inline void getIdamErrorModel(int handle, int* model, int* param_n, float* params) // { -// return udaGetErrorModel(handle, model, param_n, params); +// return udaGetErrorModel(handle, model, param_n, params); // } inline int getIdamErrorAsymmetry(int handle) { - return udaGetErrorAsymmetry(handle); + return udaGetErrorAsymmetry(handle); } inline int getIdamErrorModelId(const char* model) { - return udaGetErrorModelId(model); + return udaGetErrorModelId(model); } inline char* getIdamSyntheticData(int handle) { - return udaGetSyntheticData(handle); + return udaGetSyntheticData(handle); } inline char* getIdamData(int handle) { - return udaGetData(handle); + return udaGetData(handle); } inline void getIdamDataTdi(int handle, char* data) { - return udaGetDataTdi(handle, data); + return udaGetDataTdi(handle, data); } inline char* getIdamAsymmetricError(int handle, int above) @@ -482,22 +483,22 @@ inline char* getIdamAsymmetricError(int handle, int above) inline char* getIdamDataErrLo(int handle) { - return udaGetDataErrLo(handle); + return udaGetDataErrLo(handle); } inline char* getIdamDataErrHi(int handle) { - return udaGetDataErrHi(handle); + return udaGetDataErrHi(handle); } inline int getIdamDataErrAsymmetry(int handle) { - return udaGetDataErrAsymmetry(handle); + return udaGetDataErrAsymmetry(handle); } inline void acc_setIdamDataErrAsymmetry(int handle, int asymmetry) { - return udaSetDataErrAsymmetry(handle, asymmetry); + return udaSetDataErrAsymmetry(handle, asymmetry); } inline void acc_setIdamDataErrType(int handle, int type) @@ -512,7 +513,7 @@ inline void acc_setIdamDataErrLo(int handle, char* errlo) inline char* getIdamDimErrLo(int handle, int ndim) { - return udaGetDimErrLo(handle, ndim); + return udaGetDimErrLo(handle, ndim); } inline char* getIdamDimErrHi(int handle, int ndim) @@ -542,12 +543,12 @@ inline void acc_setIdamDimErrLo(int handle, int ndim, char* errlo) inline char* getIdamError(int handle) { - return udaGetError(handle); + return udaGetError(handle); } inline void getIdamDoubleData(int handle, double* fp) { - return udaGetDoubleData(handle, fp); + return udaGetDoubleData(handle, fp); } inline void getIdamFloatData(int handle, float* fp) @@ -562,167 +563,167 @@ inline void getIdamGenericData(int handle, void* data) inline void getIdamFloatAsymmetricError(int handle, int above, float* fp) { - return udaGetFloatAsymmetricError(handle, above, fp); + return udaGetFloatAsymmetricError(handle, above, fp); } inline void getIdamFloatError(int handle, float* fp) { - return udaGetFloatError(handle, fp); + return udaGetFloatError(handle, fp); } inline void getIdamDBlock(int handle, DATA_BLOCK* db) { - return udaGetDBlock(handle, db); + return udaGetDBlock(handle, db); } inline DATA_BLOCK* getIdamDataBlock(int handle) { - return udaGetDataBlock(handle); + return udaGetDataBlock(handle); } inline const char* getIdamDataLabel(int handle) { - return udaGetDataLabel(handle); + return udaGetDataLabel(handle); } inline void getIdamDataLabelTdi(int handle, char* label) { - return udaGetDataLabelTdi(handle, label); + return udaGetDataLabelTdi(handle, label); } inline const char* getIdamDataUnits(int handle) { - return udaGetDataUnits(handle); + return udaGetDataUnits(handle); } inline void getIdamDataUnitsTdi(int handle, char* units) { - return udaGetDataUnitsTdi(handle, units); + return udaGetDataUnitsTdi(handle, units); } inline const char* getIdamDataDesc(int handle) { - return udaGetDataDesc(handle); + return udaGetDataDesc(handle); } inline void getIdamDataDescTdi(int handle, char* desc) { - return udaGetDataDescTdi(handle, desc); + return udaGetDataDescTdi(handle, desc); } inline int getIdamDimNum(int handle, int ndim) { - return udaGetDimNum(handle, ndim); + return udaGetDimNum(handle, ndim); } inline int getIdamDimType(int handle, int ndim) { - return udaGetDimType(handle, ndim); + return udaGetDimType(handle, ndim); } inline int getIdamDimErrorType(int handle, int ndim) { - return udaGetDimErrorType(handle, ndim); + return udaGetDimErrorType(handle, ndim); } inline int getIdamDimErrorAsymmetry(int handle, int ndim) { - return udaGetDimErrorAsymmetry(handle, ndim); + return udaGetDimErrorAsymmetry(handle, ndim); } inline void getIdamDimErrorModel(int handle, int ndim, int* model, int* param_n, float* params) { - return udaGetDimErrorModel(handle, ndim, model, param_n, params); + return udaGetDimErrorModel(handle, ndim, model, param_n, params); } inline char* getIdamSyntheticDimData(int handle, int ndim) { - return udaGetSyntheticDimData(handle, ndim); + return udaGetSyntheticDimData(handle, ndim); } inline char* getIdamDimData(int handle, int ndim) { - return udaGetDimData(handle, ndim); + return udaGetDimData(handle, ndim); } inline const char* getIdamDimLabel(int handle, int ndim) { - return udaGetDimLabel(handle, ndim); + return udaGetDimLabel(handle, ndim); } inline const char* getIdamDimUnits(int handle, int ndim) { - return udaGetDimUnits(handle, ndim); + return udaGetDimUnits(handle, ndim); } inline void getIdamDimLabelTdi(int handle, int ndim, char* label) { - return udaGetDimLabelTdi(handle, ndim, label); + return udaGetDimLabelTdi(handle, ndim, label); } inline void getIdamDimUnitsTdi(int handle, int ndim, char* units) { - return udaGetDimUnitsTdi(handle, ndim, units); + return udaGetDimUnitsTdi(handle, ndim, units); } inline void getIdamDoubleDimData(int handle, int ndim, double* fp) { - return udaGetDoubleDimData(handle, ndim, fp); + return udaGetDoubleDimData(handle, ndim, fp); } inline void getIdamFloatDimData(int handle, int ndim, float* fp) { - return udaGetFloatDimData(handle, ndim, fp); + return udaGetFloatDimData(handle, ndim, fp); } inline void getIdamGenericDimData(int handle, int ndim, void* data) { - return udaGetGenericDimData(handle, ndim, data); + return udaGetGenericDimData(handle, ndim, data); } inline DIMS* getIdamDimBlock(int handle, int ndim) { - return udaGetDimBlock(handle, ndim); + return udaGetDimBlock(handle, ndim); } inline char* getIdamDimAsymmetricError(int handle, int ndim, int above) { - return udaGetDimAsymmetricError(handle, ndim, above); + return udaGetDimAsymmetricError(handle, ndim, above); } inline char* getIdamDimError(int handle, int ndim) { - return udaGetDimError(handle, ndim); + return udaGetDimError(handle, ndim); } inline void getIdamFloatDimAsymmetricError(int handle, int ndim, int above, float* fp) { - return udaGetFloatDimAsymmetricError(handle, ndim, above, fp); + return udaGetFloatDimAsymmetricError(handle, ndim, above, fp); } inline void getIdamFloatDimError(int handle, int ndim, float* fp) { - return udaGetFloatDimError(handle, ndim, fp); + return udaGetFloatDimError(handle, ndim, fp); } inline DATA_SYSTEM* getIdamDataSystem(int handle) { - return udaGetDataSystem(handle); + return udaGetDataSystem(handle); } inline SYSTEM_CONFIG* getIdamSystemConfig(int handle) { - return udaGetSystemConfig(handle); + return udaGetSystemConfig(handle); } inline DATA_SOURCE* getIdamDataSource(int handle) { - return udaGetDataSource(handle); + return udaGetDataSource(handle); } inline SIGNAL* getIdamSignal(int handle) { - return udaGetSignal(handle); + return udaGetSignal(handle); } inline SIGNAL_DESC* getIdamSignalDesc(int handle) @@ -732,17 +733,17 @@ inline SIGNAL_DESC* getIdamSignalDesc(int handle) inline const char* getIdamFileFormat(int handle) { - return udaGetFileFormat(handle); + return udaGetFileFormat(handle); } inline void initIdamDataBlock(DATA_BLOCK* str) { - return udaInitDataBlock(str); + return udaInitDataBlock(str); } inline void initIdamRequestBlock(REQUEST_BLOCK* str) { - return udaInitRequestBlock(str); + return udaInitRequestBlock(str); } /* @@ -755,27 +756,27 @@ inline int idamDataCheckSum(void* data, int data_n, int type) inline int getIdamDataCheckSum(int handle) { - return udaGetDataCheckSum(handle); + return udaGetDataCheckSum(handle); } inline int getIdamDimDataCheckSum(int handle, int ndim) { - return udaGetDimDataCheckSum(handle, ndim); + return udaGetDimDataCheckSum(handle, ndim); } inline void lockIdamThread() { - return udaLockThread(); + return udaLockThread(); } inline void unlockIdamThread() { - return udaUnlockThread(); + return udaUnlockThread(); } inline void freeIdamThread() { - return udaFreeThread(); + return udaFreeThread(); } inline int getIdamThreadLastHandle() @@ -785,62 +786,62 @@ inline int getIdamThreadLastHandle() inline void putIdamThreadLastHandle(int handle) { - return udaPutThreadLastHandle(handle); + return udaPutThreadLastHandle(handle); } inline int getIdamMaxThreadCount() { - return udaGetMaxThreadCount(); + return udaGetMaxThreadCount(); } inline SERVER_BLOCK getIdamThreadServerBlock() { - return udaGetThreadServerBlock(); + return udaGetThreadServerBlock(); } inline CLIENT_BLOCK getIdamThreadClientBlock() { - return udaGetThreadClientBlock(); + return udaGetThreadClientBlock(); } -inline void putIdamThreadServerBlock(SERVER_BLOCK * str) +inline void putIdamThreadServerBlock(SERVER_BLOCK* str) { - return udaPutThreadServerBlock(str); + return udaPutThreadServerBlock(str); } -inline void putIdamThreadClientBlock(CLIENT_BLOCK * str) +inline void putIdamThreadClientBlock(CLIENT_BLOCK* str) { - return udaPutThreadClientBlock(str); + return udaPutThreadClientBlock(str); } inline int setIdamDataTree(int handle) { - return udaSetDataTree(handle); + return udaSetDataTree(handle); } inline NTREE* getIdamDataTree(int handle) { - return udaGetDataTree(handle); + return udaGetDataTree(handle); } inline USERDEFINEDTYPE* getIdamUserDefinedType(int handle) { - return udaGetUserDefinedType(handle); + return udaGetUserDefinedType(handle); } inline USERDEFINEDTYPELIST* getIdamUserDefinedTypeList(int handle) { - return udaGetUserDefinedTypeList(handle); + return udaGetUserDefinedTypeList(handle); } inline LOGMALLOCLIST* getIdamLogMallocList(int handle) { - return udaGetLogMallocList(handle); + return udaGetLogMallocList(handle); } -inline NTREE* findIdamNTreeStructureDefinition(NTREE * node, const char* target) +inline NTREE* findIdamNTreeStructureDefinition(NTREE* node, const char* target) { - return udaFindNTreeStructureDefinition(node, target); + return udaFindNTreeStructureDefinition(node, target); } /* @@ -872,7 +873,7 @@ inline int idamClientTestAPI(const char* file, const char* signal, int pass, int * definitions from accessors.h */ -// TODO: these are used by plugins and wrappers only so don't need to be shadowed? +// TODO: these are used by plugins and wrappers only so don't need to be shadowed? // LIBRARY_API NTREE* findNTreeStructureComponent2(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, // const char** lastname); @@ -886,30 +887,29 @@ inline int idamClientTestAPI(const char* file, const char* signal, int pass, int // LIBRARY_API NTREE* findNTreeStructureDefinition(NTREE* ntree, const char* target); // LIBRARY_API NTREE* findNTreeStructureComponentDefinition(NTREE* tree, const char* target); -inline NTREE* idam_findNTreeStructureClass(NTREE * tree, int cls) +inline NTREE* idam_findNTreeStructureClass(NTREE* tree, int cls) { return udaFindNTreeStructureClass(tree, cls); } -inline int idam_maxCountVlenStructureArray(NTREE * tree, const char* target, int reset) +inline int idam_maxCountVlenStructureArray(NTREE* tree, const char* target, int reset) { return udaMaxCountVlenStructureArray(tree, target, reset); } -inline int idam_regulariseVlenStructures(LOGMALLOCLIST * logmalloclist, NTREE * tree, - USERDEFINEDTYPELIST * userdefinedtypelist, const char* target, +inline int idam_regulariseVlenStructures(LOGMALLOCLIST* logmalloclist, NTREE* tree, + USERDEFINEDTYPELIST* userdefinedtypelist, const char* target, unsigned int count) { return udaRegulariseVlenStructures(LOGMALLOCLIST * logmalloclist, NTREE * tree, - USERDEFINEDTYPELIST * userdefinedtypelist, const char* target, - unsigned int count); + USERDEFINEDTYPELIST * userdefinedtypelist, const char* target, + unsigned int count); } -inline int idam_regulariseVlenData(LOGMALLOCLIST * logmalloclist, NTREE * tree, - USERDEFINEDTYPELIST * userdefinedtypelist) +inline int idam_regulariseVlenData(LOGMALLOCLIST* logmalloclist, NTREE* tree, USERDEFINEDTYPELIST* userdefinedtypelist) { return udaRegulariseVlenData(LOGMALLOCLIST * logmalloclist, NTREE * tree, - USERDEFINEDTYPELIST * userdefinedtypelist); + USERDEFINEDTYPELIST * userdefinedtypelist); } // // LIBRARY_API int getNodeStructureDataCount(LOGMALLOCLIST* logmalloclist, NTREE* ntree); @@ -973,5 +973,4 @@ inline void closeUdaError() return udaCloseError(); } - #endif // UDA_LEGACY_H diff --git a/source/include/pluginStructs.h b/source/include/pluginStructs.h index d2f8930d..d3b6c712 100644 --- a/source/include/pluginStructs.h +++ b/source/include/pluginStructs.h @@ -23,7 +23,7 @@ enum pluginClass { struct PluginList; // Forward declaration typedef struct PluginList PLUGINLIST; -typedef struct UdaPluginInterface { // Standard Plugin interface +typedef struct UdaPluginInterface { // Standard Plugin interface unsigned short interfaceVersion; // Interface Version unsigned short pluginVersion; // Plugin Version unsigned short sqlConnectionType; // Which SQL is the server connected to diff --git a/source/include/struct.h b/source/include/struct.h index a20b07dd..a8643b00 100644 --- a/source/include/struct.h +++ b/source/include/struct.h @@ -78,7 +78,7 @@ LIBRARY_API void udaAddImage(char** image, int* imagecount, const char* line); * @return expand An expanded Image line. */ LIBRARY_API void udaExpandImage(char* buffer, char defnames[MAXELEMENTS][MAXELEMENTNAME], int* defvalues, int defCount, - char* expand); + char* expand); /** Initialise a LOGMALLOCLIST data structure. * @@ -239,7 +239,7 @@ LIBRARY_API void udaAddNonMalloc(LOGMALLOCLIST* logmalloclist, void* stack, int * @return void. */ LIBRARY_API void udaAddNonMalloc2(LOGMALLOCLIST* logmalloclist, void* stack, int count, size_t size, const char* type, - int rank, int* shape); + int rank, int* shape); /** Add a heap memory location to the LOGMALLOCLIST data structure. These are freed. * @@ -262,7 +262,7 @@ LIBRARY_API void udaAddMalloc(LOGMALLOCLIST* logmalloclist, void* heap, int coun * @return void. */ LIBRARY_API void udaAddMalloc2(LOGMALLOCLIST* logmalloclist, void* heap, int count, size_t size, const char* type, - int rank, int* shape); + int rank, int* shape); /** Change the logged memory location to a new location (necessary with realloc). * @@ -274,7 +274,7 @@ LIBRARY_API void udaAddMalloc2(LOGMALLOCLIST* logmalloclist, void* heap, int cou * @return void. */ LIBRARY_API void udaChangeMalloc(LOGMALLOCLIST* logmalloclist, VOIDTYPE old, void* anew, int count, size_t size, - const char* type); + const char* type); /** Change the logged memory location to a new location (necessary with realloc). * @@ -286,7 +286,7 @@ LIBRARY_API void udaChangeMalloc(LOGMALLOCLIST* logmalloclist, VOIDTYPE old, voi * @return void. */ LIBRARY_API void udaChangeNonMalloc(LOGMALLOCLIST* logmalloclist, void* old, void* anew, int count, size_t size, - const char* type); + const char* type); LIBRARY_API int udaDupCountMallocLog(LOGMALLOCLIST* str); @@ -324,7 +324,7 @@ LIBRARY_API void udaFindMalloc(LOGMALLOCLIST* logmalloclist, void* heap, int* co * @return void. */ LIBRARY_API void udaFindMalloc2(LOGMALLOCLIST* logmalloclist, void* heap, int* count, int* size, const char** type, - int* rank, int** shape); + int* rank, int** shape); /** Add a heap memory location to the LOGSTRUCTLIST data structure. These are freed. * @@ -370,7 +370,7 @@ LIBRARY_API void udaCopyUserDefinedType(USERDEFINEDTYPE* old, USERDEFINEDTYPE* a * @return void. */ LIBRARY_API void udaCopyUserDefinedTypeList(USERDEFINEDTYPELIST** anew, - const USERDEFINEDTYPELIST* parseduserdefinedtypelist); + const USERDEFINEDTYPELIST* parseduserdefinedtypelist); /** Create the Initial User Defined Structure Definition List. * @@ -414,7 +414,7 @@ LIBRARY_API void udaUpdateUserDefinedType(USERDEFINEDTYPELIST* str, int typeId, * @return void. */ LIBRARY_API void udaChangeUserDefinedTypeElementProperty(USERDEFINEDTYPELIST* str, int typeId, char* element, - char* property, void* value); + char* property, void* value); /** The number of Structure Definitions or User Defined Types in the structure list * @@ -530,19 +530,19 @@ LIBRARY_API void udaPrintError(int warning, int line, char* file, char* msg); // LIBRARY_API int udaXDRAtomicData(LOGMALLOCLIST* logmalloclist, XDR* xdrs, const char* type, int count, int size, - char** data); + char** data); // Send/Receive Array of Structures LIBRARY_API int udaXDRUserDefinedTypeData(XDR* xdrs, LOGMALLOCLIST* logmalloclist, - USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, - void** data, int protocolVersion, bool xdr_stdio_flag, - LOGSTRUCTLIST* log_struct_list, int malloc_source); + USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* userdefinedtype, + void** data, int protocolVersion, bool xdr_stdio_flag, + LOGSTRUCTLIST* log_struct_list, int malloc_source); LIBRARY_API int udaFindUserDefinedTypeId(USERDEFINEDTYPELIST* userdefinedtypelist, const char* name); LIBRARY_API USERDEFINEDTYPE* udaFindUserDefinedType(USERDEFINEDTYPELIST* userdefinedtypelist, const char* name, - int ref_id); + int ref_id); LIBRARY_API int udaTestUserDefinedType(USERDEFINEDTYPELIST* userdefinedtypelist, USERDEFINEDTYPE* udt); @@ -687,7 +687,7 @@ LIBRARY_API void* udaGetNodeStructureArrayData(LOGMALLOCLIST* logmalloclist, NTR * @return a Pointer to a Component Structure Array element. */ LIBRARY_API void* udaGetNodeStructureComponentArrayData(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - int structureindex, int componentindex); + int structureindex, int componentindex); /** Return the count of child User Defined Type Structures (elements of this structure). * @@ -902,7 +902,8 @@ LIBRARY_API int* udaGetNodeStructureComponentDataShape(LOGMALLOCLIST* logmallocl * @return the value 1 if the User Defined Structure Component Data array is a pointer type. */ -LIBRARY_API int udaGetNodeStructureComponentDataIsPointer(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target); +LIBRARY_API int udaGetNodeStructureComponentDataIsPointer(LOGMALLOCLIST* logmalloclist, NTREE* ntree, + const char* target); /** Return the Size of a User Defined Structure Component. * @@ -921,7 +922,7 @@ LIBRARY_API int udaGetNodeStructureComponentDataSize(LOGMALLOCLIST* logmalloclis */ LIBRARY_API const char* udaGetNodeStructureComponentDataDataType(LOGMALLOCLIST* logmalloclist, NTREE* ntree, - const char* target); + const char* target); /** Return a pointer to a User Defined Structure Component's data. * @@ -941,7 +942,7 @@ LIBRARY_API void* udaGetNodeStructureComponentData(LOGMALLOCLIST* logmalloclist, */ LIBRARY_API void udaPrintNodeStructureComponentData(NTREE* ntree, LOGMALLOCLIST* logmalloclist, - USERDEFINEDTYPELIST* userdefinedtypelist, const char* target); + USERDEFINEDTYPELIST* userdefinedtypelist, const char* target); /** Print a Data Structure's Contents. * @@ -960,7 +961,7 @@ LIBRARY_API void udaPrintNodeStructure(LOGMALLOCLIST* logmalloclist, NTREE* ntre */ LIBRARY_API float* udaCastNodeStructureComponentDatatoFloat(LOGMALLOCLIST* logmalloclist, NTREE* ntree, - const char* target); + const char* target); /** Return a pointer to a User Defined Structure Component's data cast to DOUBLE. * @@ -970,7 +971,7 @@ LIBRARY_API float* udaCastNodeStructureComponentDatatoFloat(LOGMALLOCLIST* logma */ LIBRARY_API double* udaCastNodeStructureComponentDatatoDouble(LOGMALLOCLIST* logmalloclist, NTREE* ntree, - const char* target); + const char* target); //--------------------------------------------------------------------------------------------- // Tree Branch Family: Whole tree is in scope @@ -1100,29 +1101,29 @@ LIBRARY_API void udaPrintNTreeStructureComponentNames_stdout(LOGMALLOCLIST* logm LIBRARY_API void udaPrintAtomicType_stdout(LOGMALLOCLIST* logmalloclist, NTREE* tree, const char* target); LIBRARY_API void udaGetNodeStructureComponentDataShape_f(LOGMALLOCLIST* logmalloclist, NTREE* ntree, const char* target, - int* shape_f); + int* shape_f); LIBRARY_API void udaGetNodeStructureComponentShortData_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - short* data_f); + short* data_f); LIBRARY_API void udaGetNodeStructureComponentFloatData_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - float* data_f); + float* data_f); LIBRARY_API void udaDereferenceShortData(short* data_c, int count, short* data_f); LIBRARY_API void udaDereferenceFloatData(float* data_c, int count, float* data_f); LIBRARY_API short* udaCastNodeStructureComponentDatatoShort(LOGMALLOCLIST* logmalloclist, NTREE* ntree, - const char* target); + const char* target); -LIBRARY_API void udaCastNodeStructureComponentDatatoShort_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - short* data_f); +LIBRARY_API void udaCastNodeStructureComponentDatatoShort_f(LOGMALLOCLIST* logmalloclist, NTREE* node, + const char* target, short* data_f); -LIBRARY_API void udaCastNodeStructureComponentDatatoFloat_f(LOGMALLOCLIST* logmalloclist, NTREE* node, const char* target, - float* data_f); +LIBRARY_API void udaCastNodeStructureComponentDatatoFloat_f(LOGMALLOCLIST* logmalloclist, NTREE* node, + const char* target, float* data_f); -LIBRARY_API void udaAddStructureField(USERDEFINEDTYPE* user_type, const char* name, const char* desc, UDA_TYPE data_type, - bool is_pointer, int rank, int* shape, size_t offset); +LIBRARY_API void udaAddStructureField(USERDEFINEDTYPE* user_type, const char* name, const char* desc, + UDA_TYPE data_type, bool is_pointer, int rank, int* shape, size_t offset); #ifdef __cplusplus } diff --git a/source/include/udaGetAPI.h b/source/include/udaGetAPI.h index 01305d98..1656bc1b 100644 --- a/source/include/udaGetAPI.h +++ b/source/include/udaGetAPI.h @@ -18,7 +18,7 @@ LIBRARY_API int udaGetAPI(const char* data_object, const char* data_source); LIBRARY_API int udaGetBatchAPI(const char** uda_signals, const char** sources, int count, int* handles); LIBRARY_API int udaGetAPIWithHost(const char* data_object, const char* data_source, const char* host, int port); LIBRARY_API int udaGetBatchAPIWithHost(const char** uda_signals, const char** sources, int count, int* handles, - const char* host, int port); + const char* host, int port); #ifdef __cplusplus } diff --git a/source/include/udaPlugin.h b/source/include/udaPlugin.h index 58409348..05a07f39 100644 --- a/source/include/udaPlugin.h +++ b/source/include/udaPlugin.h @@ -3,11 +3,11 @@ #include +#include "errorLog.h" #include "export.h" #include "pluginStructs.h" #include "udaStructs.h" #include "udaTypes.h" -#include "errorLog.h" #ifdef __cplusplus extern "C" { @@ -80,7 +80,7 @@ LIBRARY_API bool findDoubleArray(const NAMEVALUELIST* namevaluelist, double** va { \ int UNIQUE_VAR(err) = 999; \ UDA_LOG(UDA_LOG_ERROR, "%s\n", MSG); \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ udaConcatError(&plugin_interface_ptr->error_stack); \ return UNIQUE_VAR(err); \ } @@ -89,7 +89,7 @@ LIBRARY_API bool findDoubleArray(const NAMEVALUELIST* namevaluelist, double** va { \ int UNIQUE_VAR(err) = 999; \ UDA_LOG(UDA_LOG_ERROR, "%s\n", MSG); \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ return UNIQUE_VAR(err); \ } @@ -97,7 +97,7 @@ LIBRARY_API bool findDoubleArray(const NAMEVALUELIST* namevaluelist, double** va { \ int UNIQUE_VAR(err) = 999; \ UDA_LOG(UDA_LOG_ERROR, "%s\n", FMT, __VA_ARGS__); \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ return UNIQUE_VAR(err); \ } @@ -105,7 +105,7 @@ LIBRARY_API bool findDoubleArray(const NAMEVALUELIST* namevaluelist, double** va { \ int UNIQUE_VAR(err) = 999; \ UDA_LOG(UDA_LOG_ERROR, "%s\n", FMT, __VA_ARGS__); \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ udaConcatError(&plugin_interface_ptr->error_stack); \ return UNIQUE_VAR(err); \ } @@ -113,7 +113,7 @@ LIBRARY_API bool findDoubleArray(const NAMEVALUELIST* namevaluelist, double** va #define RAISE_PLUGIN_ERROR_EX(MSG, CODE) \ int UNIQUE_VAR(err) = 999; \ UDA_LOG(UDA_LOG_ERROR, "%s", MSG); \ - udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ + udaAddError(UDA_CODE_ERROR_TYPE, __func__, UNIQUE_VAR(err), MSG); \ CODE; \ return UNIQUE_VAR(err); diff --git a/source/plugins/uda_plugin_base.hpp b/source/plugins/uda_plugin_base.hpp index f73a34f0..6418a823 100644 --- a/source/plugins/uda_plugin_base.hpp +++ b/source/plugins/uda_plugin_base.hpp @@ -1,22 +1,22 @@ #pragma once #ifndef UDA_UDA_PLUGIN_H -#define UDA_UDA_PLUGIN_H +# define UDA_UDA_PLUGIN_H -#include +# include -#include "pluginStructs.h" -#include "export.h" +# include "export.h" +# include "pluginStructs.h" -#include -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include +# include -#include "udaPlugin.h" -#include "include/logging.h" +# include "include/logging.h" +# include "udaPlugin.h" class UDAPluginBase; @@ -25,21 +25,16 @@ typedef int (*plugin_function_type)(UDA_PLUGIN_INTERFACE*); /** * Abstract base class to be used to provide helper functions to make it easier to create C++ plugins. */ -class UDAPluginBase { -public: +class UDAPluginBase +{ + public: typedef int (UDAPluginBase::*plugin_member_type)(UDA_PLUGIN_INTERFACE*); LIBRARY_API int call(UDA_PLUGIN_INTERFACE* plugin_interface); -protected: + protected: UDAPluginBase(std::string name, int version, std::string default_method, std::string help_file) - : init_{false } - , name_{std::move(name) } - , version_{version } - , interface_version_{1 } - , default_method_{std::move(default_method) } - , help_file_{std::move(help_file) } - , method_map_{} - , function_map_{} + : init_{false}, name_{std::move(name)}, version_{version}, interface_version_{1}, + default_method_{std::move(default_method)}, help_file_{std::move(help_file)}, method_map_{}, function_map_{} { register_method("help", &UDAPluginBase::help); register_method("version", &UDAPluginBase::version); @@ -55,25 +50,23 @@ class UDAPluginBase { LIBRARY_API void register_function(const std::string& name, plugin_function_type plugin_function); // Helper methods - template - void debug(const std::string& message, Args... args) + template void debug(const std::string& message, Args... args) { auto msg = fmt::format(message, args...); UDA_LOG(UDA_LOG_DEBUG, "%s", msg.c_str()); } - template - void error(const std::string& message, Args... args) + template void error(const std::string& message, Args... args) { auto msg = fmt::format(message, args...); UDA_LOG(UDA_LOG_ERROR, "%s", msg.c_str()); - throw std::runtime_error{ msg.c_str() }; + throw std::runtime_error{msg.c_str()}; } LIBRARY_API bool has_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name); template - boost::optional find_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name, bool required=false) + boost::optional find_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name, bool required = false) { const char* str; bool found = findStringValue(&plugin_interface->request_data->nameValueList, &str, name.c_str()); @@ -88,15 +81,15 @@ class UDAPluginBase { return {}; } - template - T find_required_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name) + template T find_required_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name) { auto arg = find_arg(plugin_interface, name, true); return *arg; } template - boost::optional> find_array_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name, bool required=false) + boost::optional> find_array_arg(UDA_PLUGIN_INTERFACE* plugin_interface, const std::string& name, + bool required = false) { const char* str; bool found = findStringValue(&plugin_interface->request_data->nameValueList, &str, name.c_str()); @@ -130,7 +123,7 @@ class UDAPluginBase { LIBRARY_API int default_method(UDA_PLUGIN_INTERFACE* plugin_interface); LIBRARY_API int max_interface_version(UDA_PLUGIN_INTERFACE* plugin_interface); -private: + private: void do_init(UDA_PLUGIN_INTERFACE* plugin_interface); void do_reset(); static std::string get_function(UDA_PLUGIN_INTERFACE* plugin_interface); @@ -145,4 +138,4 @@ class UDAPluginBase { std::unordered_map function_map_; }; -#endif //UDA_UDA_PLUGIN_H +#endif // UDA_UDA_PLUGIN_H diff --git a/source/server2/apply_XML.hpp b/source/server2/apply_XML.hpp old mode 100755 new mode 100644 index b11124e0..fde578ad --- a/source/server2/apply_XML.hpp +++ b/source/server2/apply_XML.hpp @@ -1,16 +1,17 @@ #pragma once #ifndef UDA_SERVER_APPLYXML_H -#define UDA_SERVER_APPLYXML_H +# define UDA_SERVER_APPLYXML_H -#include -#include "udaStructs.h" -#include "export.h" +# include "export.h" +# include "udaStructs.h" +# include -namespace uda { +namespace uda +{ -int server_parse_signal_XML(DATA_SOURCE data_source, SIGNAL signal, SIGNAL_DESC signal_desc, - ACTIONS* actions_desc, ACTIONS* actions_sig); +int server_parse_signal_XML(DATA_SOURCE data_source, SIGNAL signal, SIGNAL_DESC signal_desc, ACTIONS* actions_desc, + ACTIONS* actions_sig); void server_apply_signal_XML(CLIENT_BLOCK client_block, DATA_SOURCE* data_source, SIGNAL* signal, SIGNAL_DESC* signal_desc, DATA_BLOCK* data_block, ACTIONS actions); diff --git a/source/server2/get_data.hpp b/source/server2/get_data.hpp index 19df932c..d1cfe05f 100644 --- a/source/server2/get_data.hpp +++ b/source/server2/get_data.hpp @@ -1,15 +1,15 @@ #pragma once #ifndef UDA_SERVER_GET_DATA_HPP -#define UDA_SERVER_GET_DATA_HPP +# define UDA_SERVER_GET_DATA_HPP -#include "udaStructs.h" -#include "clientserver/parseXML.h" +# include "clientserver/parseXML.h" +# include "udaStructs.h" -#include "plugins.hpp" -#include "clientserver/socketStructs.h" -#include "xdr_protocol.hpp" +# include "clientserver/socketStructs.h" +# include "plugins.hpp" +# include "xdr_protocol.hpp" -#include +# include #endif // UDA_SERVER_GET_DATA_HPP \ No newline at end of file diff --git a/source/server2/get_plugin_address.hpp b/source/server2/get_plugin_address.hpp old mode 100755 new mode 100644 index 712b3481..9f91356b --- a/source/server2/get_plugin_address.hpp +++ b/source/server2/get_plugin_address.hpp @@ -1,12 +1,13 @@ #pragma once #ifndef UDA_GETPLUGIN_ADDRESS_HPP -#define UDA_GETPLUGIN_ADDRESS_HPP +# define UDA_GETPLUGIN_ADDRESS_HPP -#include "udaPlugin.h" -#include "export.h" +# include "export.h" +# include "udaPlugin.h" -namespace uda { +namespace uda +{ int get_plugin_address(void** pluginHandle, const char* library, const char* symbol, PLUGINFUNP* pluginfunp); diff --git a/source/server2/make_server_request_block.hpp b/source/server2/make_server_request_block.hpp old mode 100755 new mode 100644 index e554c371..bc4a8dbf --- a/source/server2/make_server_request_block.hpp +++ b/source/server2/make_server_request_block.hpp @@ -1,21 +1,24 @@ #pragma once #ifndef UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP -#define UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP +# define UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP -#include "udaPlugin.h" -#include "udaStructs.h" -#include "export.h" +# include "export.h" +# include "udaPlugin.h" +# include "udaStructs.h" -#include "plugins.hpp" -#include "server_environment.hpp" +# include "plugins.hpp" +# include "server_environment.hpp" -namespace uda { +namespace uda +{ -int makeServerRequestBlock(RequestBlock* request_block, const uda::Plugins& plugins, const server::Environment& environment); +int makeServerRequestBlock(RequestBlock* request_block, const uda::Plugins& plugins, + const server::Environment& environment); -int makeServerRequestData(RequestData* request, const uda::Plugins& plugins, const uda::server::Environment& environment); +int makeServerRequestData(RequestData* request, const uda::Plugins& plugins, + const uda::server::Environment& environment); -} +} // namespace uda #endif // UDA_SERVER_MAKESERVERREQUESTBLOCK_HPP diff --git a/source/server2/plugins.hpp b/source/server2/plugins.hpp index 6fc66751..966c2dea 100644 --- a/source/server2/plugins.hpp +++ b/source/server2/plugins.hpp @@ -1,17 +1,19 @@ #pragma once #ifndef UDA_SERVER_PLUGINS_HPP -#define UDA_SERVER_PLUGINS_HPP +# define UDA_SERVER_PLUGINS_HPP -#include -#include +# include +# include -#include "pluginStructs.h" +# include "pluginStructs.h" -namespace uda { +namespace uda +{ -class Plugins { -public: +class Plugins +{ + public: void init(); void close(); @@ -21,7 +23,7 @@ class Plugins { [[nodiscard]] boost::optional find_by_format(const char* format) const; [[nodiscard]] boost::optional find_by_request(int request) const; -private: + private: std::vector plugins_; void init_serverside_functions(); @@ -33,6 +35,6 @@ class Plugins { void process_config_file(std::ifstream& conf_file); }; -} +} // namespace uda #endif // UDA_SERVER_PLUGINS_HPP \ No newline at end of file diff --git a/source/server2/server.hpp b/source/server2/server.hpp index 5b9a2cc0..7d31e496 100644 --- a/source/server2/server.hpp +++ b/source/server2/server.hpp @@ -1,21 +1,22 @@ #pragma once #ifndef UDA_SERVER_SERVER_HPP -#define UDA_SERVER_SERVER_HPP +# define UDA_SERVER_SERVER_HPP -#include +# include -#include "xdr_protocol.hpp" -#include "plugins.hpp" -#include "get_data.hpp" -#include "server_environment.hpp" +# include "get_data.hpp" +# include "plugins.hpp" +# include "server_environment.hpp" +# include "xdr_protocol.hpp" -#include "clientserver/parseXML.h" -#include "clientserver/socketStructs.h" -#include "cache/memcache.hpp" -#include "export.h" +# include "cache/memcache.hpp" +# include "clientserver/parseXML.h" +# include "clientserver/socketStructs.h" +# include "export.h" -namespace uda { +namespace uda +{ struct MetadataBlock { DataSource data_source; @@ -25,8 +26,9 @@ struct MetadataBlock { DataSystem data_system; }; -class Server { -public: +class Server +{ + public: constexpr static int ServerVersion = 8; constexpr static int LegacyServerVersion = 6; @@ -34,7 +36,7 @@ class Server { LIBRARY_API void run(); LIBRARY_API void close(); -private: + private: void startup(); void loop(); int handle_request(); diff --git a/source/server2/server_environment.hpp b/source/server2/server_environment.hpp old mode 100755 new mode 100644 index 747b4ba9..69c2dc7d --- a/source/server2/server_environment.hpp +++ b/source/server2/server_environment.hpp @@ -1,17 +1,19 @@ #pragma once #ifndef UDA_SERVER_GETSERVERENVIRONMENT_HPP -#define UDA_SERVER_GETSERVERENVIRONMENT_HPP +# define UDA_SERVER_GETSERVERENVIRONMENT_HPP -#include "udaStructs.h" -#include "export.h" +# include "export.h" +# include "udaStructs.h" -namespace uda { -namespace server { +namespace uda +{ +namespace server +{ class Environment { -public: + public: Environment(); void print(); @@ -20,7 +22,7 @@ class Environment ::Environment* operator->() { return &environment_; } const ::Environment* operator->() const { return &environment_; } -private: + private: ::Environment environment_ = {}; }; diff --git a/source/server2/xdr_protocol.hpp b/source/server2/xdr_protocol.hpp index d1956c61..6461bead 100644 --- a/source/server2/xdr_protocol.hpp +++ b/source/server2/xdr_protocol.hpp @@ -1,30 +1,30 @@ #pragma once #ifndef UDA_SERVER_XDR_UDA_PROTOCOL_HPP -#define UDA_SERVER_XDR_UDA_PROTOCOL_HPP +# define UDA_SERVER_XDR_UDA_PROTOCOL_HPP -#include -#include +# include +# include -#include "udaDefines.h" -#include "udaStructs.h" -#include "genStructs.h" -#include "cache/memcache.hpp" -#include "server_environment.hpp" +# include "cache/memcache.hpp" +# include "genStructs.h" +# include "server_environment.hpp" +# include "udaDefines.h" +# include "udaStructs.h" -struct IoData -{ +struct IoData { int* server_tot_block_time; int* server_timeout; }; -namespace uda { +namespace uda +{ struct MetadataBlock; class XdrProtocol { -public: + public: XdrProtocol(); void create(); void set_version(int protocol_version); @@ -57,7 +57,7 @@ class XdrProtocol int server_tot_block_time, const int* server_timeout, LogMallocList* log_malloc_list, UserDefinedTypeList* user_defined_type_list); -private: + private: int protocol_version_ = 8; XDR server_input_; XDR server_output_; @@ -71,6 +71,6 @@ class XdrProtocol void create_streams(); }; -} +} // namespace uda #endif // UDA_SERVER_XDR_UDA_PROTOCOL_HPP \ No newline at end of file