diff --git a/app/mon/mon_cli/src/ecal_mon_cli.cpp b/app/mon/mon_cli/src/ecal_mon_cli.cpp index eaf626029e..d961546d5d 100644 --- a/app/mon/mon_cli/src/ecal_mon_cli.cpp +++ b/app/mon/mon_cli/src/ecal_mon_cli.cpp @@ -209,7 +209,7 @@ int main(int argc, char** argv) } // initialize eCAL API - eCAL::Initialize(0, nullptr, "eCALMon CLI", eCAL::Init::All); + eCAL::Initialize("eCALMon CLI", eCAL::Init::All); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); diff --git a/app/mon/mon_gui/src/ecalmon.cpp b/app/mon/mon_gui/src/ecalmon.cpp index e059e2975e..f9edf8ddb9 100644 --- a/app/mon/mon_gui/src/ecalmon.cpp +++ b/app/mon/mon_gui/src/ecalmon.cpp @@ -71,7 +71,7 @@ Ecalmon::Ecalmon(QWidget *parent) , monitor_error_counter_(0) { // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring); + eCAL::Initialize("eCALMon", eCAL::Init::Default | eCAL::Init::Monitoring); eCAL::Monitoring::SetFilterState(false); eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); diff --git a/app/mon/mon_gui/src/widgets/about_dialog/about_dialog.cpp b/app/mon/mon_gui/src/widgets/about_dialog/about_dialog.cpp index 8ae7f4d1a0..c0e5b8c508 100644 --- a/app/mon/mon_gui/src/widgets/about_dialog/about_dialog.cpp +++ b/app/mon/mon_gui/src/widgets/about_dialog/about_dialog.cpp @@ -32,7 +32,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui_.version_label->setText("Version: " + QString(EcalmonGlobals::VERSION_STRING)); ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); - ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")"); + ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")"); ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); ui_.qt_runtime_version_string_label->setText(QString(qVersion())); ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR)); diff --git a/app/mon/mon_tui/src/main.cpp b/app/mon/mon_tui/src/main.cpp index ec360131ca..b5c1007af2 100644 --- a/app/mon/mon_tui/src/main.cpp +++ b/app/mon/mon_tui/src/main.cpp @@ -32,7 +32,7 @@ int main(int argc, char** argv) { auto args = ParseArgs(argc, argv); - auto status = eCAL::Initialize(0, nullptr, "eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring); + auto status = eCAL::Initialize("eCALMon TUI", eCAL::Init::Default | eCAL::Init::Monitoring); if (status == -1) std::cerr << "Failed to init" << std::endl; eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); eCAL::Monitoring::SetFilterState(false); diff --git a/app/play/play_core/src/ecal_play.cpp b/app/play/play_core/src/ecal_play.cpp index 7a11b9c819..5c905e2a0c 100644 --- a/app/play/play_core/src/ecal_play.cpp +++ b/app/play/play_core/src/ecal_play.cpp @@ -37,7 +37,7 @@ EcalPlay::EcalPlay() { LogAppNameVersion(); - eCAL::Initialize(0, nullptr, "eCALPlay"); + eCAL::Initialize("eCALPlay"); play_thread_ = std::make_unique(); play_thread_->Start(); diff --git a/app/play/play_gui/src/main.cpp b/app/play/play_gui/src/main.cpp index 91fcb1618b..48c6afb939 100644 --- a/app/play/play_gui/src/main.cpp +++ b/app/play/play_gui/src/main.cpp @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) ////////////////////////////////////////////////////////////////////////////// // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "eCALPlayGUI", eCAL::Init::Default | eCAL::Init::Publisher | eCAL::Init::Service | eCAL::Init::Monitoring); + eCAL::Initialize("eCALPlayGUI", eCAL::Init::Default | eCAL::Init::Publisher | eCAL::Init::Service | eCAL::Init::Monitoring); // For linux big measurements require more file descriptors than the default value #ifdef ECAL_OS_LINUX diff --git a/app/play/play_gui/src/widgets/about_dialog/about_dialog.cpp b/app/play/play_gui/src/widgets/about_dialog/about_dialog.cpp index 38b938a9fa..13909f2953 100644 --- a/app/play/play_gui/src/widgets/about_dialog/about_dialog.cpp +++ b/app/play/play_gui/src/widgets/about_dialog/about_dialog.cpp @@ -32,7 +32,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui_.version_label->setText("Version: " + QString(EcalPlayGlobals::VERSION_STRING)); ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); - ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")"); + ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")"); ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); ui_.qt_runtime_version_string_label->setText(QString(qVersion())); ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR)); diff --git a/app/rec/rec_client_core/src/ecal_rec.cpp b/app/rec/rec_client_core/src/ecal_rec.cpp index 87d83d1ea7..f699e2f981 100644 --- a/app/rec/rec_client_core/src/ecal_rec.cpp +++ b/app/rec/rec_client_core/src/ecal_rec.cpp @@ -36,7 +36,7 @@ namespace eCAL EcalRec::EcalRec() { - eCAL::Initialize(0, nullptr, "eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring); + eCAL::Initialize("eCALRecClient", eCAL::Init::Default | eCAL::Init::Monitoring); eCAL::Monitoring::SetFilterState(false); recorder_ = std::make_unique(); diff --git a/app/rec/rec_gui/src/main.cpp b/app/rec/rec_gui/src/main.cpp index 4f4e8ff9b7..893aeb73a9 100644 --- a/app/rec/rec_gui/src/main.cpp +++ b/app/rec/rec_gui/src/main.cpp @@ -136,7 +136,7 @@ int main(int argc, char *argv[]) } // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring); + eCAL::Initialize("eCALRecGUI", eCAL::Init::Default | eCAL::Init::Service | eCAL::Init::Monitoring); eCAL::Monitoring::SetFilterState(false); EcalRecGui* w = new EcalRecGui(); diff --git a/app/rec/rec_gui/src/widgets/about_dialog/about_dialog.cpp b/app/rec/rec_gui/src/widgets/about_dialog/about_dialog.cpp index a02cfc0d66..3126a1193a 100644 --- a/app/rec/rec_gui/src/widgets/about_dialog/about_dialog.cpp +++ b/app/rec/rec_gui/src/widgets/about_dialog/about_dialog.cpp @@ -32,7 +32,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui_.version_label->setText("Version: " + QString(ECAL_REC_VERSION_STRING)); ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); - ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")"); + ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")"); ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); ui_.qt_runtime_version_string_label->setText(QString(qVersion())); ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR)); diff --git a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp index cea9f6550a..099da95d24 100644 --- a/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp +++ b/app/rec/rec_server_cli/src/ecal_rec_server_cli.cpp @@ -330,14 +330,14 @@ int main(int argc, char** argv) /************************************************************************/ if (remote_control_arg.isSet()) // Remote-control-mode { - eCAL::Initialize(argc, argv, "eCALRec-Remote", eCAL::Init::All); + eCAL::Initialize("eCALRec-Remote", eCAL::Init::All); eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); remote_rec_server_service = std::make_shared>(); } else // Non-remote control mode { - eCAL::Initialize(argc, argv, "eCALRec", eCAL::Init::All); + eCAL::Initialize("eCALRec", eCAL::Init::All); rec_server_instance = std::make_shared(); diff --git a/app/rec/rec_server_core/src/rec_server_impl.cpp b/app/rec/rec_server_core/src/rec_server_impl.cpp index 48b82fd819..90824dd5af 100644 --- a/app/rec/rec_server_core/src/rec_server_impl.cpp +++ b/app/rec/rec_server_core/src/rec_server_impl.cpp @@ -60,7 +60,7 @@ namespace eCAL settings_.ClearHostFilter(); // There is no global host filter // Initialize eCAL - eCAL::Initialize(0, nullptr, "eCALRec-Server", eCAL::Init::Default | eCAL::Init::Monitoring); + eCAL::Initialize("", eCAL::Init::Default | eCAL::Init::Monitoring); // Start FTP Server ftp_server_->start(5); diff --git a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp index a10e85d405..0c28c4a9ee 100644 --- a/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp +++ b/app/rec/rec_tests/rec_rpc_tests/src/external_ecal_rec.cpp @@ -38,7 +38,7 @@ ExternalEcalRecInstance::ExternalEcalRecInstance(bool gui) { ecal_rec_cli_instance_lock.lock(); - eCAL::Initialize({}, "Ecal Rec Tester"); + eCAL::Initialize("Ecal Rec Tester"); remote_rec_server_service = std::make_shared>(); remote_rec_server_service->SetHostName(eCAL::Process::GetHostName()); diff --git a/app/sys/sys_cli/src/ecalsys_cli.cpp b/app/sys/sys_cli/src/ecalsys_cli.cpp index 5534dba572..8df947597f 100644 --- a/app/sys/sys_cli/src/ecalsys_cli.cpp +++ b/app/sys/sys_cli/src/ecalsys_cli.cpp @@ -237,14 +237,14 @@ int main(int argc, char** argv) /************************************************************************/ if (remote_control_arg.isSet()) // Remote-control-mode { - eCAL::Initialize(0, nullptr, "eCALSys-Remote", eCAL::Init::All); + eCAL::Initialize("eCALSys-Remote", eCAL::Init::All); eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); remote_ecalsys_service = std::make_shared>(); } else // Non-remote control mode { - eCAL::Initialize(0, nullptr, "eCALSys", eCAL::Init::All); + eCAL::Initialize("eCALSys", eCAL::Init::All); eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); ecalsys_instance = std::make_shared(); diff --git a/app/sys/sys_client_cli/src/ecal_sys_client_cli.cpp b/app/sys/sys_client_cli/src/ecal_sys_client_cli.cpp index c965f4e0e5..60d5480556 100644 --- a/app/sys/sys_client_cli/src/ecal_sys_client_cli.cpp +++ b/app/sys/sys_client_cli/src/ecal_sys_client_cli.cpp @@ -113,7 +113,7 @@ int main(int argc, char** argv) logger->info("eCAL Sys Client was started with " + accept_security_risk_arg.longID() + ". Not displaying security warning."); } - eCAL::Initialize(argc, argv, "eCALSysClient", eCAL::Init::Default | eCAL::Init::Monitoring); + eCAL::Initialize("eCALSysClient", eCAL::Init::Default | eCAL::Init::Monitoring); // Print System information std::string config_string; diff --git a/app/sys/sys_gui/src/main.cpp b/app/sys/sys_gui/src/main.cpp index 6327d8884c..88f1415137 100644 --- a/app/sys/sys_gui/src/main.cpp +++ b/app/sys/sys_gui/src/main.cpp @@ -144,7 +144,7 @@ int main(int argc, char *argv[]) ////////////////////////////////////////////////////////////////////////////// // Just make sure that eCAL is initialized - eCAL::Initialize(argc, argv, "eCALSysGUI", eCAL::Init::All); + eCAL::Initialize("eCALSysGUI", eCAL::Init::All); ////////////////////////////////////// // --config diff --git a/app/sys/sys_gui/src/widgets/about_dialog/about_dialog.cpp b/app/sys/sys_gui/src/widgets/about_dialog/about_dialog.cpp index 0cdaa04efa..0651dfb7c4 100644 --- a/app/sys/sys_gui/src/widgets/about_dialog/about_dialog.cpp +++ b/app/sys/sys_gui/src/widgets/about_dialog/about_dialog.cpp @@ -32,7 +32,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui_.version_label->setText("Version: " + QString(ECAL_SYS_VERSION_STRING)); ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); - ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")"); + ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")"); ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); ui_.qt_runtime_version_string_label->setText(QString(qVersion())); ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR)); diff --git a/app/util/config/src/ecal_config.cpp b/app/util/config/src/ecal_config.cpp index a5bdc4db41..bd12ace599 100644 --- a/app/util/config/src/ecal_config.cpp +++ b/app/util/config/src/ecal_config.cpp @@ -23,10 +23,10 @@ #include -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "eCALConfig"); + eCAL::Initialize("eCALConfig"); // print config eCAL::Process::DumpConfig(); diff --git a/app/util/launcher/src/about_dialog.cpp b/app/util/launcher/src/about_dialog.cpp index 4a1470113c..44512e3dbf 100644 --- a/app/util/launcher/src/about_dialog.cpp +++ b/app/util/launcher/src/about_dialog.cpp @@ -31,7 +31,7 @@ AboutDialog::AboutDialog(QWidget *parent) ui_.version_label->setText("Version: " + QString("2.3.0")); ui_.ecalversion_label->setText("eCAL " + QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); - ui_.ecal_runtime_version_string_label->setText(QString(eCAL::GetVersionString()) + " (" + QString(eCAL::GetVersionDateString()) + ")"); + ui_.ecal_runtime_version_string_label->setText(QString::fromStdString(eCAL::GetVersionString()) + " (" + QString::fromStdString(eCAL::GetVersionDateString()) + ")"); ui_.ecal_compiletime_versin_string_label->setText(QString(ECAL_VERSION) + " (" + QString(ECAL_DATE) + ")"); ui_.qt_runtime_version_string_label->setText(QString(qVersion())); ui_.qt_compiletime_version_string_label->setText(QString(QT_VERSION_STR)); diff --git a/app/util/stop/src/ecal_stop.cpp b/app/util/stop/src/ecal_stop.cpp index d90a918d4d..3928fb5311 100644 --- a/app/util/stop/src/ecal_stop.cpp +++ b/app/util/stop/src/ecal_stop.cpp @@ -26,10 +26,10 @@ #include -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "eCALStop", eCAL::Init::All); + eCAL::Initialize("eCALStop", eCAL::Init::All); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "Running"); diff --git a/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp b/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp index 98e748cbd9..c847816fb8 100644 --- a/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp +++ b/contrib/ecaltime/simtime/src/ecal_time_simtime.cpp @@ -39,7 +39,7 @@ bool eCAL::CSimTime::initialize() { std::unique_lock lk(initialize_mutex); if (!is_initialized) { - //eCAL::Initialize(0, NULL, "ecal_sim_time_listener", eCAL::Init::Subscriber); + //eCAL::Initialize("ecal_sim_time_listener", eCAL::Init::Subscriber); // this has to be done by the parent process // needs to be fixed with an improved reference counting // in eCAL::Initialize .. diff --git a/contrib/mma/src/mma_application.cpp b/contrib/mma/src/mma_application.cpp index 0bd4ec8312..87cb5d923a 100644 --- a/contrib/mma/src/mma_application.cpp +++ b/contrib/mma/src/mma_application.cpp @@ -135,7 +135,7 @@ int main(int argc, char** argv) std::cout << app_version_header << std::endl << ecal_version_header << std::endl << std::endl; // initialize eCAL API - if (eCAL::Initialize(0, nullptr, MMA_APPLICATION_NAME, eCAL::Init::Publisher) < 0) + if (eCAL::Initialize(MMA_APPLICATION_NAME, eCAL::Init::Publisher) < 0) { std::cout << "eCAL initialization failed !"; return 1; diff --git a/doc/rst/configuration/src/publisher_config/main.cpp b/doc/rst/configuration/src/publisher_config/main.cpp index a2bf982cba..d601f26d91 100644 --- a/doc/rst/configuration/src/publisher_config/main.cpp +++ b/doc/rst/configuration/src/publisher_config/main.cpp @@ -8,7 +8,7 @@ int main(int argc, char** argv) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "PublisherConfig", eCAL::Init::All); + eCAL::Initialize("PublisherConfig", eCAL::Init::All); // create publisher config eCAL::Publisher::Configuration pub_config; diff --git a/doc/rst/getting_started/src/hello_world/hello_world_rec/main.cpp b/doc/rst/getting_started/src/hello_world/hello_world_rec/main.cpp index 6819eca603..4a41c48f9c 100644 --- a/doc/rst/getting_started/src/hello_world/hello_world_rec/main.cpp +++ b/doc/rst/getting_started/src/hello_world/hello_world_rec/main.cpp @@ -13,7 +13,7 @@ void HelloWorldCallback(const std::string& message) int main(int argc, char** argv) { // Initialize eCAL - eCAL::Initialize(argc, argv, "Hello World Subscriber"); + eCAL::Initialize("Hello World Subscriber"); // Create a subscriber that listenes on the "hello_world_topic" eCAL::string::CSubscriber subscriber("hello_world_topic"); diff --git a/doc/rst/getting_started/src/hello_world/hello_world_snd/main.cpp b/doc/rst/getting_started/src/hello_world/hello_world_snd/main.cpp index 4c5abbf915..2e00d3e2df 100644 --- a/doc/rst/getting_started/src/hello_world/hello_world_snd/main.cpp +++ b/doc/rst/getting_started/src/hello_world/hello_world_snd/main.cpp @@ -7,7 +7,7 @@ int main(int argc, char** argv) { // Initialize eCAL. The name of our Process will be "Hello World Publisher" - eCAL::Initialize(argc, argv, "Hello World Publisher"); + eCAL::Initialize("Hello World Publisher"); // Create a String Publisher that publishes on the topic "hello_world_topic" eCAL::string::CPublisher publisher("hello_world_topic"); diff --git a/doc/rst/getting_started/src/hello_world_protobuf/protobuf_rec/main.cpp b/doc/rst/getting_started/src/hello_world_protobuf/protobuf_rec/main.cpp index d8aef90297..b480240306 100644 --- a/doc/rst/getting_started/src/hello_world_protobuf/protobuf_rec/main.cpp +++ b/doc/rst/getting_started/src/hello_world_protobuf/protobuf_rec/main.cpp @@ -16,7 +16,7 @@ void HelloWorldCallback(const proto_messages::HelloWorld& hello_world_msg) int main(int argc, char** argv) { // Initialize eCAL and create a protobuf subscriber - eCAL::Initialize(argc, argv, "Hello World Protobuf Subscriber"); + eCAL::Initialize("Hello World Protobuf Subscriber"); eCAL::protobuf::CSubscriber subscriber("hello_world_protobuf"); // Set the Callback diff --git a/doc/rst/getting_started/src/hello_world_protobuf/protobuf_snd/main.cpp b/doc/rst/getting_started/src/hello_world_protobuf/protobuf_snd/main.cpp index 59ec17c5bb..8e879f45d4 100644 --- a/doc/rst/getting_started/src/hello_world_protobuf/protobuf_snd/main.cpp +++ b/doc/rst/getting_started/src/hello_world_protobuf/protobuf_snd/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char** argv) { // Initialize eCAL and create a protobuf publisher - eCAL::Initialize(argc, argv, "Hello World Protobuf Publisher"); + eCAL::Initialize("Hello World Protobuf Publisher"); eCAL::protobuf::CPublisher publisher("hello_world_protobuf"); // Ask the user to input his name diff --git a/ecal/core/CMakeLists.txt b/ecal/core/CMakeLists.txt index bce633c093..1eeead5727 100644 --- a/ecal/core/CMakeLists.txt +++ b/ecal/core/CMakeLists.txt @@ -66,7 +66,6 @@ endif() ###################################### set(ecal_config_src src/config/default_configuration.cpp - src/config/ecal_cmd_parser.cpp src/config/ecal_config.cpp src/config/ecal_config_initializer.cpp src/config/transport_layer.cpp diff --git a/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h b/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h index 109a1e449a..62b25d767d 100644 --- a/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h +++ b/ecal/core/include/ecal/cimpl/ecal_core_cimpl.h @@ -57,7 +57,7 @@ extern "C" * * @return Zero if succeeded. **/ - ECALC_API int eCAL_GetVersion(int* major_, int* minor_, int* patch_); + ECALC_API eCAL_SVersion eCAL_GetVersion(); /** * @brief Initialize eCAL API. @@ -69,7 +69,7 @@ extern "C" * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ - ECALC_API int eCAL_Initialize(int argc_, char **argv_, const char *unit_name_, unsigned int components_); + ECALC_API int eCAL_Initialize(const char *unit_name_, unsigned int components_); /** * @brief Set/change the unit name of current module. @@ -90,11 +90,9 @@ extern "C" /** * @brief Check eCAL initialize state. * - * @param component_ Check specific component or 0 for general state of eCAL core. - * * @return None zero if eCAL is initialized. **/ - ECALC_API int eCAL_IsInitialized(unsigned int component_); + ECALC_API int eCAL_IsInitialized(); /** * @brief Return the eCAL process state. diff --git a/ecal/core/include/ecal/config/configuration.h b/ecal/core/include/ecal/config/configuration.h index 47c4b3fc53..a99f7832b3 100644 --- a/ecal/core/include/ecal/config/configuration.h +++ b/ecal/core/include/ecal/config/configuration.h @@ -60,8 +60,6 @@ namespace eCAL Cli::Configuration command_line_arguments; ECAL_API Configuration(); - ECAL_API Configuration(int argc_, char** argv_); - ECAL_API Configuration(const std::vector& args_); ECAL_API void InitFromConfig(); ECAL_API void InitFromFile(const std::string& yaml_path_); diff --git a/ecal/core/include/ecal/ecal_core.h b/ecal/core/include/ecal/ecal_core.h index a725191b75..9c6b2088c5 100644 --- a/ecal/core/include/ecal/ecal_core.h +++ b/ecal/core/include/ecal/ecal_core.h @@ -32,6 +32,7 @@ #include #include +#include namespace eCAL { @@ -40,48 +41,31 @@ namespace eCAL * * @return Full eCAL version string. **/ - ECAL_API const char* GetVersionString(); + ECAL_API std::string GetVersionString(); /** * @brief Get eCAL version date. * * @return Full eCAL version date string. **/ - ECAL_API const char* GetVersionDateString(); + ECAL_API std::string GetVersionDateString(); /** - * @brief Get eCAL version as separated integer values. + * @brief Get eCAL version as separated integer values. * - * @param [out] major_ The eCAL major version number. - * @param [out] minor_ The eCAL minor version number. - * @param [out] patch_ The eCAL patch version number. - * - * @return Zero if succeeded. + * @return struct SVersion that contains major, minor and patch value. **/ - ECAL_API int GetVersion(int* major_, int* minor_, int* patch_); + ECAL_API SVersion GetVersion(); /** * @brief Initialize eCAL API. * - * @param argc_ Number of command line arguments. - * @param argv_ Array of command line arguments. - * @param unit_name_ Defines the name of the eCAL unit. - * @param components_ Defines which component to initialize. - * - * @return Zero if succeeded, 1 if already initialized, -1 if failed. - **/ - ECAL_API int Initialize(int argc_ = 0, char **argv_ = nullptr, const char *unit_name_ = nullptr, unsigned int components_ = Init::Default); - - /** - * @brief Initialize eCAL API. - * - * @param args_ Vector of config arguments to overwrite (["arg1", "value1", "arg2", "arg3", "value3" ..]). * @param unit_name_ Defines the name of the eCAL unit. * @param components_ Defines which component to initialize. * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ - ECAL_API int Initialize(std::vector args_, const char *unit_name_ = nullptr, unsigned int components_ = Init::Default); + ECAL_API int Initialize(const std::string& unit_name_ = "", unsigned int components_ = Init::Default); /** * @brief Initialize eCAL API. @@ -92,7 +76,7 @@ namespace eCAL * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ - ECAL_API int Initialize(eCAL::Configuration& config_, const char *unit_name_ = nullptr, unsigned int components_ = Init::Default); + ECAL_API int Initialize(eCAL::Configuration& config_, const std::string& unit_name_ = "", unsigned int components_ = Init::Default); /** * @brief Finalize eCAL API. @@ -104,11 +88,19 @@ namespace eCAL /** * @brief Check eCAL initialize state. * - * @param component_ Check specific component or 0 for general state of eCAL core. - * * @return 1 if eCAL is initialized. **/ - ECAL_API int IsInitialized(unsigned int component_ = 0); + ECAL_API int IsInitialized(); + + /** + * @brief Check initialization state for a specific component. + * + * @param component_ Specific component to check + * + * @return 1 if eCAL component is initialized. + **/ + ECAL_API int IsInitialized(unsigned int component_); + /** * @brief Set/change the unit name of current module. @@ -117,7 +109,7 @@ namespace eCAL * * @return Zero if succeeded. **/ - ECAL_API int SetUnitName(const char *unit_name_); + ECAL_API int SetUnitName(const std::string& unit_name_); /** * @brief Return the eCAL process state. diff --git a/ecal/core/include/ecal/ecal_process.h b/ecal/core/include/ecal/ecal_process.h index 1282d45b9c..cca66d526a 100644 --- a/ecal/core/include/ecal/ecal_process.h +++ b/ecal/core/include/ecal/ecal_process.h @@ -70,7 +70,7 @@ namespace eCAL ECAL_API std::string GetUnitName(); /** - * @brief Get current process parameter (defined via eCAL::Initialize(argc_, arg_v). + * @brief Get current process parameter (defined via eCAL::Initialize(argc, argv). * * @param sep_ Separator. * diff --git a/ecal/core/include/ecal/ecal_types.h b/ecal/core/include/ecal/ecal_types.h index 819632a7f8..e4883af14c 100644 --- a/ecal/core/include/ecal/ecal_types.h +++ b/ecal/core/include/ecal/ecal_types.h @@ -29,6 +29,16 @@ namespace eCAL { + /** + * @brief eCAL version struct + **/ + struct SVersion + { + const int major; //!< major version number + const int minor; //!< minor version number + const int patch; //!< patch version number + }; + /** * @brief Optional compile time information associated with a given topic * (necessary for reflection / runtime type checking) diff --git a/ecal/core/include/ecal/ecalc_types.h b/ecal/core/include/ecal/ecalc_types.h index 61d88706fd..48637f6db9 100644 --- a/ecal/core/include/ecal/ecalc_types.h +++ b/ecal/core/include/ecal/ecalc_types.h @@ -35,4 +35,14 @@ **/ typedef void* ECAL_HANDLE; +/** + * @brief eCAL version struct (C variant) + **/ +typedef struct +{ + int major; //!< major version number + int minor; //!< minor version number + int patch; //!< patch version number +} eCAL_SVersion; + #endif /* ecalc_types_h_included */ diff --git a/ecal/core/src/cimpl/ecal_core_cimpl.cpp b/ecal/core/src/cimpl/ecal_core_cimpl.cpp index ead763f96d..bf0a12214f 100644 --- a/ecal/core/src/cimpl/ecal_core_cimpl.cpp +++ b/ecal/core/src/cimpl/ecal_core_cimpl.cpp @@ -29,31 +29,29 @@ extern "C" { ECALC_API const char* eCAL_GetVersionString() { - return(ECAL_VERSION); + return ECAL_VERSION; } ECALC_API const char* eCAL_GetVersionDateString() { - return(ECAL_DATE); + return ECAL_DATE; } - ECALC_API int eCAL_GetVersion(int* major_, int* minor_, int* patch_) + ECALC_API eCAL_SVersion eCAL_GetVersion() { - if ((major_ == nullptr) || (minor_ == nullptr) || (patch_ == nullptr)) return(-1); - *major_ = ECAL_VERSION_MAJOR; - *minor_ = ECAL_VERSION_MINOR; - *patch_ = ECAL_VERSION_PATCH; - return(0); + return eCAL_SVersion{ eCAL::GetVersion().major, eCAL::GetVersion().minor, eCAL::GetVersion().patch }; } - ECALC_API int eCAL_Initialize(int argc_, char** argv_, const char* unit_name_, unsigned int components_) + ECALC_API int eCAL_Initialize(const char* unit_name_, unsigned int components_) { - return(eCAL::Initialize(argc_, argv_, unit_name_, components_)); + const std::string unit_name = (unit_name_ != nullptr) ? std::string(unit_name_) : std::string(""); + return eCAL::Initialize(unit_name, components_); } ECALC_API int eCAL_SetUnitName(const char* unit_name_) { - return(eCAL::SetUnitName(unit_name_)); + const std::string unit_name = (unit_name_ != nullptr) ? std::string(unit_name_) : std::string(""); + return(eCAL::SetUnitName(unit_name)); } ECALC_API int eCAL_Finalize() @@ -61,9 +59,9 @@ extern "C" return(eCAL::Finalize()); } - ECALC_API int eCAL_IsInitialized(unsigned int component_) + ECALC_API int eCAL_IsInitialized() { - return(eCAL::IsInitialized(component_)); + return(eCAL::IsInitialized()); } ECALC_API int eCAL_Ok() diff --git a/ecal/core/src/config/ecal_cmd_parser.cpp b/ecal/core/src/config/ecal_cmd_parser.cpp deleted file mode 100644 index 0d9c26af50..0000000000 --- a/ecal/core/src/config/ecal_cmd_parser.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2024 Continental Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ========================= eCAL LICENSE ================================= -*/ - -#include "config/ecal_cmd_parser.h" - -#include "ecal/ecal_defs.h" -#include "ecal_def.h" - -#if ECAL_CORE_COMMAND_LINE - #include "util/advanced_tclap_output.h" -#endif - -#include - - -namespace eCAL -{ - namespace Config - { - CmdParser::CmdParser() - : m_dump_config{false} - {} - - CmdParser::CmdParser(const std::vector& arguments_) - : CmdParser() - { - parseArguments(arguments_); - } - - void CmdParser::parseArguments(const std::vector& arguments_) - { -#if ECAL_CORE_COMMAND_LINE - if (!arguments_.empty()) - { - // define command line object - TCLAP::CmdLine cmd("", ' ', ECAL_VERSION); - - // define command line arguments - TCLAP::SwitchArg dump_config_arg ("", "ecal-dump-config", "Dump current configuration.", false); - TCLAP::ValueArg default_ini_file_arg("", "ecal-config-file", "Load default configuration from that file.", false, ECAL_DEFAULT_CFG, "string"); - - TCLAP::UnlabeledMultiArg dummy_arg("__dummy__", "Dummy", false, ""); // Dummy arg to eat all unrecognized arguments - - cmd.add(dump_config_arg); - cmd.add(default_ini_file_arg); - cmd.add(dummy_arg); - - CustomTclap::AdvancedTclapOutput advanced_tclap_output(&std::cout, 75); - advanced_tclap_output.setArgumentHidden(&dummy_arg, true); - cmd.setOutput(&advanced_tclap_output); - - std::vector arguments = arguments_; - // parse command line - cmd.parse(arguments); - - // set globals - if (dump_config_arg.isSet()) - { - m_dump_config = true; - } - if (default_ini_file_arg.isSet()) - { - m_user_ini = default_ini_file_arg.getValue(); - } - } -#endif - } - - bool CmdParser::getDumpConfig() const { return m_dump_config; } - std::string& CmdParser::getUserIni() { return m_user_ini; } - } -} diff --git a/ecal/core/src/config/ecal_cmd_parser.h b/ecal/core/src/config/ecal_cmd_parser.h deleted file mode 100644 index bc0dec7c86..0000000000 --- a/ecal/core/src/config/ecal_cmd_parser.h +++ /dev/null @@ -1,60 +0,0 @@ -/* ========================= eCAL LICENSE ================================= - * - * Copyright (C) 2016 - 2024 Continental Corporation - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - * ========================= eCAL LICENSE ================================= -*/ - -/** - * @brief Utility class for parsing cmd line arguments into eCAL useful structures. -**/ - -#pragma once - -#include - -#include -#include -#include - -namespace eCAL -{ - namespace Config - { - /** - * @brief Class for parsing and storing command line arguments and their values. - * Defaults as empty strings, vectors and false booleans. - * - * @param argc_ Number of arguments - * @param argv_ Array of arguments - * - **/ - class CmdParser - { - public: - CmdParser(const std::vector& arguments_); - CmdParser(); - - void parseArguments(const std::vector& arguments_); - - bool getDumpConfig() const; - std::string& getUserIni(); - - private: - bool m_dump_config; - std::string m_user_ini; - }; - } -} \ No newline at end of file diff --git a/ecal/core/src/config/ecal_config_initializer.cpp b/ecal/core/src/config/ecal_config_initializer.cpp index 602bda36a6..9d005ef577 100644 --- a/ecal/core/src/config/ecal_config_initializer.cpp +++ b/ecal/core/src/config/ecal_config_initializer.cpp @@ -28,7 +28,6 @@ #include "ecal_def.h" #include "ecal/ecal_process.h" -#include "config/ecal_cmd_parser.h" #ifdef ECAL_CORE_CONFIGURATION #include "configuration_reader.h" @@ -207,22 +206,6 @@ namespace return found_path + config_file_; } - - std::vector ConvertArgcArgvToVector(int argc_, char** argv_) - { - std::vector arguments; - if (argv_ == nullptr) return arguments; - - for (size_t i = 0; i < static_cast(argc_); ++i) - { - if (argv_[i] != nullptr) - { - arguments.emplace_back(argv_[i]); - } - } - - return arguments; - } } namespace eCAL @@ -245,28 +228,6 @@ namespace eCAL } } - Configuration::Configuration(int argc_ , char **argv_) - : Configuration(ConvertArgcArgvToVector(argc_, argv_)) - { - } - - Configuration::Configuration(const std::vector& args_) - { - Config::CmdParser parser(args_); - - command_line_arguments.user_yaml = parser.getUserIni(); - command_line_arguments.dump_config = parser.getDumpConfig(); - - if (!command_line_arguments.user_yaml.empty()) - { - InitFromFile(command_line_arguments.user_yaml); - } - else - { - InitFromConfig(); - } - } - void Configuration::InitFromConfig() { InitFromFile(g_default_ini_file); diff --git a/ecal/core/src/ecal.cpp b/ecal/core/src/ecal.cpp index 5fbd3296e8..e689e4012c 100644 --- a/ecal/core/src/ecal.cpp +++ b/ecal/core/src/ecal.cpp @@ -24,7 +24,6 @@ #include "ecal_def.h" #include "ecal_event.h" #include "ecal_globals.h" -#include "config/ecal_cmd_parser.h" #include #include @@ -55,9 +54,9 @@ namespace eCAL * * @return Full eCAL version string. **/ - const char* GetVersionString() + std::string GetVersionString() { - return(ECAL_VERSION); + return ECAL_VERSION; } /** @@ -65,58 +64,32 @@ namespace eCAL * * @return Full eCAL version date string. **/ - const char* GetVersionDateString() + std::string GetVersionDateString() { - return(ECAL_DATE); + return ECAL_DATE; } /** * @brief Get eCAL version as separated integer values. * - * @param [out] major_ The eCAL major version number. - * @param [out] minor_ The eCAL minor version number. - * @param [out] patch_ The eCAL patch version number. - * - * @return Zero if succeeded. + * @return struct SVersion that contains major, minor and patch value. **/ - int GetVersion(int* major_, int* minor_, int* patch_) + SVersion GetVersion() { - if((major_ == nullptr) || (minor_ == nullptr) || (patch_ == nullptr)) return(-1); - *major_ = ECAL_VERSION_MAJOR; - *minor_ = ECAL_VERSION_MINOR; - *patch_ = ECAL_VERSION_PATCH; - return(0); + return SVersion{ ECAL_VERSION_MAJOR, ECAL_VERSION_MINOR, ECAL_VERSION_PATCH }; } /** * @brief Initialize eCAL API. * - * @param argc_ Number of command line arguments. - * @param argv_ Array of command line arguments. - * @param unit_name_ Defines the name of the eCAL unit. - * @param components_ Defines which component to initialize. - * - * @return Zero if succeeded, 1 if already initialized, -1 if failed. - **/ - int Initialize(int argc_ , char **argv_, const char *unit_name_, unsigned int components_) - { - eCAL::Configuration config(argc_, argv_); - - return Initialize(config, unit_name_, components_); - } - - /** - * @brief Initialize eCAL API. - * - * @param args_ Vector of config arguments to overwrite (["arg1", "value1", "arg2", "arg3", "value3" ..]). * @param unit_name_ Defines the name of the eCAL unit. * @param components_ Defines which component to initialize. * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ - int Initialize(std::vector args_, const char *unit_name_, unsigned int components_) //-V826 + int Initialize(const std::string& unit_name_ /*= ""*/, unsigned int components_ /*= Init::Default*/) { - eCAL::Configuration config(args_); + eCAL::Configuration config; return Initialize(config, unit_name_, components_); } @@ -130,16 +103,13 @@ namespace eCAL * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ - int Initialize(eCAL::Configuration& config_, const char *unit_name_ /*= nullptr*/, unsigned int components_ /*= Init::Default*/) + int Initialize(eCAL::Configuration& config_, const std::string& unit_name_ /*= nullptr*/, unsigned int components_ /*= Init::Default*/) { InitGlobals(); g_ecal_configuration = config_; - if (unit_name_ != nullptr) - { - SetGlobalUnitName(unit_name_); - } + SetGlobalUnitName(unit_name_.c_str()); g_globals_ctx_ref_cnt++; @@ -154,6 +124,20 @@ namespace eCAL return success; } + /** + * @brief Check eCAL initialize state. + * + * @param component_ Check specific component or 0 for general state of eCAL core. + * + * @return 1 if eCAL is initialized. + **/ + int IsInitialized() + { + if (g_globals_ctx == nullptr) return(0); + if(g_globals()->IsInitialized()) return(1); + return(0); + } + /** * @brief Check eCAL initialize state. * @@ -164,7 +148,7 @@ namespace eCAL int IsInitialized(unsigned int component_) { if (g_globals_ctx == nullptr) return(0); - if(g_globals()->IsInitialized(component_)) return(1); + if (g_globals()->IsInitialized(component_)) return(1); return(0); } @@ -175,14 +159,10 @@ namespace eCAL * * @return Zero if succeeded, -1 if failed. **/ - int SetUnitName(const char *unit_name_) + int SetUnitName(const std::string& unit_name_) { - if (unit_name_ == nullptr) return -1; - - const std::string uname = unit_name_; - if (uname.empty()) return -1; - - g_unit_name = uname; + if (unit_name_.empty()) return -1; + g_unit_name = unit_name_; return 0; } diff --git a/ecal/core/src/ecal_globals.cpp b/ecal/core/src/ecal_globals.cpp index 70eeeb3ec3..40d7aca23a 100644 --- a/ecal/core/src/ecal_globals.cpp +++ b/ecal/core/src/ecal_globals.cpp @@ -239,14 +239,13 @@ namespace eCAL else return 1; } - bool CGlobals::IsInitialized(unsigned int component_) + bool CGlobals::IsInitialized() { - // check common initialization - if (component_ == 0) - { - return(initialized); - } + return initialized; + } + bool CGlobals::IsInitialized(unsigned int component_) + { // check single component initialization switch (component_) { diff --git a/ecal/core/src/ecal_globals.h b/ecal/core/src/ecal_globals.h index 1104452960..72dd12e60e 100644 --- a/ecal/core/src/ecal_globals.h +++ b/ecal/core/src/ecal_globals.h @@ -62,6 +62,7 @@ namespace eCAL ~CGlobals(); int Initialize ( unsigned int components_); + bool IsInitialized (); bool IsInitialized ( unsigned int component_ ); unsigned int GetComponents() const { return(components); }; diff --git a/ecal/core/src/ecal_util.cpp b/ecal/core/src/ecal_util.cpp index 30ff733868..050c995f0d 100644 --- a/ecal/core/src/ecal_util.cpp +++ b/ecal/core/src/ecal_util.cpp @@ -39,7 +39,7 @@ namespace eCAL { if (IsInitialized(Init::Monitoring) == 0) { - Initialize(0, nullptr, "", Init::Monitoring); + Initialize("", Init::Monitoring); Process::SleepMS(1000); } diff --git a/ecal/samples/c/pubsub/string/minimal_rec/src/minimal_rec.c b/ecal/samples/c/pubsub/string/minimal_rec/src/minimal_rec.c index cd0a2320c4..825b8b3497 100644 --- a/ecal/samples/c/pubsub/string/minimal_rec/src/minimal_rec.c +++ b/ecal/samples/c/pubsub/string/minimal_rec/src/minimal_rec.c @@ -20,7 +20,7 @@ #include #include -int main(int argc, char **argv) +int main() { ECAL_HANDLE sub = 0; int success = 0; @@ -29,7 +29,7 @@ int main(int argc, char **argv) long long time = 0; // initialize eCAL API - eCAL_Initialize(argc, argv, "minimalc_rec", eCAL_Init_Default); + eCAL_Initialize("minimalc_rec", eCAL_Init_Default); // create subscriber "Hello" sub = eCAL_Sub_New(); diff --git a/ecal/samples/c/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.c b/ecal/samples/c/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.c index 42eaf829fc..6d6d6e04da 100644 --- a/ecal/samples/c/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.c +++ b/ecal/samples/c/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.c @@ -28,12 +28,12 @@ void OnReceive(const char* topic_name_, const struct SReceiveCallbackDataC* data printf("\"%.*s\"\n", (int)(data_->size), (char*)(data_->buf)); } -int main(int argc, char **argv) +int main() { ECAL_HANDLE sub = 0; // initialize eCAL API - eCAL_Initialize(argc, argv, "minimalc_rec_cb", eCAL_Init_Default); + eCAL_Initialize("minimalc_rec_cb", eCAL_Init_Default); // create subscriber "Hello" sub = eCAL_Sub_New(); diff --git a/ecal/samples/c/pubsub/string/minimal_snd/src/minimal_snd.c b/ecal/samples/c/pubsub/string/minimal_snd/src/minimal_snd.c index cb3698b18c..c8d9721452 100644 --- a/ecal/samples/c/pubsub/string/minimal_snd/src/minimal_snd.c +++ b/ecal/samples/c/pubsub/string/minimal_snd/src/minimal_snd.c @@ -21,14 +21,14 @@ #include #include -int main(int argc, char **argv) +int main() { ECAL_HANDLE pub = 0; char snd_s[] = "HELLO WORLD FROM C"; int sent = 0; // initialize eCAL API - eCAL_Initialize(argc, argv, "minimalc_snd", eCAL_Init_Default); + eCAL_Initialize("minimalc_snd", eCAL_Init_Default); // create publisher "Hello" pub = eCAL_Pub_New(); diff --git a/ecal/samples/c/services/minimal_client_c/src/minimal_client_c.c b/ecal/samples/c/services/minimal_client_c/src/minimal_client_c.c index 44d08b869a..6ee05760f8 100644 --- a/ecal/samples/c/services/minimal_client_c/src/minimal_client_c.c +++ b/ecal/samples/c/services/minimal_client_c/src/minimal_client_c.c @@ -20,13 +20,13 @@ #include #include -int main(int argc, char **argv) +int main() { // the client handle ECAL_HANDLE hclient = 0; // initialize eCAL API - eCAL_Initialize(argc, argv, "minimal client c", eCAL_Init_Default); + eCAL_Initialize("minimal client c", eCAL_Init_Default); // create client for "service1" hclient = eCAL_Client_Create("service1"); diff --git a/ecal/samples/c/services/minimal_server_c/src/minimal_server_c.c b/ecal/samples/c/services/minimal_server_c/src/minimal_server_c.c index 8884127f00..ae9923233e 100644 --- a/ecal/samples/c/services/minimal_server_c/src/minimal_server_c.c +++ b/ecal/samples/c/services/minimal_server_c/src/minimal_server_c.c @@ -47,12 +47,12 @@ int OnMethodCallback(const char* method_, const char* req_type_, const char* res return 42; } -int main(int argc, char **argv) +int main() { ECAL_HANDLE hserver = 0; // initialize eCAL API - eCAL_Initialize(argc, argv, "minimal server c", eCAL_Init_Default); + eCAL_Initialize("minimal server c", eCAL_Init_Default); // create server "service1" hserver = eCAL_Server_Create("service1"); diff --git a/ecal/samples/cpp/benchmarks/counter_rec/src/counter_rec.cpp b/ecal/samples/cpp/benchmarks/counter_rec/src/counter_rec.cpp index 986371abfc..614d0a380c 100644 --- a/ecal/samples/cpp/benchmarks/counter_rec/src/counter_rec.cpp +++ b/ecal/samples/cpp/benchmarks/counter_rec/src/counter_rec.cpp @@ -21,10 +21,10 @@ #include -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "counter_rec_cb"); + eCAL::Initialize("counter_rec_cb"); // create subscriber for topic "Counter" eCAL::SDataTypeInformation datatype_information; diff --git a/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp b/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp index 9f372db897..6833ec518f 100644 --- a/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp +++ b/ecal/samples/cpp/benchmarks/counter_snd/src/counter_snd.cpp @@ -31,7 +31,7 @@ int main(int argc, char **argv) if(payload_size < 1) payload_size = 1; // initialize eCAL API - eCAL::Initialize(argc, argv, "counter_snd"); + eCAL::Initialize("counter_snd"); // create publisher for topic "Counter" eCAL::CPublisher pub("Counter", { "", "long long", "" }); diff --git a/ecal/samples/cpp/benchmarks/datarate_rec/src/datarate_rec.cpp b/ecal/samples/cpp/benchmarks/datarate_rec/src/datarate_rec.cpp index 2d3dc63a1c..97010ba096 100644 --- a/ecal/samples/cpp/benchmarks/datarate_rec/src/datarate_rec.cpp +++ b/ecal/samples/cpp/benchmarks/datarate_rec/src/datarate_rec.cpp @@ -43,7 +43,7 @@ int main(int argc, char** argv) std::cout << "Topic name = " << topic_name << std::endl; // initialize eCAL API - eCAL::Initialize(argc, argv, "datarate_rec"); + eCAL::Initialize("datarate_rec"); // new subscriber eCAL::CSubscriber sub(topic_name); diff --git a/ecal/samples/cpp/benchmarks/datarate_snd/src/datarate_snd.cpp b/ecal/samples/cpp/benchmarks/datarate_snd/src/datarate_snd.cpp index 90e491acdd..df987b2228 100644 --- a/ecal/samples/cpp/benchmarks/datarate_snd/src/datarate_snd.cpp +++ b/ecal/samples/cpp/benchmarks/datarate_snd/src/datarate_snd.cpp @@ -62,7 +62,7 @@ int main(int argc, char **argv) std::cout << "Acknowledgement time = " << acknowledge_time << " ms" << std::endl; // initialize eCAL API - eCAL::Initialize(argc, argv, "datarate_snd"); + eCAL::Initialize("datarate_snd"); // create publisher config eCAL::Publisher::Configuration pub_config; diff --git a/ecal/samples/cpp/benchmarks/dynsize_snd/src/dynsize_snd.cpp b/ecal/samples/cpp/benchmarks/dynsize_snd/src/dynsize_snd.cpp index 460949672e..6aac3a5896 100644 --- a/ecal/samples/cpp/benchmarks/dynsize_snd/src/dynsize_snd.cpp +++ b/ecal/samples/cpp/benchmarks/dynsize_snd/src/dynsize_snd.cpp @@ -21,10 +21,10 @@ #include #include -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "dynsize_snd"); + eCAL::Initialize("dynsize_snd"); // publisher for topic "Performance" eCAL::CPublisher pub("Performance"); diff --git a/ecal/samples/cpp/benchmarks/latency_rec/src/latency_rec.cpp b/ecal/samples/cpp/benchmarks/latency_rec/src/latency_rec.cpp index 87a074cb01..a5c33af7d2 100644 --- a/ecal/samples/cpp/benchmarks/latency_rec/src/latency_rec.cpp +++ b/ecal/samples/cpp/benchmarks/latency_rec/src/latency_rec.cpp @@ -59,7 +59,7 @@ void on_receive(const struct eCAL::SReceiveCallbackData* data_, SCallbackPar* pa void do_run(int delay_, std::string& log_file_) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "latency_rec"); + eCAL::Initialize("latency_rec"); // subscriber eCAL::CSubscriber sub("ping"); diff --git a/ecal/samples/cpp/benchmarks/latency_snd/src/latency_snd.cpp b/ecal/samples/cpp/benchmarks/latency_snd/src/latency_snd.cpp index d4822471ec..33f25c277e 100644 --- a/ecal/samples/cpp/benchmarks/latency_snd/src/latency_snd.cpp +++ b/ecal/samples/cpp/benchmarks/latency_snd/src/latency_snd.cpp @@ -47,7 +47,7 @@ void do_run(const int runs, int snd_size /*kB*/, int mem_buffer, bool zero_copy) } // initialize eCAL API - eCAL::Initialize(0, nullptr, "latency_snd"); + eCAL::Initialize("latency_snd"); // create publisher config eCAL::Publisher::Configuration pub_config; diff --git a/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp b/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp index 188badb2b2..fb8bf4105a 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp +++ b/ecal/samples/cpp/benchmarks/many_connections_rec/src/many_connections_rec.cpp @@ -56,10 +56,10 @@ class SubscriberCreator }; -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "many_connections_rec"); + eCAL::Initialize("many_connections_rec"); // create many subscriber const SubscriberCreator subscribers(10000); diff --git a/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp b/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp index 623d8a4dbf..03470088e4 100644 --- a/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp +++ b/ecal/samples/cpp/benchmarks/many_connections_snd/src/many_connections_snd.cpp @@ -55,10 +55,10 @@ class PublisherCreator }; -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "many_connections_snd"); + eCAL::Initialize("many_connections_snd"); // create many publisher PublisherCreator publishers(10000); diff --git a/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp b/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp index 873da27964..61765cd85e 100644 --- a/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp +++ b/ecal/samples/cpp/benchmarks/massive_pub_sub/src/massive_pub_sub.cpp @@ -54,7 +54,7 @@ std::string GenerateSizedString(const std::string& name, size_t totalSize) return result; } -int main(int /*argc*/, char** /*argv*/) +int main() { // set eCAL configuration eCAL::Configuration configuration; diff --git a/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp b/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp index e60c548cfb..444ab54167 100644 --- a/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp +++ b/ecal/samples/cpp/benchmarks/multiple_rec/src/multiple_rec.cpp @@ -57,10 +57,10 @@ void OnReceive(const char* topic_name_) g_overalll_read++; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "multiple_rec_cb"); + eCAL::Initialize("multiple_rec_cb"); // create dummy subscriber std::cout << "create subscribers .." << std::endl; diff --git a/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp b/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp index 95ef14fe66..4a33e06548 100644 --- a/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp +++ b/ecal/samples/cpp/benchmarks/multiple_snd/src/multiple_snd.cpp @@ -31,10 +31,10 @@ #define PRINT_LOG 0 #define PUBLISHER_NUMBER 200 -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "multiple_snd"); + eCAL::Initialize("multiple_snd"); // create publisher struct SPubCount diff --git a/ecal/samples/cpp/benchmarks/performance_rec/src/performance_rec.cpp b/ecal/samples/cpp/benchmarks/performance_rec/src/performance_rec.cpp index 00ada63324..e734b07109 100644 --- a/ecal/samples/cpp/benchmarks/performance_rec/src/performance_rec.cpp +++ b/ecal/samples/cpp/benchmarks/performance_rec/src/performance_rec.cpp @@ -48,10 +48,10 @@ void PrintStatistic(const std::string& topic_name_, const std::chrono::duration< } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "performance_rec"); + eCAL::Initialize("performance_rec"); // create subscriber for topic "Performance" eCAL::CSubscriber sub("Performance"); diff --git a/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp b/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp index 3889442710..fdd392d0ad 100644 --- a/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp +++ b/ecal/samples/cpp/benchmarks/performance_snd/src/performance_snd.cpp @@ -40,7 +40,7 @@ int main(int argc, char **argv) if(payload_size < 1) payload_size = 1; // initialize eCAL API - eCAL::Initialize(argc, argv, "performance_snd"); + eCAL::Initialize("performance_snd"); // create payload CBinaryPayload binary_payload(payload_size); diff --git a/ecal/samples/cpp/benchmarks/perftool/src/main.cpp b/ecal/samples/cpp/benchmarks/perftool/src/main.cpp index 40085331b9..d17d2d2e4c 100644 --- a/ecal/samples/cpp/benchmarks/perftool/src/main.cpp +++ b/ecal/samples/cpp/benchmarks/perftool/src/main.cpp @@ -196,7 +196,7 @@ int main(int argc, char** argv) const unsigned long long payload_size_bytes = std::stoull(args[4]); // Initialize eCAL - eCAL::Initialize(argc, argv, "ecal-perftool"); + eCAL::Initialize("ecal-perftool"); const Publisher publisher(topic_name, frequency_hz, payload_size_bytes, quiet_arg, verbose_print_times); @@ -223,7 +223,7 @@ int main(int argc, char** argv) // Initialize eCAL - eCAL::Initialize(argc, argv, "ecal-perftool"); + eCAL::Initialize("ecal-perftool"); const Subscriber subscriber(topic_name, callback_delay, busy_wait_arg, hickup_arg, hickup_time, hickup_delay, quiet_arg, verbose_print_times); diff --git a/ecal/samples/cpp/benchmarks/pubsub_throughput/src/pubsub_throughput.cpp b/ecal/samples/cpp/benchmarks/pubsub_throughput/src/pubsub_throughput.cpp index d8ede8f303..4d5ab63208 100644 --- a/ecal/samples/cpp/benchmarks/pubsub_throughput/src/pubsub_throughput.cpp +++ b/ecal/samples/cpp/benchmarks/pubsub_throughput/src/pubsub_throughput.cpp @@ -108,10 +108,10 @@ void throughput_test(int snd_size, int snd_loops, eCAL::TLayer::eTransportLayer } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "pubsub_throughput"); + eCAL::Initialize("pubsub_throughput"); std::cout << "---------------------------" << '\n'; std::cout << "LAYER: SHM" << '\n'; diff --git a/ecal/samples/cpp/misc/config/src/config_sample.cpp b/ecal/samples/cpp/misc/config/src/config_sample.cpp index ebe041c551..e55a53447f 100644 --- a/ecal/samples/cpp/misc/config/src/config_sample.cpp +++ b/ecal/samples/cpp/misc/config/src/config_sample.cpp @@ -22,10 +22,10 @@ #include -int main(int argc, char **argv) +int main() { // creating config object - eCAL::Configuration my_config(argc, argv); + eCAL::Configuration my_config; // setting a configuration my_config.registration.network_enabled = true; diff --git a/ecal/samples/cpp/misc/process/src/process.cpp b/ecal/samples/cpp/misc/process/src/process.cpp index cfeb4f0681..78a1c88482 100644 --- a/ecal/samples/cpp/misc/process/src/process.cpp +++ b/ecal/samples/cpp/misc/process/src/process.cpp @@ -25,10 +25,10 @@ const char* proc_name = "notepad.exe"; const char* proc_name = "gedit"; #endif // ECAL_OS_WINDOWS -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "process", eCAL::Init::None); + eCAL::Initialize("process", eCAL::Init::None); // start process eCAL::Process::StartProcess(proc_name, "", "", false, proc_smode_normal, false); diff --git a/ecal/samples/cpp/misc/time/src/time.cpp b/ecal/samples/cpp/misc/time/src/time.cpp index e3b1d3cb31..2a85115aef 100644 --- a/ecal/samples/cpp/misc/time/src/time.cpp +++ b/ecal/samples/cpp/misc/time/src/time.cpp @@ -21,10 +21,10 @@ #include #include -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "timer"); + eCAL::Initialize("timer"); std::cout << "eCAL Time Interface : " << eCAL::Time::GetName() << std::endl; std::cout << "eCAL Time is Synchronized : " << eCAL::Time::IsSynchronized() << std::endl; diff --git a/ecal/samples/cpp/misc/timer/src/timer.cpp b/ecal/samples/cpp/misc/timer/src/timer.cpp index e7a385b589..242574a568 100644 --- a/ecal/samples/cpp/misc/timer/src/timer.cpp +++ b/ecal/samples/cpp/misc/timer/src/timer.cpp @@ -25,10 +25,10 @@ const int timout_ms = 10; -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher"); + eCAL::Initialize("person publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/monitoring/monitoring_get_services/src/monitoring_get_services.cpp b/ecal/samples/cpp/monitoring/monitoring_get_services/src/monitoring_get_services.cpp index fb5d4909b4..5f619bc697 100644 --- a/ecal/samples/cpp/monitoring/monitoring_get_services/src/monitoring_get_services.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_get_services/src/monitoring_get_services.cpp @@ -25,13 +25,13 @@ #include #include -int main(int argc, char **argv) +int main() { int run(0), runs(1000); std::chrono::steady_clock::time_point start_time; // initialize eCAL core API - eCAL::Initialize(argc, argv, "monitoring get services"); + eCAL::Initialize("monitoring get services"); // monitor for ever while(eCAL::Ok()) diff --git a/ecal/samples/cpp/monitoring/monitoring_get_topics/src/monitoring_get_topics.cpp b/ecal/samples/cpp/monitoring/monitoring_get_topics/src/monitoring_get_topics.cpp index 3917573751..eecef464e5 100644 --- a/ecal/samples/cpp/monitoring/monitoring_get_topics/src/monitoring_get_topics.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_get_topics/src/monitoring_get_topics.cpp @@ -25,13 +25,13 @@ #include #include -int main(int argc, char **argv) +int main() { int run(0), runs(10); std::chrono::steady_clock::time_point start_time; // initialize eCAL core API - eCAL::Initialize(argc, argv, "monitoring get topics"); + eCAL::Initialize("monitoring get topics"); // monitor for ever while(eCAL::Ok()) diff --git a/ecal/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp b/ecal/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp index 7a6aefcf90..fba9e39a45 100644 --- a/ecal/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_performance/src/monitoring_performance.cpp @@ -34,10 +34,10 @@ #define MEASURE_VARIANT_STRING 1 #define MEASURE_VARIANT_STRUCT 1 -int main(int argc, char **argv) +int main() { // initialize eCAL core API - eCAL::Initialize(argc, argv, "monitoring performance", eCAL::Init::All); + eCAL::Initialize("monitoring performance", eCAL::Init::All); int runs(100); int run(0); diff --git a/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp b/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp index b8bde04b0f..fdb1c7bc62 100644 --- a/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_rec/src/monitoring_rec.cpp @@ -42,10 +42,10 @@ namespace std::string g_services_filt_string = ""; // specify service name to monitor ("" == all services) } -int main(int argc, char** argv) +int main() { // initialize eCAL core API - eCAL::Initialize(argc, argv, "monitoring", eCAL::Init::All); + eCAL::Initialize("monitoring", eCAL::Init::All); // monitoring instance to store snapshot eCAL::pb::Monitoring monitoring; diff --git a/ecal/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp b/ecal/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp index adc8a7f79b..5504aa6004 100644 --- a/ecal/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp +++ b/ecal/samples/cpp/monitoring/monitoring_reg/src/monitoring_reg.cpp @@ -99,10 +99,10 @@ void OnPublisherRegistration(const char* sample_, int sample_size_) } } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "monitoring registrations", eCAL::Init::None); + eCAL::Initialize("monitoring registrations", eCAL::Init::None); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/orchestration/component1/src/component1.cpp b/ecal/samples/cpp/orchestration/component1/src/component1.cpp index 26285ea2b1..6e1f779d26 100644 --- a/ecal/samples/cpp/orchestration/component1/src/component1.cpp +++ b/ecal/samples/cpp/orchestration/component1/src/component1.cpp @@ -69,11 +69,11 @@ class ComponentServiceImpl final : public orchestrator::ComponentService eCAL::protobuf::CPublisher publisher_vec; }; -int main(int argc, char** argv) +int main() { // initialize eCAL API const std::string component("component1"); - eCAL::Initialize(argc, argv, component.c_str()); + eCAL::Initialize(component); // start the component service std::shared_ptr component_service_impl = std::make_shared(); diff --git a/ecal/samples/cpp/orchestration/component2/src/component2.cpp b/ecal/samples/cpp/orchestration/component2/src/component2.cpp index 90990c43ce..dd7d20095f 100644 --- a/ecal/samples/cpp/orchestration/component2/src/component2.cpp +++ b/ecal/samples/cpp/orchestration/component2/src/component2.cpp @@ -90,11 +90,11 @@ class ComponentServiceImpl final : public orchestrator::ComponentService int err_cnt = 0; }; -int main(int argc, char** argv) +int main() { // initialize eCAL API const std::string component("component2"); - eCAL::Initialize(argc, argv, component.c_str()); + eCAL::Initialize(component); // start the component service std::shared_ptr component_service_impl = std::make_shared(); diff --git a/ecal/samples/cpp/orchestration/orchestrator/src/orchestrator.cpp b/ecal/samples/cpp/orchestration/orchestrator/src/orchestrator.cpp index 8240e184d2..b3123f1f23 100644 --- a/ecal/samples/cpp/orchestration/orchestrator/src/orchestrator.cpp +++ b/ecal/samples/cpp/orchestration/orchestrator/src/orchestrator.cpp @@ -24,10 +24,10 @@ #include -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "orchestrator"); + eCAL::Initialize("orchestrator"); eCAL::protobuf::CServiceClient component1("component1"); eCAL::protobuf::CServiceClient component2("component2"); diff --git a/ecal/samples/cpp/pubsub/binary/binary_rec/src/binary_rec.cpp b/ecal/samples/cpp/pubsub/binary/binary_rec/src/binary_rec.cpp index f5653c1776..70ada568cf 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_rec/src/binary_rec.cpp +++ b/ecal/samples/cpp/pubsub/binary/binary_rec/src/binary_rec.cpp @@ -40,10 +40,10 @@ void OnReceive(const char* /*topic_name_*/, const struct eCAL::SReceiveCallbackD std::cout << std::endl; } -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "binary_rec"); + eCAL::Initialize("binary_rec"); // subscriber for topic "blob" eCAL::CSubscriber sub("blob"); diff --git a/ecal/samples/cpp/pubsub/binary/binary_snd/src/binary_snd.cpp b/ecal/samples/cpp/pubsub/binary/binary_snd/src/binary_snd.cpp index da9b49d4af..af9bcb57c9 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_snd/src/binary_snd.cpp +++ b/ecal/samples/cpp/pubsub/binary/binary_snd/src/binary_snd.cpp @@ -22,10 +22,10 @@ #include #include -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "binary_snd"); + eCAL::Initialize("binary_snd"); // publisher for topic "blob" eCAL::CPublisher pub("blob"); diff --git a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/src/binary_zero_copy_rec.cpp b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/src/binary_zero_copy_rec.cpp index 33436914b7..8ffe03eb43 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/src/binary_zero_copy_rec.cpp +++ b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_rec/src/binary_zero_copy_rec.cpp @@ -72,13 +72,13 @@ void OnReceive(const char* /*topic_name_*/, const struct eCAL::SReceiveCallbackD std::cout << *static_cast(data_->buf) << std::endl; } -int main(int argc, char** argv) +int main() { const char* nodeName = "binary_zero_copy_rec"; const char* topicName = "simple_struct"; // initialize eCAL API - eCAL::Initialize(argc, argv, nodeName); + eCAL::Initialize(nodeName); // create the subscriber eCAL::CSubscriber sub(topicName); diff --git a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/src/binary_zero_copy_snd.cpp b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/src/binary_zero_copy_snd.cpp index 065353cd1c..dfac65c5eb 100644 --- a/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/src/binary_zero_copy_snd.cpp +++ b/ecal/samples/cpp/pubsub/binary/binary_zero_copy_snd/src/binary_zero_copy_snd.cpp @@ -114,14 +114,14 @@ class CStructPayload : public eCAL::CPayloadWriter uint32_t clock = 0; }; -int main(int argc, char** argv) +int main() { const char* nodeName = "binary_zero_copy_snd"; const char* topicName = "simple_struct"; const char* structTypeName = "SSimpleStruct"; // initialize eCAL API - eCAL::Initialize(argc, argv, nodeName); + eCAL::Initialize(nodeName); // create publisher config eCAL::Publisher::Configuration pub_config; diff --git a/ecal/samples/cpp/pubsub/binary/ping/src/ping.cpp b/ecal/samples/cpp/pubsub/binary/ping/src/ping.cpp index 90a931d9b7..de58733d6d 100644 --- a/ecal/samples/cpp/pubsub/binary/ping/src/ping.cpp +++ b/ecal/samples/cpp/pubsub/binary/ping/src/ping.cpp @@ -24,10 +24,10 @@ const int pings = 10000; long long diff_array[pings] = { 0 }; -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ping"); + eCAL::Initialize("ping"); eCAL::SDataTypeInformation topic_info{ "long long", "", "" }; eCAL::CPublisher pub_pulse("pulse_send", topic_info); diff --git a/ecal/samples/cpp/pubsub/binary/pong/src/pong.cpp b/ecal/samples/cpp/pubsub/binary/pong/src/pong.cpp index 31503963d3..b87162d810 100644 --- a/ecal/samples/cpp/pubsub/binary/pong/src/pong.cpp +++ b/ecal/samples/cpp/pubsub/binary/pong/src/pong.cpp @@ -21,10 +21,10 @@ #include -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "pong"); + eCAL::Initialize("pong"); eCAL::SDataTypeInformation topic_info{ "long long", "", "" }; eCAL::CSubscriber sub_pulse("pulse_send", topic_info); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_events_rec/src/person_events_rec.cpp b/ecal/samples/cpp/pubsub/protobuf/person_events_rec/src/person_events_rec.cpp index 3d705a1778..48dc957adb 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_events_rec/src/person_events_rec.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_events_rec/src/person_events_rec.cpp @@ -56,10 +56,10 @@ void OnEvent(const char* topic_name_, const struct eCAL::SSubEventCallbackData* std::cout << std::endl; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person subscriber events"); + eCAL::Initialize("person subscriber events"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_events_snd/src/person_events_snd.cpp b/ecal/samples/cpp/pubsub/protobuf/person_events_snd/src/person_events_snd.cpp index 80ccb3c2f6..953eb1a4b6 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_events_snd/src/person_events_snd.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_events_snd/src/person_events_snd.cpp @@ -53,10 +53,10 @@ void OnEvent(const char* topic_name_, const struct eCAL::SPubEventCallbackData* std::cout << std::endl; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher events"); + eCAL::Initialize("person publisher events"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_loopback/src/person_loopback.cpp b/ecal/samples/cpp/pubsub/protobuf/person_loopback/src/person_loopback.cpp index ff3351933e..38680aea6e 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_loopback/src/person_loopback.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_loopback/src/person_loopback.cpp @@ -25,10 +25,10 @@ #include "person.pb.h" -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher"); + eCAL::Initialize("person publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_rec/src/person_rec.cpp b/ecal/samples/cpp/pubsub/protobuf/person_rec/src/person_rec.cpp index 63a80c26a6..9abb00d137 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_rec/src/person_rec.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_rec/src/person_rec.cpp @@ -45,10 +45,10 @@ void OnPerson(const char* topic_name_, const pb::People::Person& person_, const std::cout << std::endl; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person subscriber"); + eCAL::Initialize("person subscriber"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_snd/src/person_snd.cpp b/ecal/samples/cpp/pubsub/protobuf/person_snd/src/person_snd.cpp index ae57c0b723..093e171cda 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_snd/src/person_snd.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_snd/src/person_snd.cpp @@ -24,10 +24,10 @@ #include "person.pb.h" -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher"); + eCAL::Initialize("person publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_snd_tcp/src/person_snd_tcp.cpp b/ecal/samples/cpp/pubsub/protobuf/person_snd_tcp/src/person_snd_tcp.cpp index b7feae04aa..7e10d90f8a 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_snd_tcp/src/person_snd_tcp.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_snd_tcp/src/person_snd_tcp.cpp @@ -24,10 +24,10 @@ #include "person.pb.h" -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher tcp"); + eCAL::Initialize("person publisher tcp"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/person_snd_udp/src/person_snd_udp.cpp b/ecal/samples/cpp/pubsub/protobuf/person_snd_udp/src/person_snd_udp.cpp index e5a8d1f786..a1004ca69e 100644 --- a/ecal/samples/cpp/pubsub/protobuf/person_snd_udp/src/person_snd_udp.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/person_snd_udp/src/person_snd_udp.cpp @@ -24,10 +24,10 @@ #include "person.pb.h" -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher multicast"); + eCAL::Initialize("person publisher multicast"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_json_rec/src/proto_dyn_json_rec.cpp b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_json_rec/src/proto_dyn_json_rec.cpp index cf11648849..676f021280 100644 --- a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_json_rec/src/proto_dyn_json_rec.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_json_rec/src/proto_dyn_json_rec.cpp @@ -31,10 +31,10 @@ void ProtoMsgCallback(const eCAL::Registration::STopicId& topic_id_, const std:: std::cout << std::endl; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "proto_dyn"); + eCAL::Initialize("proto_dyn"); // create dynamic subscribers for receiving and decoding messages eCAL::protobuf::CDynamicJSONSubscriber sub(MESSAGE_NAME); diff --git a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_rec/src/proto_dyn_rec.cpp b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_rec/src/proto_dyn_rec.cpp index 33c9c6eb24..e7f3ba4214 100644 --- a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_rec/src/proto_dyn_rec.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_rec/src/proto_dyn_rec.cpp @@ -276,10 +276,10 @@ void ProtoMsgCallback(const eCAL::Registration::STopicId& topic_id_, const std:: std::cout << std::endl; } -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "proto_dyn"); + eCAL::Initialize("proto_dyn"); // create dynamic subscribers for receiving and decoding messages eCAL::protobuf::CDynamicSubscriber sub(MESSAGE_NAME); diff --git a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_snd/src/proto_dyn_snd.cpp b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_snd/src/proto_dyn_snd.cpp index 3604a8d0a8..6b9c243319 100644 --- a/ecal/samples/cpp/pubsub/protobuf/proto_dyn_snd/src/proto_dyn_snd.cpp +++ b/ecal/samples/cpp/pubsub/protobuf/proto_dyn_snd/src/proto_dyn_snd.cpp @@ -24,10 +24,10 @@ #include "person.pb.h" -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "person publisher dynamic"); + eCAL::Initialize("person publisher dynamic"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/ecal/samples/cpp/pubsub/string/minimal_rec/src/minimal_rec.cpp b/ecal/samples/cpp/pubsub/string/minimal_rec/src/minimal_rec.cpp index 95fbdc4a53..288cc3a215 100644 --- a/ecal/samples/cpp/pubsub/string/minimal_rec/src/minimal_rec.cpp +++ b/ecal/samples/cpp/pubsub/string/minimal_rec/src/minimal_rec.cpp @@ -23,14 +23,14 @@ #include #include -int main(int argc, char **argv) +int main() { std::cout << "-------------------------------" << std::endl; std::cout << " HELLO WORLD RECEIVER" << std::endl; std::cout << "-------------------------------" << std::endl; // initialize eCAL API - eCAL::Initialize(argc, argv, "minimal_rec"); + eCAL::Initialize("minimal_rec"); // subscriber for topic "Hello" eCAL::string::CSubscriber sub("Hello"); diff --git a/ecal/samples/cpp/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.cpp b/ecal/samples/cpp/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.cpp index 55403240d5..678281c611 100644 --- a/ecal/samples/cpp/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.cpp +++ b/ecal/samples/cpp/pubsub/string/minimal_rec_cb/src/minimal_rec_cb.cpp @@ -25,14 +25,14 @@ #include #include -int main(int argc, char** argv) +int main() { std::cout << "-------------------------------" << std::endl; std::cout << " HELLO WORLD RECEIVER" << std::endl; std::cout << "-------------------------------" << std::endl; // initialize eCAL API - eCAL::Initialize(argc, argv, "minimal_rec_cb"); + eCAL::Initialize("minimal_rec_cb"); // subscriber for topic "Hello" eCAL::string::CSubscriber sub("Hello"); diff --git a/ecal/samples/cpp/pubsub/string/minimal_snd/src/minimal_snd.cpp b/ecal/samples/cpp/pubsub/string/minimal_snd/src/minimal_snd.cpp index 85889a61c1..335464e05b 100644 --- a/ecal/samples/cpp/pubsub/string/minimal_snd/src/minimal_snd.cpp +++ b/ecal/samples/cpp/pubsub/string/minimal_snd/src/minimal_snd.cpp @@ -23,14 +23,14 @@ #include #include -int main(int argc, char **argv) +int main() { std::cout << "-------------------------------" << std::endl; std::cout << " HELLO WORLD SENDER" << std::endl; std::cout << "-------------------------------" << std::endl; // initialize eCAL API - eCAL::Initialize(argc, argv, "minimal_snd"); + eCAL::Initialize("minimal_snd"); // publisher for topic "Hello" eCAL::string::CPublisher pub("Hello"); diff --git a/ecal/samples/cpp/services/latency_client/src/latency_client.cpp b/ecal/samples/cpp/services/latency_client/src/latency_client.cpp index 2c9a5f07d4..856aa863f6 100644 --- a/ecal/samples/cpp/services/latency_client/src/latency_client.cpp +++ b/ecal/samples/cpp/services/latency_client/src/latency_client.cpp @@ -27,10 +27,10 @@ #include // main entry -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "latency client"); + eCAL::Initialize("latency client"); // create latency client eCAL::CServiceClient latency_client("latency"); diff --git a/ecal/samples/cpp/services/latency_server/src/latency_server.cpp b/ecal/samples/cpp/services/latency_server/src/latency_server.cpp index 12913af568..26c4e4a6ae 100644 --- a/ecal/samples/cpp/services/latency_server/src/latency_server.cpp +++ b/ecal/samples/cpp/services/latency_server/src/latency_server.cpp @@ -28,10 +28,10 @@ int OnHello(const std::string& /*method_*/, const std::string& /*req_type_*/, co } // main entry -int main(int argc, char** argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "latency server"); + eCAL::Initialize("latency server"); // create latency service eCAL::CServiceServer latency_service("latency"); diff --git a/ecal/samples/cpp/services/math_client/src/math_client.cpp b/ecal/samples/cpp/services/math_client/src/math_client.cpp index e54921c4df..7789ce1242 100644 --- a/ecal/samples/cpp/services/math_client/src/math_client.cpp +++ b/ecal/samples/cpp/services/math_client/src/math_client.cpp @@ -84,10 +84,10 @@ void OnMathResponse(const struct eCAL::SServiceResponse& service_response_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "math client"); + eCAL::Initialize("math client"); // create math service client eCAL::protobuf::CServiceClient math_client; diff --git a/ecal/samples/cpp/services/math_server/src/math_server.cpp b/ecal/samples/cpp/services/math_server/src/math_server.cpp index cda95b44d2..758f54f263 100644 --- a/ecal/samples/cpp/services/math_server/src/math_server.cpp +++ b/ecal/samples/cpp/services/math_server/src/math_server.cpp @@ -85,10 +85,10 @@ void OnServerEvent(const eCAL::SServerEventCallbackData* data_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "math server"); + eCAL::Initialize("math server"); // create Math service server std::shared_ptr math_service = std::make_shared(); diff --git a/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp b/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp index b5c7750078..9cbe6f9919 100644 --- a/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp +++ b/ecal/samples/cpp/services/minimal_client/src/minimal_client.cpp @@ -44,10 +44,10 @@ void OnServiceResponse(const struct eCAL::SServiceResponse& service_response_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "minimal client"); + eCAL::Initialize("minimal client"); // create minimal service client eCAL::CServiceClient minimal_client("service1", { {"echo", eCAL::SServiceMethodInformation()} }); diff --git a/ecal/samples/cpp/services/minimal_server/src/minimal_server.cpp b/ecal/samples/cpp/services/minimal_server/src/minimal_server.cpp index 76ea9c5875..31c2f4ee92 100644 --- a/ecal/samples/cpp/services/minimal_server/src/minimal_server.cpp +++ b/ecal/samples/cpp/services/minimal_server/src/minimal_server.cpp @@ -33,10 +33,10 @@ int OnMethodCallback(const std::string& method_, const std::string& /*req_type_* } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "minimal server"); + eCAL::Initialize("minimal server"); // create minimal service server eCAL::CServiceServer minimal_server("service1"); diff --git a/ecal/samples/cpp/services/ping_client/src/ping_client.cpp b/ecal/samples/cpp/services/ping_client/src/ping_client.cpp index e2022da6cb..5668075c9b 100644 --- a/ecal/samples/cpp/services/ping_client/src/ping_client.cpp +++ b/ecal/samples/cpp/services/ping_client/src/ping_client.cpp @@ -27,10 +27,10 @@ #include "ping.pb.h" // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ping client"); + eCAL::Initialize("ping client"); // create ping service client eCAL::protobuf::CServiceClient ping_client("ping service"); diff --git a/ecal/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp b/ecal/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp index 204c6bc1e1..726eea0788 100644 --- a/ecal/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp +++ b/ecal/samples/cpp/services/ping_client_dyn/src/ping_client_dyn.cpp @@ -29,10 +29,10 @@ #include "proto_json_conv.h" // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ping client dynamic"); + eCAL::Initialize("ping client dynamic"); // create ping service client const std::string service_name("ping service"); diff --git a/ecal/samples/cpp/services/ping_server/src/ping_server.cpp b/ecal/samples/cpp/services/ping_server/src/ping_server.cpp index 1973d57dc2..62b5a24dbb 100644 --- a/ecal/samples/cpp/services/ping_server/src/ping_server.cpp +++ b/ecal/samples/cpp/services/ping_server/src/ping_server.cpp @@ -42,10 +42,10 @@ class PingServiceImpl : public PingService }; // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ping server"); + eCAL::Initialize("ping server"); // create Ping service server std::shared_ptr ping_service = std::make_shared(); diff --git a/ecal/tests/c/core_test/src/core_test.cpp b/ecal/tests/c/core_test/src/core_test.cpp index 5f04527770..208389d38f 100644 --- a/ecal/tests/c/core_test/src/core_test.cpp +++ b/ecal/tests/c/core_test/src/core_test.cpp @@ -34,40 +34,36 @@ TEST(core_c_core, GetVersion) EXPECT_STREQ(ECAL_DATE, eCAL_GetVersionDateString()); // get eCAL version as separated integer values - int major = -1; - int minor = -1; - int patch = -1; - eCAL_GetVersion(&major, &minor, &patch); - EXPECT_EQ(ECAL_VERSION_MAJOR, major); - EXPECT_EQ(ECAL_VERSION_MINOR, minor); - EXPECT_EQ(ECAL_VERSION_PATCH, patch); + EXPECT_EQ(ECAL_VERSION_MAJOR, eCAL_GetVersion().major); + EXPECT_EQ(ECAL_VERSION_MINOR, eCAL_GetVersion().minor); + EXPECT_EQ(ECAL_VERSION_PATCH, eCAL_GetVersion().patch); } TEST(core_c_core, InitializeFinalize) { // Is eCAL API initialized ? - EXPECT_EQ(0, eCAL_IsInitialized(0)); + EXPECT_EQ(0, eCAL_IsInitialized()); // initialize eCAL API - EXPECT_EQ(0, eCAL_Initialize(0, nullptr, "initialize_test", 0)); + EXPECT_EQ(0, eCAL_Initialize("initialize_test", 0)); // Is eCAL API initialized ? - EXPECT_EQ(1, eCAL_IsInitialized(0)); + EXPECT_EQ(1, eCAL_IsInitialized()); // initialize eCAL API again we expect return value 1 for yet initialized - EXPECT_EQ(1, eCAL_Initialize(0, nullptr, "initialize_test", 0)); + EXPECT_EQ(1, eCAL_Initialize("initialize_test", 0)); // finalize eCAL API we expect return value 0 even it will not be really finalized because it's 2 times initialzed and 1 time finalized EXPECT_EQ(0, eCAL_Finalize()); // Is eCAL API initialized ? yes it' still initialized - EXPECT_EQ(1, eCAL_IsInitialized(0)); + EXPECT_EQ(1, eCAL_IsInitialized()); // finalize eCAL API we expect return value 0 because now it will be finalized EXPECT_EQ(0, eCAL_Finalize()); // Is eCAL API initialized ? no - EXPECT_EQ(0, eCAL_IsInitialized(0)); + EXPECT_EQ(0, eCAL_IsInitialized()); // finalize eCAL API we expect return value 1 because it was finalized before EXPECT_EQ(1, eCAL_Finalize()); @@ -79,7 +75,7 @@ TEST(core_c_core, MultipleInitializeFinalize) for (auto i = 0; i < 4; ++i) { // initialize eCAL API - EXPECT_EQ(0, eCAL_Initialize(0, nullptr, "multiple_initialize_finalize_test", 0)); + EXPECT_EQ(0, eCAL_Initialize("multiple_initialize_finalize_test", 0)); // finalize eCAL API EXPECT_EQ(0, eCAL_Finalize()); @@ -116,10 +112,10 @@ namespace TEST(core_c_core, SetGetUnitName) { // initialize eCAL API with empty unit name (eCAL will use process name as unit name) - EXPECT_EQ(0, eCAL_Initialize(0, nullptr, "", 0)); + EXPECT_EQ(0, eCAL_Initialize("", 0)); // Is eCAL API initialized ? - EXPECT_EQ(1, eCAL_IsInitialized(0)); + EXPECT_EQ(1, eCAL_IsInitialized()); // if we call eCAL_Initialize with empty unit name, eCAL will use the process name as unit name char process_name[1024] = { 0 }; @@ -157,7 +153,7 @@ TEST(core_c_core, eCAL_Ok) EXPECT_EQ(0, eCAL_Ok()); // initialize eCAL API - EXPECT_EQ(0, eCAL_Initialize(0, nullptr, "okay_test", 0)); + EXPECT_EQ(0, eCAL_Initialize("okay_test", 0)); // check initialized eCAL, should be okay EXPECT_EQ(1, eCAL_Ok()); diff --git a/ecal/tests/cpp/clientserver_proto_test/src/clientserver_test_proto.cpp b/ecal/tests/cpp/clientserver_proto_test/src/clientserver_test_proto.cpp index a98dc3b7aa..8deab5419a 100644 --- a/ecal/tests/cpp/clientserver_proto_test/src/clientserver_test_proto.cpp +++ b/ecal/tests/cpp/clientserver_proto_test/src/clientserver_test_proto.cpp @@ -71,7 +71,7 @@ class MathServiceImpl : public MathService TEST(core_cpp_clientserver_proto, ProtoCallback) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver proto callback test"); + eCAL::Initialize("clientserver proto callback test"); // create MathService server std::shared_ptr math_service_impl = std::make_shared(); @@ -160,7 +160,7 @@ class PingServiceImpl : public PingService TEST(core_cpp_clientserver_proto, ProtoBlocking) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver proto blocking test"); + eCAL::Initialize("clientserver proto blocking test"); // create PingService server std::shared_ptr ping_service_impl = std::make_shared(); diff --git a/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp b/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp index e77066045d..e7c3065a9f 100644 --- a/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp +++ b/ecal/tests/cpp/clientserver_test/src/clientserver_test.cpp @@ -92,7 +92,7 @@ namespace TEST(core_cpp_clientserver, ClientConnectEvent) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base connect event callback"); + eCAL::Initialize("clientserver base connect event callback"); // create client eCAL::CServiceClient client("service"); @@ -161,7 +161,7 @@ TEST(core_cpp_clientserver, ClientConnectEvent) TEST(core_cpp_clientserver, ServerConnectEvent) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base connect event callback"); + eCAL::Initialize("clientserver base connect event callback"); // create server eCAL::CServiceServer server("service"); @@ -234,7 +234,7 @@ TEST(core_cpp_clientserver, BaseCallback) const int sleep(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base callback test"); + eCAL::Initialize("clientserver base callback test"); // create service servers ServiceVecT service_vec; @@ -348,7 +348,7 @@ TEST(core_cpp_clientserver, BaseCallbackTimeout) const int sleep(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base callback test with timeout"); + eCAL::Initialize("clientserver base callback test with timeout"); // create service servers ServiceVecT service_vec; @@ -516,7 +516,7 @@ TEST(core_cpp_clientserver, BaseAsyncCallback) const int sleep(100); // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base async callback test"); + eCAL::Initialize("clientserver base async callback test"); // create service server eCAL::CServiceServer server("service"); @@ -589,7 +589,7 @@ TEST(core_cpp_clientserver, BaseAsync) const int calls(5); // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base async callback test with timeout"); + eCAL::Initialize("clientserver base async callback test with timeout"); // create service server eCAL::CServiceServer server("service"); @@ -699,7 +699,7 @@ TEST(core_cpp_clientserver, BaseBlocking) const int sleep(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "clientserver base blocking test"); + eCAL::Initialize("clientserver base blocking test"); // create service servers ServiceVecT service_vec; @@ -800,7 +800,7 @@ TEST(core_cpp_clientserver, NestedRPCCall) const int sleep(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "nested rpc call test"); + eCAL::Initialize("nested rpc call test"); // create service server eCAL::CServiceServer server("service"); diff --git a/ecal/tests/cpp/config_test/CMakeLists.txt b/ecal/tests/cpp/config_test/CMakeLists.txt index f6fa9b496d..43b7c155af 100644 --- a/ecal/tests/cpp/config_test/CMakeLists.txt +++ b/ecal/tests/cpp/config_test/CMakeLists.txt @@ -29,7 +29,6 @@ if(ECAL_CORE_CONFIGURATION) endif() set(cmd_parser_src - ${ECAL_CORE_PROJECT_ROOT}/core/src/config/ecal_cmd_parser.cpp ${ECAL_CORE_PROJECT_ROOT}/core/src/util/advanced_tclap_output.cpp ${ECAL_PROJECT_ROOT}/lib/ecal_utils/src/filesystem.cpp ${ECAL_PROJECT_ROOT}/lib/ecal_utils/src/str_convert.cpp diff --git a/ecal/tests/cpp/config_test/src/config_test.cpp b/ecal/tests/cpp/config_test/src/config_test.cpp index 0c06a354cc..ac12d4630d 100644 --- a/ecal/tests/cpp/config_test/src/config_test.cpp +++ b/ecal/tests/cpp/config_test/src/config_test.cpp @@ -30,7 +30,6 @@ #include #include -#include "ecal_cmd_parser.h" #ifdef ECAL_CORE_CONFIGURATION #include "configuration_reader.h" #endif @@ -61,7 +60,7 @@ TEST(core_cpp_config /*unused*/, user_config_passing /*unused*/) // Publisher options const bool pub_use_shm = false; - eCAL::Configuration custom_config(0, nullptr); + eCAL::Configuration custom_config; try { custom_config.subscriber.drop_out_of_order_messages = drop_out_of_order_messages; @@ -113,7 +112,7 @@ TEST(core_cpp_config /*unused*/, user_config_passing /*unused*/) TEST(core_cpp_config /*unused*/, user_config_death_test /*unused*/) { - eCAL::Configuration custom_config(0, nullptr); + eCAL::Configuration custom_config; // Test the IpAddressV4 class with wrong values ASSERT_THROW( @@ -170,8 +169,8 @@ TEST(core_cpp_config /*unused*/, config_custom_datatypes_tests /*unused*/) EXPECT_EQ(ip1, ip2); // test copy method for config structure - eCAL::Configuration config1(0, nullptr); - eCAL::Configuration config2(0, nullptr); + eCAL::Configuration config1; + eCAL::Configuration config2; std::string testValue = "234.0.3.2"; config2.transport_layer.udp.network.group = testValue; auto& config2ref = config2; @@ -180,28 +179,6 @@ TEST(core_cpp_config /*unused*/, config_custom_datatypes_tests /*unused*/) EXPECT_EQ(config1.transport_layer.udp.network.group, testValue); } -TEST(core_cpp_config /*unused*/, config_cmd_parser_test /*unused*/) -{ - const std::string some_file_name = "someFileName.yml"; - - eCAL::Config::CmdParser parser{}; - - EXPECT_EQ(parser.getUserIni(), ""); - EXPECT_EQ(parser.getDumpConfig(), false); - - std::vector arguments{}; - - arguments.push_back("test_config_cmd_parser_test"); - // set a file name as ini file - arguments.push_back("--ecal-config-file " + some_file_name); - // set the dump config flag - arguments.push_back("--ecal-dump-config"); - - parser.parseArguments(arguments); - - EXPECT_EQ(parser.getUserIni(), some_file_name); - EXPECT_EQ(parser.getDumpConfig(), true); -} #ifdef ECAL_CORE_CONFIGURATION TEST(core_cpp_config /*unused*/, read_write_file_test /*unused*/) diff --git a/ecal/tests/cpp/core_test/src/core_test.cpp b/ecal/tests/cpp/core_test/src/core_test.cpp index e4f44c2338..4954b40024 100644 --- a/ecal/tests/cpp/core_test/src/core_test.cpp +++ b/ecal/tests/cpp/core_test/src/core_test.cpp @@ -28,19 +28,15 @@ TEST(core_cpp_core, GetVersion) { // get eCAL version string - EXPECT_STREQ(ECAL_VERSION, eCAL::GetVersionString()); + EXPECT_STREQ(ECAL_VERSION, eCAL::GetVersionString().c_str()); // get eCAL version date - EXPECT_STREQ(ECAL_DATE, eCAL::GetVersionDateString()); + EXPECT_STREQ(ECAL_DATE, eCAL::GetVersionDateString().c_str()); // get eCAL version as separated integer values - int major = -1; - int minor = -1; - int patch = -1; - eCAL::GetVersion(&major, &minor, &patch); - EXPECT_EQ(ECAL_VERSION_MAJOR, major); - EXPECT_EQ(ECAL_VERSION_MINOR, minor); - EXPECT_EQ(ECAL_VERSION_PATCH, patch); + EXPECT_EQ(ECAL_VERSION_MAJOR, eCAL::GetVersion().major); + EXPECT_EQ(ECAL_VERSION_MINOR, eCAL::GetVersion().minor); + EXPECT_EQ(ECAL_VERSION_PATCH, eCAL::GetVersion().patch); } TEST(core_cpp_core, InitializeFinalize) @@ -49,13 +45,13 @@ TEST(core_cpp_core, InitializeFinalize) EXPECT_EQ(0, eCAL::IsInitialized()); // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "initialize_test")); + EXPECT_EQ(0, eCAL::Initialize("initialize_test")); // Is eCAL API initialized ? EXPECT_EQ(1, eCAL::IsInitialized()); // initialize eCAL API again we expect return value 1 for yet initialized - EXPECT_EQ(1, eCAL::Initialize(0, nullptr, "initialize_test")); + EXPECT_EQ(1, eCAL::Initialize("initialize_test")); // finalize eCAL API we expect return value 0 even it will not be really finalized because it's 2 times initialzed and 1 time finalized EXPECT_EQ(0, eCAL::Finalize()); @@ -79,7 +75,7 @@ TEST(core_cpp_core, MultipleInitializeFinalize) for (auto i = 0; i < 4; ++i) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "multiple_initialize_finalize_test")); + EXPECT_EQ(0, eCAL::Initialize("multiple_initialize_finalize_test")); // finalize eCAL API EXPECT_EQ(0, eCAL::Finalize()); @@ -116,7 +112,7 @@ namespace TEST(core_cpp_core, SetGetUnitName) { // initialize eCAL API with empty unit name (eCAL will use process name as unit name) - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "")); + EXPECT_EQ(0, eCAL::Initialize("")); // Is eCAL API initialized ? EXPECT_EQ(1, eCAL::IsInitialized()); @@ -129,10 +125,6 @@ TEST(core_cpp_core, SetGetUnitName) EXPECT_EQ(0, eCAL::SetUnitName("unit name")); EXPECT_STREQ("unit name", eCAL::Process::GetUnitName().c_str()); - // set nullptr unit name (should not change the unit name) - EXPECT_EQ(-1, eCAL::SetUnitName(nullptr)); - EXPECT_STREQ("unit name", eCAL::Process::GetUnitName().c_str()); - // set empty unit name (should not change the unit name) EXPECT_EQ(-1, eCAL::SetUnitName("")); EXPECT_STREQ("unit name", eCAL::Process::GetUnitName().c_str()); @@ -147,7 +139,7 @@ TEST(core_cpp_core, eCAL_Ok) EXPECT_EQ(0, eCAL::Ok()); // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "okay_test")); + EXPECT_EQ(0, eCAL::Initialize("okay_test")); // check initialized eCAL, should be okay EXPECT_EQ(1, eCAL::Ok()); @@ -176,7 +168,7 @@ namespace TEST(Core, TimerCallback) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "timer callback")); + EXPECT_EQ(0, eCAL::Initialize("timer callback")); // Is eCAL API initialized ? EXPECT_EQ(1, eCAL::IsInitialized()); diff --git a/ecal/tests/cpp/logging_test/src/logging_test.cpp b/ecal/tests/cpp/logging_test/src/logging_test.cpp index 709bde65b1..86a8e96913 100644 --- a/ecal/tests/cpp/logging_test/src/logging_test.cpp +++ b/ecal/tests/cpp/logging_test/src/logging_test.cpp @@ -89,7 +89,7 @@ TEST(logging_to /*unused*/, file /*unused*/) const std::string log_message = "Logging to file test."; auto ecal_config = GetFileConfiguration(logging_path); - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::Log(log_level_info, log_message); @@ -129,7 +129,7 @@ TEST(logging_to /*unused*/, udp /*unused*/) const std::string log_message = "Logging to udp test."; auto ecal_config = GetUDPConfiguration(); - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::Log(log_level_info, log_message); @@ -160,7 +160,7 @@ TEST(logging_to /*unused*/, console /*unused*/) const std::string log_message = "Logging to console test."; auto ecal_config = GetConsoleConfiguration(); - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); { // Redirect the output stream to a stringstream in order to find log messages @@ -187,7 +187,7 @@ TEST(logging_levels /*unused*/, all /*unused*/) const std::string log_message = "Logging level all test for udp."; auto ecal_config = GetUDPConfiguration(); - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::SLogging log; @@ -226,7 +226,7 @@ TEST(logging_levels /*unused*/, various /*unused*/) ecal_config.logging.sinks.udp.filter_log_udp = log_level_warning; - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::SLogging log; @@ -263,7 +263,7 @@ TEST(logging_levels /*unused*/, none /*unused*/) ecal_config.logging.sinks.udp.filter_log_udp = log_level_none; - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::SLogging log; @@ -302,7 +302,7 @@ TEST(logging_disable /*unused*/, file /*unused*/) auto ecal_config = GetFileConfiguration(logging_path); ecal_config.logging.sinks.file.enable = false; - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::Log(log_level_info, log_message); @@ -330,7 +330,7 @@ TEST(logging_disable /*unused*/, udp /*unused*/) auto ecal_config = GetUDPConfiguration(); ecal_config.logging.sinks.udp.enable = false; - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); eCAL::Logging::Log(log_level_info, log_message); @@ -351,7 +351,7 @@ TEST(logging_disable /*unused*/, console /*unused*/) auto ecal_config = GetConsoleConfiguration(); ecal_config.logging.sinks.console.enable = false; - eCAL::Initialize(ecal_config, unit_name.c_str(), eCAL::Init::Logging); + eCAL::Initialize(ecal_config, unit_name, eCAL::Init::Logging); { // Redirect the output stream to a stringstream in order to find log messages diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_acknowledge.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_acknowledge.cpp index 75c3b0df26..b32d6a1dbd 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_acknowledge.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_acknowledge.cpp @@ -52,7 +52,7 @@ namespace TEST(core_cpp_pubsub, TimeoutAcknowledgment) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "TimeoutAcknowledgment", eCAL::Init::All)); + EXPECT_EQ(0, eCAL::Initialize("TimeoutAcknowledgment", eCAL::Init::All)); // create publisher config eCAL::Publisher::Configuration pub_config; diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp index 0521d7770c..357639ab06 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_connection_test.cpp @@ -31,7 +31,7 @@ TEST(core_cpp_pubsub, TestSubscriberIsPublishedTiming) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "subscriber_is_published")); + EXPECT_EQ(0, eCAL::Initialize("subscriber_is_published")); std::atomic do_start_publication(false); std::atomic publication_finished(false); @@ -131,7 +131,7 @@ TEST(core_cpp_pubsub, TestSubscriberIsPublishedTiming) TEST(core_cpp_pubsub, TestPublisherIsSubscribedTiming) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "publisher_is_subscribed")); + EXPECT_EQ(0, eCAL::Initialize("publisher_is_subscribed")); std::atomic do_start_publication(false); std::atomic publication_finished(false); @@ -226,7 +226,7 @@ TEST(core_cpp_pubsub, TestPublisherIsSubscribedTiming) TEST(core_cpp_pubsub, TestChainedPublisherSubscriberCallback) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "chained_publisher_subscriber")); + EXPECT_EQ(0, eCAL::Initialize("chained_publisher_subscriber")); // Set up counters for sent and received messages const int message_count = 10; diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_multibuffer.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_multibuffer.cpp index d9f4b2f619..826de1c97e 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_multibuffer.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_multibuffer.cpp @@ -127,7 +127,7 @@ std::vector multibuffer_pub_sub_test(int buffer_count, bool zero_copy, int TEST(core_cpp_pubsub, MultibufferPubSub) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // number of iterations const int publications(11); diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_receive_test.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_receive_test.cpp index c889d74bce..b7052a5b37 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_receive_test.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_receive_test.cpp @@ -69,7 +69,7 @@ void measure_execution_within_range(const std::string& description, std::functio TEST(core_cpp_pubsub, TimingSubscriberReceive) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "subscriber_receive_timing")); + EXPECT_EQ(0, eCAL::Initialize("subscriber_receive_timing")); // create simple string publisher eCAL::string::CPublisher pub("CLOCK"); @@ -163,7 +163,7 @@ TEST(core_cpp_pubsub, TimingSubscriberReceive) TEST(core_cpp_pubsub, SporadicEmptyReceives) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "sporadic_empty_receives")); + EXPECT_EQ(0, eCAL::Initialize("sporadic_empty_receives")); // create simple string publisher eCAL::string::CPublisher pub("CLOCK"); diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp index 28b7c75503..44f7b9474d 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_test.cpp @@ -64,7 +64,7 @@ namespace TEST(core_cpp_pubsub, LeakedPubSub) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "leaked pub/sub")); + EXPECT_EQ(0, eCAL::Initialize("leaked pub/sub")); // create subscriber and register a callback eCAL::CSubscriber sub("foo"); @@ -109,7 +109,7 @@ TEST(core_cpp_pubsub, LeakedPubSub) TEST(core_cpp_pubsub, CallbackDestruction) { // initialize eCAL API - EXPECT_EQ(0, eCAL::Initialize(0, nullptr, "callback destruction")); + EXPECT_EQ(0, eCAL::Initialize("callback destruction")); // create subscriber and register a callback std::shared_ptr sub; @@ -164,7 +164,7 @@ TEST(core_cpp_pubsub, CallbackDestruction) TEST(core_cpp_pubsub, CreateDestroy) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create publisher for topic "foo" eCAL::CPublisher pub; @@ -207,7 +207,7 @@ TEST(core_cpp_pubsub, SimpleMessage1) std::string recv_s; // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create publisher for topic "foo" eCAL::CPublisher pub("foo"); @@ -249,7 +249,7 @@ TEST(core_cpp_pubsub, SimpleMessage2) std::string recv_s; // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "foo" eCAL::CSubscriber sub("foo"); @@ -284,7 +284,7 @@ TEST(core_cpp_pubsub, SimpleMessageCB) const std::string send_s = CreatePayLoad(PAYLOAD_SIZE_BYTE); // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "foo" eCAL::CSubscriber sub("foo"); @@ -360,7 +360,7 @@ TEST(core_cpp_pubsub, DynamicSizeCB) std::string send_s = CreatePayLoad(PAYLOAD_SIZE_BYTE); // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "foo" eCAL::CSubscriber sub("foo"); @@ -413,7 +413,7 @@ TEST(core_cpp_pubsub, DynamicCreate) const std::string send_s = CreatePayLoad(PAYLOAD_SIZE_BYTE); // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "foo" eCAL::CSubscriber* sub; @@ -506,7 +506,7 @@ TEST(core_cpp_pubsub, DestroyInCallback) */ // initialize eCAL API - eCAL::Initialize(0, nullptr, "New Publisher in Callback"); + eCAL::Initialize("New Publisher in Callback"); // start publishing thread eCAL::string::CPublisher pub_foo("foo"); @@ -569,7 +569,7 @@ TEST(core_cpp_pubsub, SubscriberReconnection) */ // initialize eCAL API - eCAL::Initialize(0, nullptr, "SubscriberReconnection"); + eCAL::Initialize("SubscriberReconnection"); // start publishing thread std::atomic stop_publishing(false); diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_test_shm.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_test_shm.cpp index a23bd880bc..6e573ad8f2 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_test_shm.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_test_shm.cpp @@ -52,7 +52,7 @@ TEST(core_cpp_pubsub, ZeroPayloadMessageSHM) const std::string send_s; // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "A" eCAL::CSubscriber sub("A"); @@ -118,7 +118,7 @@ TEST(core_cpp_pubsub, MultipleSendsSHM) long long last_received_timestamp(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "A" eCAL::string::CSubscriber sub("A"); diff --git a/ecal/tests/cpp/pubsub_test/src/pubsub_test_udp.cpp b/ecal/tests/cpp/pubsub_test/src/pubsub_test_udp.cpp index 630477aa37..ea4b4d7d2e 100644 --- a/ecal/tests/cpp/pubsub_test/src/pubsub_test_udp.cpp +++ b/ecal/tests/cpp/pubsub_test/src/pubsub_test_udp.cpp @@ -52,7 +52,7 @@ TEST(core_cpp_pubsub, ZeroPayloadMessageUDP) const std::string send_s; // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "A" eCAL::CSubscriber sub("A"); @@ -104,7 +104,7 @@ TEST(core_cpp_pubsub, MultipleSendsUDP) long long last_received_timestamp(0); // initialize eCAL API - eCAL::Initialize(0, nullptr, "pubsub_test"); + eCAL::Initialize("pubsub_test"); // create subscriber for topic "A" eCAL::string::CSubscriber sub("A"); diff --git a/ecal/tests/cpp/registration_test_public/src/registration_gettopics.cpp b/ecal/tests/cpp/registration_test_public/src/registration_gettopics.cpp index e1f46b53b7..bb4d4869e7 100644 --- a/ecal/tests/cpp/registration_test_public/src/registration_gettopics.cpp +++ b/ecal/tests/cpp/registration_test_public/src/registration_gettopics.cpp @@ -37,7 +37,7 @@ enum { TEST(core_cpp_registration_public, GetTopics) { // initialize eCAL API - eCAL::Initialize(0, nullptr, "core_cpp_registration_public"); + eCAL::Initialize("core_cpp_registration_public"); std::set topic_id_pub_set; std::set topic_id_sub_set; @@ -145,7 +145,7 @@ TEST(core_cpp_registration_public, GetTopicsParallel) std::atomic testing_completed{ false }; // initialize eCAL API - eCAL::Initialize(0, nullptr, "core_cpp_registration_public"); + eCAL::Initialize("core_cpp_registration_public"); auto create_publishers = [&]() { std::string topic_name = "Test.ParallelUtilFunctions"; diff --git a/lang/csharp/Continental.eCAL.Core/ecal_clr.cpp b/lang/csharp/Continental.eCAL.Core/ecal_clr.cpp index fd2af76b9e..cc8f5aeb7c 100644 --- a/lang/csharp/Continental.eCAL.Core/ecal_clr.cpp +++ b/lang/csharp/Continental.eCAL.Core/ecal_clr.cpp @@ -68,7 +68,7 @@ array^ StlStringToByteArray(const std::string& string_) ///////////////////////////////////////////////////////////////////////////// void Util::Initialize(System::String^ task_name_) { - ::eCAL::Initialize(0, nullptr, StringToStlString(task_name_).c_str()); + ::eCAL::Initialize(StringToStlString(task_name_)); } void Util::Terminate() @@ -513,7 +513,7 @@ List^ ServiceClient::Call(System::Str ///////////////////////////////////////////////////////////////////////////// void Monitoring::Initialize() { - ::eCAL::Initialize(0, nullptr, "", ::eCAL::Init::Monitoring); + ::eCAL::Initialize("", ::eCAL::Init::Monitoring); } void Monitoring::Terminate() diff --git a/lang/python/core/ecal/core/core.py b/lang/python/core/ecal/core/core.py index a2c0d79201..990e7f37c9 100644 --- a/lang/python/core/ecal/core/core.py +++ b/lang/python/core/ecal/core/core.py @@ -33,7 +33,17 @@ def initialize(args, unit_name): :type unit_name: string """ - return _ecal.initialize(args, unit_name) + print("[WARNING] 'initialize(args, unit_name)' is deprecated. Please use 'initialize(argv, unit_name)' instead.") + return initialize(unit_name) + +def initialize(unit_name): + """ initialize eCAL API + + :param unit_name: instance unit name + :type unit_name: string + + """ + return _ecal.initialize(unit_name) def finalize(): diff --git a/lang/python/core/src/ecal_clang.cpp b/lang/python/core/src/ecal_clang.cpp index 9d13a69afe..200a0f3969 100644 --- a/lang/python/core/src/ecal_clang.cpp +++ b/lang/python/core/src/ecal_clang.cpp @@ -78,7 +78,12 @@ const char* ecal_getversion() /****************************************/ int ecal_getversion_components(int* major_, int* minor_, int* patch_) { - return eCAL::GetVersion(major_, minor_, patch_); + if ((major_ == nullptr) || (minor_ == nullptr) || (patch_ == nullptr) ) + return 0; + *major_ = eCAL::GetVersion().major; + *minor_ = eCAL::GetVersion().minor; + *minor_ = eCAL::GetVersion().patch; + return 1; } /****************************************/ @@ -92,9 +97,10 @@ const char* ecal_getdate() /****************************************/ /* ecal_initialize */ /****************************************/ -int ecal_initialize(int argc_, char **argv_, const char* unit_name_) +int ecal_initialize(const char* unit_name_) { - return(eCAL::Initialize(argc_, argv_, unit_name_)); + std::string unit_name = (unit_name_ != nullptr) ? std::string(unit_name_) : std::string(""); + return(eCAL::Initialize(unit_name)); } /****************************************/ @@ -722,7 +728,7 @@ bool client_call_method_async(ECAL_HANDLE handle_, const char* method_name_, con /****************************************/ int mon_initialize() { - return(eCAL::Initialize(0, nullptr, "", eCAL::Init::Monitoring)); + return(eCAL::Initialize("", eCAL::Init::Monitoring)); } /****************************************/ diff --git a/lang/python/core/src/ecal_clang.h b/lang/python/core/src/ecal_clang.h index f35698d473..a42fd52f05 100644 --- a/lang/python/core/src/ecal_clang.h +++ b/lang/python/core/src/ecal_clang.h @@ -63,7 +63,7 @@ const char* ecal_getdate(); * * @return Zero if succeeded, 1 if already initialized, -1 if failed. **/ -int ecal_initialize(int argc_, char **argv_, const char* unit_name_); +int ecal_initialize(const char* unit_name_); /** * @brief Finalize eCAL API. diff --git a/lang/python/core/src/ecal_wrap.cxx b/lang/python/core/src/ecal_wrap.cxx index 7ac9fae0c5..5f512f5be3 100644 --- a/lang/python/core/src/ecal_wrap.cxx +++ b/lang/python/core/src/ecal_wrap.cxx @@ -78,41 +78,17 @@ PyObject* PyAnswerHandle(ECAL_HANDLE handle_) /****************************************/ PyObject* initialize(PyObject* /*self*/, PyObject* args) { - PyObject* unit_args; /* python list of command line arguments */ - char* unit_name = nullptr; /* unit name */ - if (!PyArg_ParseTuple(args, "O!s", &PyList_Type, &unit_args, &unit_name)) + char* unit_name = nullptr; + if (!PyArg_ParseTuple(args, "s", &unit_name)) return nullptr; - std::vector arg_vec_p; - int arg_num = (int)(PyList_Size(unit_args)); - for (int i = 0; i < arg_num; ++i) - { - /* grab the string object from the next element of the list */ - PyObject* arg_str = PyList_GetItem(unit_args, i); - - /* make it a string */ - PyObject* arg_ustr = PyUnicode_AsUTF8String(arg_str); - std::string arg = PyBytes_AsString(arg_ustr); - - /* and put it into the argument vector */ -#ifdef _WIN32 - arg_vec_p.push_back(_strdup(arg.c_str())); -#else - arg_vec_p.push_back(strdup(arg.c_str())); -#endif // _WIN32 - } - - /* pass arguments to the initialize function */ + /* pass argument to the initialize function */ int init{ 0 }; Py_BEGIN_ALLOW_THREADS - init = ecal_initialize(int(arg_vec_p.size()), arg_vec_p.data(), unit_name); + init = ecal_initialize(unit_name); Py_END_ALLOW_THREADS - PyObject* ret_obj = Py_BuildValue("i", init); - - /* free argument vector */ - for(auto arg : arg_vec_p) free(arg); - return(ret_obj); + return(Py_BuildValue("i", init)); } /****************************************/ @@ -1330,7 +1306,7 @@ PyObject* mon_logging(PyObject* /*self*/, PyObject* /*args*/) /****************************************/ static PyMethodDef _ecal_methods[] = { - {"initialize", initialize, METH_VARARGS, "initialize(argv, unit_name)"}, + {"initialize", initialize, METH_VARARGS, "initialize(unit_name)"}, {"finalize", finalize, METH_NOARGS, "finalize()"}, {"is_initialized", is_initialized, METH_NOARGS, "is_initialized()"}, {"set_unit_name", set_unit_name, METH_VARARGS, "set_unit_name(unit_name)"}, diff --git a/lang/python/samples/core/benchmark/latency_rec.py b/lang/python/samples/core/benchmark/latency_rec.py index 04abff4973..1058b615ff 100644 --- a/lang/python/samples/core/benchmark/latency_rec.py +++ b/lang/python/samples/core/benchmark/latency_rec.py @@ -24,7 +24,7 @@ def do_run(): # initialize eCAL API - ecal_core.initialize(sys.argv, "py_latency_rec") + ecal_core.initialize("py_latency_rec") # create publisher/subscriber pub = ecal_core.publisher('pkg_reply') diff --git a/lang/python/samples/core/benchmark/latency_rec_cb.py b/lang/python/samples/core/benchmark/latency_rec_cb.py index c7916c1135..3e074fb654 100644 --- a/lang/python/samples/core/benchmark/latency_rec_cb.py +++ b/lang/python/samples/core/benchmark/latency_rec_cb.py @@ -25,7 +25,7 @@ def do_run(): # initialize eCAL API - ecal_core.initialize(sys.argv, "py_latency_rec_cb") + ecal_core.initialize("py_latency_rec_cb") # create publisher/subscriber pub = ecal_core.publisher('pkg_reply') diff --git a/lang/python/samples/core/benchmark/latency_snd.py b/lang/python/samples/core/benchmark/latency_snd.py index c024f0810c..66abd32981 100644 --- a/lang/python/samples/core/benchmark/latency_snd.py +++ b/lang/python/samples/core/benchmark/latency_snd.py @@ -80,7 +80,7 @@ def do_run(msg_num, msg_size): if __name__ == "__main__": # initialize eCAL API - ecal_core.initialize([], "py_latency_snd") + ecal_core.initialize("py_latency_snd") args = parse_args(sys.argv[1:]) do_run(msg_num=args.runs, msg_size=args.size) diff --git a/lang/python/samples/core/monitoring/monitoring.py b/lang/python/samples/core/monitoring/monitoring.py index 93021b5b1c..a4b3259e9a 100644 --- a/lang/python/samples/core/monitoring/monitoring.py +++ b/lang/python/samples/core/monitoring/monitoring.py @@ -27,7 +27,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "monitoring") + ecal_core.initialize("monitoring") # initialize eCAL monitoring API ecal_core.mon_initialize() diff --git a/lang/python/samples/core/monitoring/monitoring_json.py b/lang/python/samples/core/monitoring/monitoring_json.py index 6143e9c167..9e55221da0 100644 --- a/lang/python/samples/core/monitoring/monitoring_json.py +++ b/lang/python/samples/core/monitoring/monitoring_json.py @@ -77,7 +77,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "monitoring") + ecal_core.initialize("monitoring") # initialize eCAL monitoring API ecal_core.mon_initialize() diff --git a/lang/python/samples/core/pubsub/binary_rec.py b/lang/python/samples/core/pubsub/binary_rec.py index 8e2041b0b9..3f4830781e 100644 --- a/lang/python/samples/core/pubsub/binary_rec.py +++ b/lang/python/samples/core/pubsub/binary_rec.py @@ -26,7 +26,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_binary_rec") + ecal_core.initialize("py_binary_rec") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/binary_rec_cb.py b/lang/python/samples/core/pubsub/binary_rec_cb.py index 546c8cc1c2..53b6c9869c 100644 --- a/lang/python/samples/core/pubsub/binary_rec_cb.py +++ b/lang/python/samples/core/pubsub/binary_rec_cb.py @@ -31,7 +31,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_binary_rec_cb") + ecal_core.initialize("py_binary_rec_cb") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/binary_snd.py b/lang/python/samples/core/pubsub/binary_snd.py index 914765d488..a26ec735d1 100644 --- a/lang/python/samples/core/pubsub/binary_snd.py +++ b/lang/python/samples/core/pubsub/binary_snd.py @@ -28,7 +28,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_binary_snd") + ecal_core.initialize("py_binary_snd") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/protobuf_rec.py b/lang/python/samples/core/pubsub/protobuf_rec.py index 146b05760e..c5d10f0902 100644 --- a/lang/python/samples/core/pubsub/protobuf_rec.py +++ b/lang/python/samples/core/pubsub/protobuf_rec.py @@ -31,7 +31,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(),ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_person_rec") + ecal_core.initialize("py_person_rec") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/protobuf_rec_cb.py b/lang/python/samples/core/pubsub/protobuf_rec_cb.py index ca88c90f76..37f70dda4a 100644 --- a/lang/python/samples/core/pubsub/protobuf_rec_cb.py +++ b/lang/python/samples/core/pubsub/protobuf_rec_cb.py @@ -41,7 +41,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(),ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_person_rec_cb") + ecal_core.initialize("py_person_rec_cb") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/protobuf_snd.py b/lang/python/samples/core/pubsub/protobuf_snd.py index e8acbb726a..e7cf2a6133 100644 --- a/lang/python/samples/core/pubsub/protobuf_snd.py +++ b/lang/python/samples/core/pubsub/protobuf_snd.py @@ -31,7 +31,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_person_snd") + ecal_core.initialize("py_person_snd") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/string_rec.py b/lang/python/samples/core/pubsub/string_rec.py index 575113d3e1..844d1efc80 100644 --- a/lang/python/samples/core/pubsub/string_rec.py +++ b/lang/python/samples/core/pubsub/string_rec.py @@ -26,7 +26,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_minimal_rec") + ecal_core.initialize("py_minimal_rec") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/string_rec_cb.py b/lang/python/samples/core/pubsub/string_rec_cb.py index aca7e226d5..f78e0c29d2 100644 --- a/lang/python/samples/core/pubsub/string_rec_cb.py +++ b/lang/python/samples/core/pubsub/string_rec_cb.py @@ -31,7 +31,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_minimal_rec_cb") + ecal_core.initialize("py_minimal_rec_cb") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/pubsub/string_snd.py b/lang/python/samples/core/pubsub/string_snd.py index b785c6d3c7..73725e2e9b 100644 --- a/lang/python/samples/core/pubsub/string_snd.py +++ b/lang/python/samples/core/pubsub/string_snd.py @@ -27,7 +27,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_minimal_snd") + ecal_core.initialize("py_minimal_snd") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/service/minimal_service_client.py b/lang/python/samples/core/service/minimal_service_client.py index f4c06ea332..1f62d7fa99 100644 --- a/lang/python/samples/core/service/minimal_service_client.py +++ b/lang/python/samples/core/service/minimal_service_client.py @@ -27,7 +27,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_minimal_service_client") + ecal_core.initialize("py_minimal_service_client") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/lang/python/samples/core/service/minimal_service_server.py b/lang/python/samples/core/service/minimal_service_server.py index 93c93260dd..5b8a95f5b0 100644 --- a/lang/python/samples/core/service/minimal_service_server.py +++ b/lang/python/samples/core/service/minimal_service_server.py @@ -27,7 +27,7 @@ def main(): print("eCAL {} ({})\n".format(ecal_core.getversion(), ecal_core.getdate())) # initialize eCAL API - ecal_core.initialize(sys.argv, "py_minimal_service_server") + ecal_core.initialize("py_minimal_service_server") # set process state ecal_core.set_process_state(1, 1, "I feel good") diff --git a/samples/cpp/pubsub/capnp/addressbook_rec/src/addressbook_rec.cpp b/samples/cpp/pubsub/capnp/addressbook_rec/src/addressbook_rec.cpp index d35e448099..ccca11db18 100644 --- a/samples/cpp/pubsub/capnp/addressbook_rec/src/addressbook_rec.cpp +++ b/samples/cpp/pubsub/capnp/addressbook_rec/src/addressbook_rec.cpp @@ -77,7 +77,7 @@ void printAddressBook(const AddressBook::Reader& addressBook) int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "addressbook subscriber"); + eCAL::Initialize("addressbook subscriber"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/capnp/addressbook_rec_cb/src/addressbook_rec_cb.cpp b/samples/cpp/pubsub/capnp/addressbook_rec_cb/src/addressbook_rec_cb.cpp index cd28202f77..d62461b019 100644 --- a/samples/cpp/pubsub/capnp/addressbook_rec_cb/src/addressbook_rec_cb.cpp +++ b/samples/cpp/pubsub/capnp/addressbook_rec_cb/src/addressbook_rec_cb.cpp @@ -85,7 +85,7 @@ void OnAddressbook(const char* topic_name_, AddressBook::Reader msg_, const long int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "addressbook subscriber"); + eCAL::Initialize("addressbook subscriber"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/capnp/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp b/samples/cpp/pubsub/capnp/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp index a5d357d85d..8546f2a130 100644 --- a/samples/cpp/pubsub/capnp/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp +++ b/samples/cpp/pubsub/capnp/addressbook_rec_dynamic/src/addressbook_rec_dynamic.cpp @@ -108,7 +108,7 @@ void dynamicPrintValue(const capnp::DynamicValue::Reader& value) int main(int argc, char** argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "addressbook subscriber"); + eCAL::Initialize("addressbook subscriber"); eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/capnp/addressbook_snd/src/addressbook_snd.cpp b/samples/cpp/pubsub/capnp/addressbook_snd/src/addressbook_snd.cpp index 48cdb68a04..830d253988 100644 --- a/samples/cpp/pubsub/capnp/addressbook_snd/src/addressbook_snd.cpp +++ b/samples/cpp/pubsub/capnp/addressbook_snd/src/addressbook_snd.cpp @@ -44,7 +44,7 @@ void printAddressBook(AddressBook::Builder addressBook) int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "addressbook publisher"); + eCAL::Initialize("addressbook publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/flatbuffer/monster_rec/monster_rec.cpp b/samples/cpp/pubsub/flatbuffer/monster_rec/monster_rec.cpp index 004a7f1a1e..9c5f972aa5 100644 --- a/samples/cpp/pubsub/flatbuffer/monster_rec/monster_rec.cpp +++ b/samples/cpp/pubsub/flatbuffer/monster_rec/monster_rec.cpp @@ -76,7 +76,7 @@ void OnMonster(const char* topic_name_, const flatbuffers::FlatBufferBuilder& ms int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "monster subscriber"); + eCAL::Initialize("monster subscriber"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/flatbuffer/monster_snd/monster_snd.cpp b/samples/cpp/pubsub/flatbuffer/monster_snd/monster_snd.cpp index 356075882a..04bb9a16e9 100644 --- a/samples/cpp/pubsub/flatbuffer/monster_snd/monster_snd.cpp +++ b/samples/cpp/pubsub/flatbuffer/monster_snd/monster_snd.cpp @@ -34,7 +34,7 @@ int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "monster publisher"); + eCAL::Initialize("monster publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/msgpack/address_rec/src/address_rec.cpp b/samples/cpp/pubsub/msgpack/address_rec/src/address_rec.cpp index 0cff8b28c2..d9a95237b6 100644 --- a/samples/cpp/pubsub/msgpack/address_rec/src/address_rec.cpp +++ b/samples/cpp/pubsub/msgpack/address_rec/src/address_rec.cpp @@ -57,7 +57,7 @@ void OnAddress(const char* topic_name_, const CAddress& msg_, const long long ti int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "address subscriber"); + eCAL::Initialize("address subscriber"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/pubsub/msgpack/address_snd/src/address_snd.cpp b/samples/cpp/pubsub/msgpack/address_snd/src/address_snd.cpp index 810adb247a..de55f1214e 100644 --- a/samples/cpp/pubsub/msgpack/address_snd/src/address_snd.cpp +++ b/samples/cpp/pubsub/msgpack/address_snd/src/address_snd.cpp @@ -44,7 +44,7 @@ class CAddress int main(int argc, char **argv) { // initialize eCAL API - eCAL::Initialize(argc, argv, "address publisher"); + eCAL::Initialize("address publisher"); // set process state eCAL::Process::SetState(proc_sev_healthy, proc_sev_level1, "I feel good !"); diff --git a/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp b/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp index 033dd2f4c5..7d5913149a 100644 --- a/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp +++ b/samples/cpp/services/ecalplayer_client/src/ecalplayer_client.cpp @@ -83,10 +83,10 @@ void OnPlayerResponse(const struct eCAL::SServiceResponse& service_response_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ecalplayer client"); + eCAL::Initialize("ecalplayer client"); // create player service client eCAL::protobuf::CServiceClient player_service; diff --git a/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp b/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp index da45267f6b..8e00a3a0cb 100644 --- a/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp +++ b/samples/cpp/services/ecalplayer_gui_client/src/ecalplayer_gui_client.cpp @@ -28,7 +28,7 @@ EcalplayGuiClient::EcalplayGuiClient(QWidget *parent) ui_.setupUi(this); // initialize eCAL API - eCAL::Initialize(0, nullptr, "ecalplayer gui client"); + eCAL::Initialize("ecalplayer gui client"); // create player service client player_service_.AddResponseCallback([this](const struct eCAL::SServiceResponse& service_response) {this->onPlayerResponse(service_response); }); diff --git a/samples/cpp/services/ecalplayer_gui_client/src/main.cpp b/samples/cpp/services/ecalplayer_gui_client/src/main.cpp index 8e9411d76c..8613decbce 100644 --- a/samples/cpp/services/ecalplayer_gui_client/src/main.cpp +++ b/samples/cpp/services/ecalplayer_gui_client/src/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "EcalPlayGuiClient", eCAL::Init::Default); + eCAL::Initialize("EcalPlayGuiClient", eCAL::Init::Default); QApplication a(argc, argv); diff --git a/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp b/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp index 986f5bb5fc..55dac2f1f4 100644 --- a/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp +++ b/samples/cpp/services/ecalsys_client/src/ecalsys_client.cpp @@ -60,10 +60,10 @@ void OnSysResponse(const struct eCAL::SServiceResponse& service_response_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "ecalsys client"); + eCAL::Initialize("ecalsys client"); // create player service client eCAL::protobuf::CServiceClient sys_service; diff --git a/samples/cpp/services/player_stepper/src/ecal_stepper.cpp b/samples/cpp/services/player_stepper/src/ecal_stepper.cpp index d73cc789a5..7e2f4ba132 100644 --- a/samples/cpp/services/player_stepper/src/ecal_stepper.cpp +++ b/samples/cpp/services/player_stepper/src/ecal_stepper.cpp @@ -99,7 +99,7 @@ int main(int argc, char** argv) } // initialize eCAL API - eCAL::Initialize(argc, argv, "ecal stepper", eCAL::Init::Default); + eCAL::Initialize("ecal stepper", eCAL::Init::Default); // create player service client eCAL::protobuf::CServiceClient player_service; diff --git a/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp b/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp index 4f42bb07e2..924d5f85e3 100644 --- a/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp +++ b/samples/cpp/services/rec_client_service_cli/src/ecalrecorder_client.cpp @@ -91,10 +91,10 @@ void OnRecorderResponse(const struct eCAL::SServiceResponse& service_response_) } // main entry -int main(int argc, char **argv) +int main() { // initialize eCAL API - eCAL::Initialize(argc, argv, "RecClientServiceCli"); + eCAL::Initialize("RecClientServiceCli"); // create recorder service client eCAL::protobuf::CServiceClient recorder_service; diff --git a/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp b/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp index e16fac7218..5cdc38d143 100644 --- a/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp +++ b/samples/cpp/services/rec_client_service_gui/src/EcalrecGuiClient.cpp @@ -28,7 +28,7 @@ EcalrecGuiClient::EcalrecGuiClient(QWidget *parent) ui_.setupUi(this); // initialize eCAL API - eCAL::Initialize(0, nullptr, "RecClientServiceGui"); + eCAL::Initialize("RecClientServiceGui"); // create player service client recorder_service_.AddResponseCallback([this](const struct eCAL::SServiceResponse& service_response) {this->onRecorderResponse(service_response); }); diff --git a/samples/cpp/services/rec_client_service_gui/src/main.cpp b/samples/cpp/services/rec_client_service_gui/src/main.cpp index 037e0b7c6d..96835e7633 100644 --- a/samples/cpp/services/rec_client_service_gui/src/main.cpp +++ b/samples/cpp/services/rec_client_service_gui/src/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "EcalRecGuiClient", eCAL::Init::Default); + eCAL::Initialize("EcalRecGuiClient", eCAL::Init::Default); QApplication a(argc, argv); diff --git a/samples/cpp/services/rec_server_service_gui/src/main.cpp b/samples/cpp/services/rec_server_service_gui/src/main.cpp index c794d6fe98..25e3bf14ea 100644 --- a/samples/cpp/services/rec_server_service_gui/src/main.cpp +++ b/samples/cpp/services/rec_server_service_gui/src/main.cpp @@ -25,7 +25,7 @@ int main(int argc, char *argv[]) { // Just make sure that eCAL is initialized - eCAL::Initialize(0, nullptr, "EcalRecGuiClient", eCAL::Init::Default); + eCAL::Initialize("EcalRecGuiClient", eCAL::Init::Default); QApplication a(argc, argv); diff --git a/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp b/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp index 6c78a24341..30742e78e1 100644 --- a/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp +++ b/samples/cpp/services/rec_server_service_gui/src/rec_server_service_gui.cpp @@ -29,7 +29,7 @@ RecServerServiceGui::RecServerServiceGui(QWidget *parent) ui_.setupUi(this); // initialize eCAL API - eCAL::Initialize(0, nullptr, "RecServerServiceGui"); + eCAL::Initialize("RecServerServiceGui"); // create player service client recorder_service_.AddResponseCallback([this](const struct eCAL::SServiceResponse& service_response) {this->onRecorderResponse(service_response); });