Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 48 additions & 48 deletions ddsenabler/examples/action/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,50 +50,50 @@ class CLIParser
static void print_help(
uint8_t return_code)
{
std::cout << "Usage: ddsenabler_example_action <client|server> [options]" <<
std::endl;
std::cout << "" <<
std::endl;
std::cout << "--config <str> Path to the configuration file" <<
std::endl;
std::cout << " (optional, if not provided default config is used)" <<
std::endl;
std::cout << "--action-name <str> Name of the action to be registered" <<
std::endl;
std::cout << " (Default: 'fibonacci')" <<
std::endl;
std::cout << "--timeout <num> Time (seconds) to wait before stopping the" <<
std::endl;
std::cout << " program if expectations are not met" <<
std::endl;
std::cout << " (Default: 30)" <<
std::endl;
std::cout << "--persistence-path <str> Path to the persistence directory" <<
std::endl;
std::cout << " (No default value as it is required)" <<
std::endl;
std::cout << "\n-------------------------------------SERVER OPTIONS------------------------------------\n" <<
std::endl;
std::cout << "--expected-requests <num> Number of requests expected to be received" <<
std::endl;
std::cout << " (Default: 0, meaning infinite)" <<
std::endl;
std::cout << "\n-------------------------------------CLIENT OPTIONS------------------------------------\n" <<
std::endl;
std::cout << "--request-initial-wait <num> Time (seconds) to wait before starting" <<
std::endl;
std::cout << " requests publication since server matching" <<
std::endl;
std::cout << " (Default: 0)" <<
std::endl;
std::cout << "--cancel-requests <bool> Whether to cancel requests after sending them" <<
std::endl;
std::cout << " (Default: false)" <<
std::endl;
std::cout << "--goals-path <str> Directory containing goal JSON files" <<
std::endl;
std::cout << " (No default value as it is required for client mode)" <<
std::endl;
std::cout << "Usage: ddsenabler_example_action <client|server> [options]"
<< std::endl;
std::cout << ""
<< std::endl;
std::cout << "--config <str> Path to the configuration file"
<< std::endl;
std::cout << " (optional, if not provided default config is used)"
<< std::endl;
std::cout << "--action-name <str> Name of the action to be registered"
<< std::endl;
std::cout << " (Default: 'fibonacci')"
<< std::endl;
std::cout << "--timeout <num> Time (seconds) to wait before stopping the"
<< std::endl;
std::cout << " program if expectations are not met"
<< std::endl;
std::cout << " (Default: 30)"
<< std::endl;
std::cout << "--persistence-path <str> Path to the persistence directory"
<< std::endl;
std::cout << " (No default value as it is required)"
<< std::endl;
std::cout << "\n-------------------------------------SERVER OPTIONS------------------------------------\n"
<< std::endl;
std::cout << "--expected-requests <num> Number of requests expected to be received"
<< std::endl;
std::cout << " (Default: 0, meaning infinite)"
<< std::endl;
std::cout << "\n-------------------------------------CLIENT OPTIONS------------------------------------\n"
<< std::endl;
std::cout << "--request-initial-wait <num> Time (seconds) to wait before starting"
<< std::endl;
std::cout << " requests publication since server matching"
<< std::endl;
std::cout << " (Default: 0)"
<< std::endl;
std::cout << "--cancel-requests <bool> Whether to cancel requests after sending them"
<< std::endl;
std::cout << " (Default: false)"
<< std::endl;
std::cout << "--goals-path <str> Directory containing goal JSON files"
<< std::endl;
std::cout << " (No default value as it is required for client mode)"
<< std::endl;
std::exit(return_code);
}

