diff --git a/ecal/core/CMakeLists.txt b/ecal/core/CMakeLists.txt index 30c2fbdb12..4c36e95cb3 100644 --- a/ecal/core/CMakeLists.txt +++ b/ecal/core/CMakeLists.txt @@ -416,7 +416,6 @@ endif() ###################################### set(ecal_cmn_src src/ecal.cpp - src/ecal_clang.cpp src/ecal_def.h src/ecal_def_ini.h src/ecal_descgate.cpp @@ -475,7 +474,6 @@ set(ecal_header_cmn include/ecal/types/monitoring.h include/ecal/ecal.h include/ecal/ecal_callback.h - include/ecal/ecal_clang.h include/ecal/ecal_client.h include/ecal/ecal_config.h include/ecal/ecal_core.h diff --git a/lang/python/core/CMakeLists.txt b/lang/python/core/CMakeLists.txt index 6af3801c93..54d91a242a 100644 --- a/lang/python/core/CMakeLists.txt +++ b/lang/python/core/CMakeLists.txt @@ -19,7 +19,9 @@ project(_ecal_core_py) python_add_library(${PROJECT_NAME} MODULE WITH_SOABI - src/ecal_wrap.cxx + src/ecal_clang.cpp + src/ecal_clang.h + src/ecal_wrap.cxx ) target_link_libraries(${PROJECT_NAME} diff --git a/ecal/core/src/ecal_clang.cpp b/lang/python/core/src/ecal_clang.cpp similarity index 83% rename from ecal/core/src/ecal_clang.cpp rename to lang/python/core/src/ecal_clang.cpp index e3b42166ea..420246dc07 100644 --- a/ecal/core/src/ecal_clang.cpp +++ b/lang/python/core/src/ecal_clang.cpp @@ -22,7 +22,8 @@ **/ #include -#include + +#include "ecal_clang.h" #include #include @@ -42,7 +43,7 @@ static char* str_malloc(const std::string& buf_s_) /****************************************/ /* ecal_getversion */ /****************************************/ -ECAL_API const char* ecal_getversion() +const char* ecal_getversion() { return(ECAL_VERSION); } @@ -50,7 +51,7 @@ ECAL_API const char* ecal_getversion() /****************************************/ /* ecal_getversion_components */ /****************************************/ -ECAL_API int ecal_getversion_components(int* major_, int* minor_, int* patch_) +int ecal_getversion_components(int* major_, int* minor_, int* patch_) { return eCAL::GetVersion(major_, minor_, patch_); } @@ -58,7 +59,7 @@ ECAL_API int ecal_getversion_components(int* major_, int* minor_, int* patch_) /****************************************/ /* ecal_getdate */ /****************************************/ -ECAL_API const char* ecal_getdate() +const char* ecal_getdate() { return(ECAL_DATE); } @@ -66,7 +67,7 @@ ECAL_API const char* ecal_getdate() /****************************************/ /* ecal_initialize */ /****************************************/ -ECAL_API int ecal_initialize(int argc_, char **argv_, const char* unit_name_) +int ecal_initialize(int argc_, char **argv_, const char* unit_name_) { return(eCAL::Initialize(argc_, argv_, unit_name_)); } @@ -74,7 +75,7 @@ ECAL_API int ecal_initialize(int argc_, char **argv_, const char* unit_name_) /****************************************/ /* ecal_finalize */ /****************************************/ -ECAL_API int ecal_finalize() +int ecal_finalize() { //* @return Zero if succeeded, 1 if still initialized, -1 if failed. return(eCAL::Finalize()); @@ -83,7 +84,7 @@ ECAL_API int ecal_finalize() /****************************************/ /* ecal_is_initialized */ /****************************************/ -ECAL_API int ecal_is_initialized() +int ecal_is_initialized() { //* @return 1 if eCAL is initialized. return(eCAL::IsInitialized()); @@ -92,7 +93,7 @@ ECAL_API int ecal_is_initialized() /****************************************/ /* ecal_set_unit_name */ /****************************************/ -ECAL_API int ecal_set_unit_name(const char* unit_name_) +int ecal_set_unit_name(const char* unit_name_) { return(eCAL::SetUnitName(unit_name_)); } @@ -100,7 +101,7 @@ ECAL_API int ecal_set_unit_name(const char* unit_name_) /****************************************/ /* ecal_set_process_state */ /****************************************/ -ECAL_API void ecal_set_process_state(const int severity_, const int level_, const char* info_) +void ecal_set_process_state(const int severity_, const int level_, const char* info_) { return(eCAL::Process::SetState(eCAL_Process_eSeverity(severity_), eCAL_Process_eSeverity_Level(level_), info_)); } @@ -108,7 +109,7 @@ ECAL_API void ecal_set_process_state(const int severity_, const int level_, cons /****************************************/ /* ecal_ok */ /****************************************/ -ECAL_API bool ecal_ok() +bool ecal_ok() { return(eCAL::Ok()); } @@ -116,7 +117,7 @@ ECAL_API bool ecal_ok() /****************************************/ /* ecal_free_mem */ /****************************************/ -ECAL_API void ecal_free_mem(void* mem_) +void ecal_free_mem(void* mem_) { free(mem_); } @@ -124,16 +125,15 @@ ECAL_API void ecal_free_mem(void* mem_) /****************************************/ /* ecal_sleep_ms */ /****************************************/ -ECAL_API void ecal_sleep_ms(const long time_ms_) +void ecal_sleep_ms(const long time_ms_) { eCAL::Process::SleepMS(time_ms_); } -#if ECAL_CORE_MONITORING /****************************************/ /* ecal_shutdown_process_uname */ /****************************************/ -ECAL_API void ecal_shutdown_process_uname(const char* unit_name_) +void ecal_shutdown_process_uname(const char* unit_name_) { eCAL::Util::ShutdownProcess(unit_name_); } @@ -141,7 +141,7 @@ ECAL_API void ecal_shutdown_process_uname(const char* unit_name_) /****************************************/ /* ecal_shutdown_process_id */ /****************************************/ -ECAL_API void ecal_shutdown_process_id(const int process_id_) +void ecal_shutdown_process_id(const int process_id_) { eCAL::Util::ShutdownProcess(process_id_); } @@ -149,7 +149,7 @@ ECAL_API void ecal_shutdown_process_id(const int process_id_) /****************************************/ /* ecal_shutdown_processes */ /****************************************/ -ECAL_API void ecal_shutdown_processes() +void ecal_shutdown_processes() { eCAL::Util::ShutdownProcesses(); } @@ -157,16 +157,15 @@ ECAL_API void ecal_shutdown_processes() /****************************************/ /* ecal_shutdown_core */ /****************************************/ -ECAL_API void ecal_shutdown_core() +void ecal_shutdown_core() { eCAL::Util::ShutdownCore(); } -#endif // ECAL_CORE_MONITORING /****************************************/ /* ecal_enable_loopback */ /****************************************/ -ECAL_API void ecal_enable_loopback(const int state_) +void ecal_enable_loopback(const int state_) { eCAL::Util::EnableLoopback(state_ != 0); } @@ -174,7 +173,7 @@ ECAL_API void ecal_enable_loopback(const int state_) /****************************************/ /* get_type_name */ /****************************************/ -ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_) +bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_) { eCAL::SDataTypeInformation topic_info; bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); @@ -202,7 +201,7 @@ ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_typ /****************************************/ /* get_type_encoding */ /****************************************/ -ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_) +bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_) { eCAL::SDataTypeInformation topic_info; bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); @@ -230,7 +229,7 @@ ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic /****************************************/ /* get_description */ /****************************************/ -ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_) +bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_) { eCAL::SDataTypeInformation topic_info; bool ret = eCAL::Util::GetTopicDataTypeInformation(topic_name_, topic_info); @@ -258,7 +257,7 @@ ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_d /****************************************/ /* log_setlevel */ /****************************************/ -ECAL_API void log_setlevel(const int level_) +void log_setlevel(const int level_) { eCAL::Logging::SetLogLevel(eCAL_Logging_eLogLevel(level_)); } @@ -266,17 +265,16 @@ ECAL_API void log_setlevel(const int level_) /****************************************/ /* log_message */ /****************************************/ -ECAL_API void log_message(const char* message_) +void log_message(const char* message_) { eCAL::Logging::Log(message_); } -#if ECAL_CORE_PUBLISHER /****************************************/ /* pub_create */ /****************************************/ -ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_) +ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_) { eCAL::SDataTypeInformation topic_info; topic_info.name = topic_type_; @@ -295,7 +293,7 @@ ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_ /****************************************/ /* pub_destroy */ /****************************************/ -ECAL_API bool pub_destroy(ECAL_HANDLE handle_) +bool pub_destroy(ECAL_HANDLE handle_) { auto* pub = static_cast(handle_); if(pub != nullptr) @@ -312,7 +310,7 @@ ECAL_API bool pub_destroy(ECAL_HANDLE handle_) /****************************************/ /* pub_send */ /****************************************/ -ECAL_API int pub_send(ECAL_HANDLE handle_, const char* payload_, const int length_, const long long time_) +int pub_send(ECAL_HANDLE handle_, const char* payload_, const int length_, const long long time_) { auto* pub = static_cast(handle_); if(pub != nullptr) @@ -344,7 +342,7 @@ static void g_pub_event_callback(const char* topic_name_, const struct eCAL::SPu callback_(topic_name_, &data, par_); } -ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, const PubEventCallbackCT callback_, void* par_) +bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, const PubEventCallbackCT callback_, void* par_) { auto* pub = static_cast(handle_); @@ -355,20 +353,18 @@ ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Ev /****************************************/ /* pub_rem_event_callback */ /****************************************/ -ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_) +bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_) { auto* pub = static_cast(handle_); return(pub->RemEventCallback(type_)); } -#endif // ECAL_CORE_PUBLISHER -#if ECAL_CORE_SUBSCRIBER /****************************************/ /* sub_create */ /****************************************/ -ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_) +ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_) { eCAL::SDataTypeInformation topic_info; topic_info.name = topic_type_; @@ -387,7 +383,7 @@ ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_ /****************************************/ /* sub_destroy */ /****************************************/ -ECAL_API bool sub_destroy(ECAL_HANDLE handle_) +bool sub_destroy(ECAL_HANDLE handle_) { auto* sub = static_cast(handle_); if(sub != nullptr) @@ -401,7 +397,7 @@ ECAL_API bool sub_destroy(ECAL_HANDLE handle_) /****************************************/ /* sub_receive */ /****************************************/ -ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) +int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) { auto* sub = static_cast(handle_); if(sub != nullptr) @@ -439,7 +435,7 @@ ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_bu /****************************************/ /* sub_receive_buffer */ /****************************************/ -ECAL_API bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) +bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, const int timeout_) { auto* sub = static_cast(handle_); if (sub != nullptr) @@ -488,7 +484,7 @@ static void g_sub_receive_callback(const char* topic_name_, const struct eCAL::S callback_(topic_name_, &data, par_); } -ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbackCT callback_, void* par_) +bool sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbackCT callback_, void* par_) { auto* sub = static_cast(handle_); @@ -499,7 +495,7 @@ ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, const ReceiveCallbac /****************************************/ /* sub_rem_receive_callback */ /****************************************/ -ECAL_API bool sub_rem_receive_callback(ECAL_HANDLE handle_) +bool sub_rem_receive_callback(ECAL_HANDLE handle_) { auto* sub = static_cast(handle_); @@ -524,7 +520,7 @@ static void g_sub_event_callback(const char* topic_name_, const struct eCAL::SSu callback_(topic_name_, &data, par_); } -ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const SubEventCallbackCT callback_, void* par_) +bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const SubEventCallbackCT callback_, void* par_) { auto* sub = static_cast(handle_); @@ -535,20 +531,18 @@ ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_E /****************************************/ /* sub_rem_event_callback */ /****************************************/ -ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_) +bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_) { auto* sub = static_cast(handle_); return(sub->RemEventCallback(type_)); } -#endif // ECAL_CORE_SUBSCRIBER -#if ECAL_CORE_SERVICE /****************************************/ /* server_create */ /****************************************/ -ECAL_API ECAL_HANDLE server_create(const char* service_name_) +ECAL_HANDLE server_create(const char* service_name_) { auto* server = new eCAL::CServiceServer; if (!server->Create(service_name_)) @@ -562,7 +556,7 @@ ECAL_API ECAL_HANDLE server_create(const char* service_name_) /****************************************/ /* server_destroy */ /****************************************/ -ECAL_API bool server_destroy(ECAL_HANDLE handle_) +bool server_destroy(ECAL_HANDLE handle_) { auto* server = static_cast(handle_); if (server != nullptr) @@ -590,7 +584,7 @@ static int g_server_method_callback(const std::string& method_, const std::strin return ret; } -ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, const MethodCallbackCT callback_, void* par_) +bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, const MethodCallbackCT callback_, void* par_) { auto* server = static_cast(handle_); if (server != nullptr) @@ -607,7 +601,7 @@ ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* metho /****************************************/ /* server_rem_method_callback */ /****************************************/ -ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_) +bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_) { auto* server = static_cast(handle_); if (server != nullptr) @@ -624,7 +618,7 @@ ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method /****************************************/ /* client_create */ /****************************************/ -ECAL_API ECAL_HANDLE client_create(const char* service_name_) +ECAL_HANDLE client_create(const char* service_name_) { auto* client = new eCAL::CServiceClient; if (!client->Create(service_name_)) @@ -638,7 +632,7 @@ ECAL_API ECAL_HANDLE client_create(const char* service_name_) /****************************************/ /* client_destroy */ /****************************************/ -ECAL_API bool client_destroy(ECAL_HANDLE handle_) +bool client_destroy(ECAL_HANDLE handle_) { auto* client = static_cast(handle_); if (client != nullptr) @@ -655,7 +649,7 @@ ECAL_API bool client_destroy(ECAL_HANDLE handle_) /****************************************/ /* client_set_hostname */ /****************************************/ -ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_) +bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_) { auto* client = static_cast(handle_); if (client != nullptr) @@ -671,7 +665,7 @@ ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_) /****************************************/ /* client_call_method */ /****************************************/ -ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) +bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) { auto* client = static_cast(handle_); if (client != nullptr) @@ -688,7 +682,7 @@ ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, /****************************************/ /* client_call_method_async */ /****************************************/ -ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) +bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, const int request_len_, const int timeout_) { auto* client = static_cast(handle_); if (client != nullptr) @@ -709,14 +703,12 @@ ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_n /****************************************/ /* client_rem_response_callback */ /****************************************/ -#endif // ECAL_CORE_SERVICE -#if ECAL_CORE_MONITORING /****************************************/ /* mon_initialize */ /****************************************/ -ECAL_API int mon_initialize() +int mon_initialize() { return(eCAL::Initialize(0, nullptr, "", eCAL::Init::Monitoring)); } @@ -724,7 +716,7 @@ ECAL_API int mon_initialize() /****************************************/ /* mon_finalize */ /****************************************/ -ECAL_API int mon_finalize() +int mon_finalize() { return(ecal_finalize()); } @@ -732,7 +724,7 @@ ECAL_API int mon_finalize() /****************************************/ /* mon_set_excl_filter */ /****************************************/ -ECAL_API int mon_set_excl_filter(const char* filter_) +int mon_set_excl_filter(const char* filter_) { return(eCAL::Monitoring::SetExclFilter(filter_)); } @@ -740,7 +732,7 @@ ECAL_API int mon_set_excl_filter(const char* filter_) /****************************************/ /* mon_set_incl_filter */ /****************************************/ -ECAL_API int mon_set_incl_filter(const char* filter_) +int mon_set_incl_filter(const char* filter_) { return(eCAL::Monitoring::SetInclFilter(filter_)); } @@ -748,7 +740,7 @@ ECAL_API int mon_set_incl_filter(const char* filter_) /****************************************/ /* mon_set_filter_state */ /****************************************/ -ECAL_API int mon_set_filter_state(const bool state_) +int mon_set_filter_state(const bool state_) { return(eCAL::Monitoring::SetFilterState(state_)); } @@ -756,7 +748,7 @@ ECAL_API int mon_set_filter_state(const bool state_) /****************************************/ /* mon_get_monitoring */ /****************************************/ -ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_) +int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_) { std::string mon_s; const int size = eCAL::Monitoring::GetMonitoring(mon_s); @@ -789,7 +781,7 @@ ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_) /****************************************/ /* mon_get_logging */ /****************************************/ -ECAL_API int mon_get_logging(const char** log_buf_, int* log_buf_len_) +int mon_get_logging(const char** log_buf_, int* log_buf_len_) { std::string log_s; const int size = eCAL::Logging::GetLogging(log_s); @@ -817,4 +809,3 @@ ECAL_API int mon_get_logging(const char** log_buf_, int* log_buf_len_) return(0); } } -#endif // ECAL_CORE_MONITORING diff --git a/ecal/core/include/ecal/ecal_clang.h b/lang/python/core/src/ecal_clang.h similarity index 77% rename from ecal/core/include/ecal/ecal_clang.h rename to lang/python/core/src/ecal_clang.h index 56c00f2e95..10b8f6734e 100644 --- a/ecal/core/include/ecal/ecal_clang.h +++ b/lang/python/core/src/ecal_clang.h @@ -22,8 +22,7 @@ * @brief eCAL C language interface (to wrap ecal into other languages easily) **/ -#ifndef ECAL_CLANG_H_INCLUDED -#define ECAL_CLANG_H_INCLUDED +#pragma once #include @@ -35,7 +34,7 @@ * * @return Full eCAL version string. **/ -ECAL_API const char* ecal_getversion(); +const char* ecal_getversion(); /** * @brief Get eCAL version as separated integer values. @@ -46,14 +45,14 @@ ECAL_API const char* ecal_getversion(); * * @return Zero if succeeded. **/ -ECAL_API int ecal_getversion_components(int* major_, int* minor_, int* patch_); +int ecal_getversion_components(int* major_, int* minor_, int* patch_); /** * @brief Get eCAL version date. * * @return Full eCAL version date string. **/ -ECAL_API const char* ecal_getdate(); +const char* ecal_getdate(); /** * @brief Initialize eCAL API. @@ -64,21 +63,21 @@ ECAL_API const char* ecal_getdate(); * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ -ECAL_API int ecal_initialize(int argc_, char **argv_, const char* unit_name_); +int ecal_initialize(int argc_, char **argv_, const char* unit_name_); /** * @brief Finalize eCAL API. * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ -ECAL_API int ecal_finalize(); +int ecal_finalize(); /** * @brief Check eCAL initialize state. * * @return 1 if eCAL is initialized. **/ -ECAL_API int ecal_is_initialized(); +int ecal_is_initialized(); /** * @brief Set/change the unit name of current module. @@ -87,7 +86,7 @@ ECAL_API int ecal_is_initialized(); * * @return Zero if succeeded. **/ -ECAL_API int ecal_set_unit_name(const char *unit_name_); +int ecal_set_unit_name(const char *unit_name_); /** * @brief Set process state info. @@ -97,14 +96,14 @@ ECAL_API int ecal_set_unit_name(const char *unit_name_); * @param info_ Info message. * **/ -ECAL_API void ecal_set_process_state(int severity_, int level_, const char* info_); +void ecal_set_process_state(int severity_, int level_, const char* info_); /** * @brief Return the eCAL process state. * * @return True if eCAL is in proper state. **/ -ECAL_API bool ecal_ok(); +bool ecal_ok(); /** * @brief Free an eCAL memory block allocated by functions like @@ -130,38 +129,38 @@ ECAL_API bool ecal_ok(); * } * @endcode **/ -ECAL_API void ecal_free_mem(void* mem_); +void ecal_free_mem(void* mem_); /** * @brief Sleep current thread. * * @param time_ms_ Time to sleep in ms. **/ -ECAL_API void ecal_sleep_ms(long time_ms_); +void ecal_sleep_ms(long time_ms_); /** * @brief Send shutdown event to specified local user process using it's unit name. * * @param unit_name_ Process unit name. **/ -ECAL_API void ecal_shutdown_process_uname(const char* unit_name_); +void ecal_shutdown_process_uname(const char* unit_name_); /** * @brief Send shutdown event to specified local user process using it's process id. * * @param process_id_ Process id. **/ -ECAL_API void ecal_shutdown_process_id(int process_id_); +void ecal_shutdown_process_id(int process_id_); /** * @brief Send shutdown event to all local user processes. **/ -ECAL_API void ecal_shutdown_processes(); +void ecal_shutdown_processes(); /** * @brief Send shutdown event to all local core components. **/ -ECAL_API void ecal_shutdown_core(); +void ecal_shutdown_core(); /** * @brief Enable eCAL message loop back, @@ -170,7 +169,7 @@ ECAL_API void ecal_shutdown_core(); * * @param state_ Switch on message loop back.. **/ -ECAL_API void ecal_enable_loopback(int state_); +void ecal_enable_loopback(int state_); /** * @brief Gets type name of the specified topic. @@ -182,7 +181,7 @@ ECAL_API void ecal_enable_loopback(int state_); * * @return True if succeeded. **/ -ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_); +bool ecal_get_type_name(const char* topic_name_, const char** topic_type_, int* topic_type_len_); /** * @brief Gets type encoding of the specified topic. @@ -194,7 +193,7 @@ ECAL_API bool ecal_get_type_name(const char* topic_name_, const char** topic_typ * * @return True if succeeded. **/ -ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_); +bool ecal_get_type_encoding(const char* topic_name_, const char** topic_encoding_, int* topic_encoding_len_); /** * @brief Gets type description of the specified topic. @@ -206,7 +205,7 @@ ECAL_API bool ecal_get_type_encoding(const char* topic_name_, const char** topic * * @return True if succeeded. **/ -ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_); +bool ecal_get_description(const char* topic_name_, const char** topic_desc_, int* topic_desc_len_); /*************************************************************************/ /* logging */ @@ -216,14 +215,14 @@ ECAL_API bool ecal_get_description(const char* topic_name_, const char** topic_d * * @param level_ The level. **/ -ECAL_API void log_setlevel(int level_); +void log_setlevel(int level_); /** * @brief Log a message (with current log level). * * @param message_ The log message string. **/ -ECAL_API void log_message(const char* message_); +void log_message(const char* message_); /*************************************************************************/ /* publisher */ @@ -239,7 +238,7 @@ ECAL_API void log_message(const char* message_); * * @return Handle of the created publisher or NULL if failed. **/ -ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); +ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); /** * @brief Destroy a publisher. @@ -248,7 +247,7 @@ ECAL_API ECAL_HANDLE pub_create(const char* topic_name_, const char* topic_type_ * * @return True if succeeded. **/ -ECAL_API bool pub_destroy(ECAL_HANDLE handle_); +bool pub_destroy(ECAL_HANDLE handle_); /** * @brief Send a message to all subscribers. @@ -260,7 +259,7 @@ ECAL_API bool pub_destroy(ECAL_HANDLE handle_); * * @return Number of bytes sent. **/ -ECAL_API int pub_send(ECAL_HANDLE handle_, const char* payload_, int length_, long long time_); +int pub_send(ECAL_HANDLE handle_, const char* payload_, int length_, long long time_); /** * @brief Add callback function for publisher events. @@ -272,7 +271,7 @@ ECAL_API int pub_send(ECAL_HANDLE handle_, const char* payload_, int length_, lo * * @return True if succeeded. **/ -ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, PubEventCallbackCT callback_, void* par_); +bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_, PubEventCallbackCT callback_, void* par_); /** * @brief Remove callback function for publisher events. @@ -282,7 +281,7 @@ ECAL_API bool pub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Ev * * @return True if succeeded. **/ -ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_); +bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Event type_); /*************************************************************************/ /* subscriber */ @@ -298,7 +297,7 @@ ECAL_API bool pub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Publisher_Ev * * @return Handle of the created subscriber or NULL if failed. **/ -ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); +ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_, const char* topic_enc_, const char* topic_desc_, const int topic_desc_length_); /** * @brief Destroy a subscriber. @@ -307,7 +306,7 @@ ECAL_API ECAL_HANDLE sub_create(const char* topic_name_, const char* topic_type_ * * @return True if succeeded. **/ -ECAL_API bool sub_destroy(ECAL_HANDLE handle_); +bool sub_destroy(ECAL_HANDLE handle_); /** * @brief Receive a message from the publisher. @@ -321,7 +320,7 @@ ECAL_API bool sub_destroy(ECAL_HANDLE handle_); * * @return Length of received buffer. **/ -ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, int timeout_); +int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, int timeout_); /** * @brief Receive a message from the publisher (able to process zero length buffer). @@ -335,7 +334,7 @@ ECAL_API int sub_receive(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_bu * * @return True if succeeded. **/ -ECAL_API bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, int timeout_); +bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int* rcv_buf_len_, long long* rcv_time_, int timeout_); /** * @brief Add callback function for incoming receives. @@ -346,7 +345,7 @@ ECAL_API bool sub_receive_buffer(ECAL_HANDLE handle_, const char** rcv_buf_, int * * @return True if succeeded. **/ -ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); +bool sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); /** * @brief Remove callback function for incoming receives. @@ -355,7 +354,7 @@ ECAL_API bool sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCallbackCT ca * * @return True if succeeded. **/ -ECAL_API bool sub_rem_receive_callback(ECAL_HANDLE handle_); +bool sub_rem_receive_callback(ECAL_HANDLE handle_); /** * @brief Add callback function for subscriber events. @@ -367,7 +366,7 @@ ECAL_API bool sub_rem_receive_callback(ECAL_HANDLE handle_); * * @return True if succeeded. **/ -ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, SubEventCallbackCT callback_, void* par_); +bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, SubEventCallbackCT callback_, void* par_); /** * @brief Remove callback function for subscriber events. @@ -377,7 +376,7 @@ ECAL_API bool sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_E * * @return True if succeeded. **/ -ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); +bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); /*************************************************************************/ /* dyn_json_subscriber */ @@ -389,7 +388,7 @@ ECAL_API bool sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_E * * @return Handle to created subscriber or NULL if failed. **/ -ECAL_API ECAL_HANDLE dyn_json_sub_create(const char* topic_name_); +ECAL_HANDLE dyn_json_sub_create(const char* topic_name_); /** * @brief Destroy a subscriber. @@ -398,7 +397,7 @@ ECAL_API ECAL_HANDLE dyn_json_sub_create(const char* topic_name_); * * @return True if succeeded. **/ -ECAL_API bool dyn_json_sub_destroy(ECAL_HANDLE handle_); +bool dyn_json_sub_destroy(ECAL_HANDLE handle_); /** * @brief Add callback function for incoming receives. @@ -409,7 +408,7 @@ ECAL_API bool dyn_json_sub_destroy(ECAL_HANDLE handle_); * * @return True if succeeded. **/ -ECAL_API bool dyn_json_sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); +bool dyn_json_sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCallbackCT callback_, void* par_); /** * @brief Remove callback function for incoming receives. @@ -418,12 +417,12 @@ ECAL_API bool dyn_json_sub_add_receive_callback(ECAL_HANDLE handle_, ReceiveCall * * @return True if succeeded. **/ -ECAL_API bool dyn_json_sub_rem_receive_callback(ECAL_HANDLE handle_); +bool dyn_json_sub_rem_receive_callback(ECAL_HANDLE handle_); /* TODO: not implemented and not used for now */ -//ECAL_API bool dyn_json_sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const EventCallbackCT callback_, void* par_); -//ECAL_API bool dyn_json_sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); -//ECAL_API bool dyn_json_sub_set_timeout(ECAL_HANDLE handle_, int timeout_); +//bool dyn_json_sub_add_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_, const EventCallbackCT callback_, void* par_); +//bool dyn_json_sub_rem_event_callback(ECAL_HANDLE handle_, enum eCAL_Subscriber_Event type_); +//bool dyn_json_sub_set_timeout(ECAL_HANDLE handle_, int timeout_); /*************************************************************************/ /* service */ @@ -435,7 +434,7 @@ ECAL_API bool dyn_json_sub_rem_receive_callback(ECAL_HANDLE handle_); * * @return Handle to created server or NULL if failed. **/ -ECAL_API ECAL_HANDLE server_create(const char* service_name_); +ECAL_HANDLE server_create(const char* service_name_); /** * @brief Destroy a server. @@ -444,7 +443,7 @@ ECAL_API ECAL_HANDLE server_create(const char* service_name_); * * @return True if succeeded. **/ -ECAL_API bool server_destroy(ECAL_HANDLE handle_); +bool server_destroy(ECAL_HANDLE handle_); /** * @brief Add server method callback. @@ -458,7 +457,7 @@ ECAL_API bool server_destroy(ECAL_HANDLE handle_); * * @return True if succeeded. **/ -ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, MethodCallbackCT callback_, void* par_); +bool server_add_method_callback(ECAL_HANDLE handle_, const char* method_name_, const char* req_type_, const char* resp_type_, MethodCallbackCT callback_, void* par_); /** * @brief Remove server method callback. @@ -468,7 +467,7 @@ ECAL_API bool server_add_method_callback(ECAL_HANDLE handle_, const char* method * * @return True if succeeded. **/ -ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_); +bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method_name_); /** * @brief Create a client. @@ -477,7 +476,7 @@ ECAL_API bool server_rem_method_callback(ECAL_HANDLE handle_, const char* method * * @return Handle to created client or NULL if failed. **/ -ECAL_API ECAL_HANDLE client_create(const char* service_name_); +ECAL_HANDLE client_create(const char* service_name_); /** * @brief Destroy a client. @@ -486,7 +485,7 @@ ECAL_API ECAL_HANDLE client_create(const char* service_name_); * * @return True if succeeded. **/ -ECAL_API bool client_destroy(ECAL_HANDLE handle_); +bool client_destroy(ECAL_HANDLE handle_); /** * @brief Change the host name filter for that client instance @@ -496,7 +495,7 @@ ECAL_API bool client_destroy(ECAL_HANDLE handle_); * * @return True if succeeded. **/ -ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_); +bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_); /** * @brief Call method of this service (none blocking variant with callback). @@ -509,7 +508,7 @@ ECAL_API bool client_set_hostname(ECAL_HANDLE handle_, const char* host_name_); * * @return True if succeeded. **/ -ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, int request_len_, int timeout_); +bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, const char* request_, int request_len_, int timeout_); /** * @brief Call method of this service (asynchronously with callback). @@ -522,11 +521,11 @@ ECAL_API bool client_call_method(ECAL_HANDLE handle_, const char* method_name_, * * @return True if succeeded. **/ -ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, int request_len_, int timeout_); +bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, const char* request_, int request_len_, int timeout_); /* TODO: not implemented and not used for now */ -//ECAL_API client_add_response_callback -//ECAL_API client_rem_response_callback +//client_add_response_callback +//client_rem_response_callback /*************************************************************************/ @@ -537,14 +536,14 @@ ECAL_API bool client_call_method_async(ECAL_HANDLE handle_, const char* method_n * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ -ECAL_API int mon_initialize(); +int mon_initialize(); /** * @brief Finalize eCAL monitoring API. * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ -ECAL_API int mon_finalize(); +int mon_finalize(); /** * @brief Set topics filter blacklist regular expression. @@ -553,7 +552,7 @@ ECAL_API int mon_finalize(); * * @return Zero if succeeded. **/ -ECAL_API int mon_set_excl_filter(const char* filter_); +int mon_set_excl_filter(const char* filter_); /** * @brief Set topics filter whitelist regular expression. @@ -562,7 +561,7 @@ ECAL_API int mon_set_excl_filter(const char* filter_); * * @return Zero if succeeded. **/ -ECAL_API int mon_set_incl_filter(const char* filter_); +int mon_set_incl_filter(const char* filter_); /** * @brief Switch topics filter using regular expression on/off. @@ -571,7 +570,7 @@ ECAL_API int mon_set_incl_filter(const char* filter_); * * @return Zero if succeeded. **/ -ECAL_API int mon_set_filter_state(bool state_); +int mon_set_filter_state(bool state_); /** * @brief Get monitoring protobuf string. @@ -598,7 +597,7 @@ ECAL_API int mon_set_filter_state(bool state_); * } * @endcode **/ -ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_); +int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_); /** * @brief Get logging string. @@ -609,6 +608,4 @@ ECAL_API int mon_get_monitoring(const char** mon_buf_, int* mon_buf_len_); * * @return Logging buffer length or zero if failed. **/ -ECAL_API int mon_get_logging(const char** log_buf_, int* log_buf_len_); - -#endif /* ECAL_CLANG_H_INCLUDED */ +int mon_get_logging(const char** log_buf_, int* log_buf_len_); diff --git a/lang/python/core/src/ecal_wrap.cxx b/lang/python/core/src/ecal_wrap.cxx index a1620ba40f..4066735b66 100644 --- a/lang/python/core/src/ecal_wrap.cxx +++ b/lang/python/core/src/ecal_wrap.cxx @@ -26,7 +26,7 @@ #include -#include +#include "ecal_clang.h" #include #include