Expand Down Expand Up @@ -223,8 +223,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --expected-requests argument " << argv[i] << ": " << e.what() <<
std::endl;
std::cerr << "Invalid --expected-requests argument " << argv[i] << ": " << e.what()
<< std::endl;
print_help(EXIT_FAILURE);
}
}
Expand All @@ -244,8 +244,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --request-initial-wait argument " << argv[i] << ": " << e.what() <<
std::endl;
std::cerr << "Invalid --request-initial-wait argument " << argv[i] << ": " << e.what()
<< std::endl;
print_help(EXIT_FAILURE);
}
}
Expand Down
16 changes: 8 additions & 8 deletions ddsenabler/examples/publish/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --expected-types argument " << std::string(argv[i]) << ": " <<
std::string(e.what()) << std::endl;
std::cerr << "Invalid --expected-types argument " << std::string(argv[i]) << ": "
<< std::string(e.what()) << std::endl;
print_help(EXIT_FAILURE);
}
}
Expand All @@ -156,8 +156,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --expected-topics argument " << std::string(argv[i]) << ": " <<
std::string(e.what()) << std::endl;
std::cerr << "Invalid --expected-topics argument " << std::string(argv[i]) << ": "
<< std::string(e.what()) << std::endl;
print_help(EXIT_FAILURE);
}
}
Expand Down Expand Up @@ -261,8 +261,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --publish-period argument " << std::string(argv[i]) << ": " <<
std::string(
std::cerr << "Invalid --publish-period argument " << std::string(argv[i]) << ": "
<< std::string(
e.what()) << std::endl;
print_help(EXIT_FAILURE);
}
Expand All @@ -283,8 +283,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --publish-initial-wait argument " << std::string(argv[i]) << ": " <<
std::string(
std::cerr << "Invalid --publish-initial-wait argument " << std::string(argv[i]) << ": "
<< std::string(
e.what()) << std::endl;
print_help(EXIT_FAILURE);
}
Expand Down
14 changes: 7 additions & 7 deletions ddsenabler/examples/publish/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ static void test_type_notification_callback(
{
std::lock_guard<std::mutex> lock(app_mutex_);
notify = ++received_types_ >= config.expected_types;
std::cout << "Type callback received: " << type_name << ", Total types: " <<
received_types_ << std::endl << serialized_type << std::endl << std::endl;
std::cout << "Type callback received: " << type_name << ", Total types: "
<< received_types_ << std::endl << serialized_type << std::endl << std::endl;
if (!config.persistence_path.empty() &&
!utils::save_type_to_file((std::filesystem::path(config.persistence_path) / TYPES_SUBDIR).string(),
type_name,
Expand Down Expand Up @@ -132,9 +132,9 @@ static void test_topic_notification_callback(
{
std::lock_guard<std::mutex> lock(app_mutex_);
notify = ++received_topics_ >= config.expected_topics;
std::cout << "Topic callback received: " << topic_name << " of type " << topic_info.type_name <<
", Total topics: " <<
received_topics_ << std::endl << topic_info.serialized_qos << std::endl << std::endl;
std::cout << "Topic callback received: " << topic_name << " of type " << topic_info.type_name
<< ", Total topics: "
<< received_topics_ << std::endl << topic_info.serialized_qos << std::endl << std::endl;
if (!config.persistence_path.empty() &&
!utils::save_topic_to_file((std::filesystem::path(config.persistence_path) / TOPICS_SUBDIR).string(),
topic_name,
Expand Down Expand Up @@ -181,8 +181,8 @@ static void test_data_notification_callback(
{
std::lock_guard<std::mutex> lock(app_mutex_);
notify = ++received_data_ >= config.expected_data;
std::cout << "Data callback received: " << topic_name << ", Total data: " <<
received_data_ << std::endl << json << std::endl << std::endl;
std::cout << "Data callback received: " << topic_name << ", Total data: "
<< received_data_ << std::endl << json << std::endl << std::endl;
if (!config.persistence_path.empty() &&
!utils::save_data_to_file((std::filesystem::path(config.persistence_path) / SAMPLES_SUBDIR).string(),
topic_name, json,
Expand Down
92 changes: 46 additions & 46 deletions ddsenabler/examples/service/CLIParser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,46 +49,46 @@ class CLIParser
static void print_help(
uint8_t return_code)
{
std::cout << "Usage: ddsenabler_example_service <client|server> [options]" <<
std::endl;
std::cout << "" <<
std::endl;
std::cout << "--config <str> Path to the configuration file" <<
std::endl;
std::cout << " (optional, if not provided default config is used)" <<
std::endl;
std::cout << "--service-name <str> Name of the service to be registered" <<
std::endl;
std::cout << " (Default: 'add_two_ints')" <<
std::endl;
std::cout << "--timeout <num> Time (seconds) to wait before stopping the" <<
std::endl;
std::cout << " program if expectations are not met" <<
std::endl;
std::cout << " (Default: 30)" <<
std::endl;
std::cout << "--persistence-path <str> Path to the persistence directory" <<
std::endl;
std::cout << " (No default value as it is required)" <<
std::endl;
std::cout << "\n-------------------------------------SERVER OPTIONS------------------------------------\n" <<
std::endl;
std::cout << "--expected-requests <num> Number of requests expected to be received" <<
std::endl;
std::cout << " (Default: 0, meaning infinite)" <<
std::endl;
std::cout << "\n-------------------------------------CLIENT OPTIONS------------------------------------\n" <<
std::endl;
std::cout << "--request-initial-wait <num> Time (seconds) to wait before starting" <<
std::endl;
std::cout << " requests publication since server matching" <<
std::endl;
std::cout << " (Default: 0)" <<
std::endl;
std::cout << "--requests-path <str> Directory containing request JSON files" <<
std::endl;
std::cout << " (No default value as it is required for client mode)" <<
std::endl;
std::cout << "Usage: ddsenabler_example_service <client|server> [options]"
<< std::endl;
std::cout << ""
<< std::endl;
std::cout << "--config <str> Path to the configuration file"
<< std::endl;
std::cout << " (optional, if not provided default config is used)"
<< std::endl;
std::cout << "--service-name <str> Name of the service to be registered"
<< std::endl;
std::cout << " (Default: 'add_two_ints')"
<< std::endl;
std::cout << "--timeout <num> Time (seconds) to wait before stopping the"
<< std::endl;
std::cout << " program if expectations are not met"
<< std::endl;
std::cout << " (Default: 30)"
<< std::endl;
std::cout << "--persistence-path <str> Path to the persistence directory"
<< std::endl;
std::cout << " (No default value as it is required)"
<< std::endl;
std::cout << "\n-------------------------------------SERVER OPTIONS------------------------------------\n"
<< std::endl;
std::cout << "--expected-requests <num> Number of requests expected to be received"
<< std::endl;
std::cout << " (Default: 0, meaning infinite)"
<< std::endl;
std::cout << "\n-------------------------------------CLIENT OPTIONS------------------------------------\n"
<< std::endl;
std::cout << "--request-initial-wait <num> Time (seconds) to wait before starting"
<< std::endl;
std::cout << " requests publication since server matching"
<< std::endl;
std::cout << " (Default: 0)"
<< std::endl;
std::cout << "--requests-path <str> Directory containing request JSON files"
<< std::endl;
std::cout << " (No default value as it is required for client mode)"
<< std::endl;
std::exit(return_code);
}

Expand Down Expand Up @@ -218,8 +218,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --expected-requests argument " << argv[i] << ": " << e.what() <<
std::endl;
std::cerr << "Invalid --expected-requests argument " << argv[i] << ": " << e.what()
<< std::endl;
print_help(EXIT_FAILURE);
}
}
Expand All @@ -239,8 +239,8 @@ class CLIParser
}
catch (const std::exception& e)
{
std::cerr << "Invalid --request-initial-wait argument " << argv[i] << ": " << e.what() <<
std::endl;
std::cerr << "Invalid --request-initial-wait argument " << argv[i] << ": " << e.what()
<< std::endl;
print_help(EXIT_FAILURE);
}
}
Expand Down Expand Up @@ -290,8 +290,8 @@ class CLIParser

if (config.persistence_path.empty())
{
std::cerr << "Warning: persistence path is not set, persistence features will be disabled" <<
std::endl;
std::cerr << "Warning: persistence path is not set, persistence features will be disabled"
<< std::endl;
}

return config;
Expand Down
4 changes: 2 additions & 2 deletions ddsenabler/examples/service/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ bool server_routine(
return false;
}

std::cout << "Received request for service: " << service_name << " with request ID: " << request_id <<
std::endl;
std::cout << "Received request for service: " << service_name << " with request ID: " << request_id
<< std::endl;

// Example response
server_specific_logic(
Expand Down
2 changes: 1 addition & 1 deletion ddsenabler/src/cpp/DDSEnabler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ bool DDSEnabler::set_file_watcher(
// WARNING: it is needed to pass file_path, as FileWatcher only retrieves file_name
std::function<void(std::string)> file_watcher_callback =
[this, file_path]
(std::string file_name)
(std::string file_name)
{
EPROSIMA_LOG_INFO(DDSENABLER_EXECUTION,
"FileWatcher notified changes in file " << file_path << ". Reloading configuration");
Expand Down
Loading
Loading