Skip to content

Commit

Permalink
Fix c++ formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcamposruiz committed Jul 26, 2023
1 parent 40beeee commit 317bc66
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 47 deletions.
15 changes: 0 additions & 15 deletions examples/connext_dds/coherent_presentation/c++11/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,6 @@

namespace application {

// Catch control-C and tell application to shut down
bool shutdown_requested = false;

inline void stop_handler(int)
{
shutdown_requested = true;
std::cout << "preparing to shut down..." << std::endl;
}

inline void setup_signal_handlers()
{
signal(SIGINT, stop_handler);
signal(SIGTERM, stop_handler);
}

enum class ParseReturn { ok, failure, exit };

struct ApplicationArguments {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
/*
* (c) Copyright, Real-Time Innovations, 2020. All rights reserved.
* RTI grants Licensee a license to use, modify, compile, and create derivative
* works of the software solely for use with RTI Connext DDS. Licensee may
* redistribute copies of the software provided that all such copies are subject
* to this license. The software is provided "as is", with no warranty of any
* type, including any warranty for fitness for any purpose. RTI is under no
* obligation to maintain or support the software. RTI shall not be liable for
* any incidental or consequential damages arising out of the use or inability
* to use the software.
*/

/* Inventory_client.cxx
*/
* (c) Copyright, Real-Time Innovations, 2020. All rights reserved.
* RTI grants Licensee a license to use, modify, compile, and create derivative
* works of the software solely for use with RTI Connext DDS. Licensee may
* redistribute copies of the software provided that all such copies are subject
* to this license. The software is provided "as is", with no warranty of any
* type, including any warranty for fitness for any purpose. RTI is under no
* obligation to maintain or support the software. RTI shall not be liable for
* any incidental or consequential damages arising out of the use or inability
* to use the software.
*/

#include <iostream>
#include "application.hpp"
#include "Inventory.hpp"

void run_client(int domain_id, bool add, const std::string& item_name, int quantity)
void run_client(
int domain_id,
bool add,
const std::string &item_name,
int quantity)
{
// Create a DomainParticipant with default Qos
dds::domain::DomainParticipant participant(domain_id);
Expand All @@ -42,7 +42,7 @@ void run_client(int domain_id, bool add, const std::string& item_name, int quant
std::cout << "Remove " << quantity << " " << item_name << std::endl;
try {
client.remove_item(::Item(item_name, quantity));
} catch (const UnknownItemError& e) {
} catch (const UnknownItemError &e) {
std::cout << "Unknown item: " << e.name() << std::endl;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
/*
* (c) Copyright, Real-Time Innovations, 2020. All rights reserved.
* RTI grants Licensee a license to use, modify, compile, and create derivative
* works of the software solely for use with RTI Connext DDS. Licensee may
* redistribute copies of the software provided that all such copies are subject
* to this license. The software is provided "as is", with no warranty of any
* type, including any warranty for fitness for any purpose. RTI is under no
* obligation to maintain or support the software. RTI shall not be liable for
* any incidental or consequential damages arising out of the use or inability
* to use the software.
*/

/* Inventory_service.cxx
*/
* (c) Copyright, Real-Time Innovations, 2020. All rights reserved.
* RTI grants Licensee a license to use, modify, compile, and create derivative
* works of the software solely for use with RTI Connext DDS. Licensee may
* redistribute copies of the software provided that all such copies are subject
* to this license. The software is provided "as is", with no warranty of any
* type, including any warranty for fitness for any purpose. RTI is under no
* obligation to maintain or support the software. RTI shall not be liable for
* any incidental or consequential damages arising out of the use or inability
* to use the software.
*/

#include <iostream>
#include <mutex>
Expand Down Expand Up @@ -66,6 +62,7 @@ class InventoryImpl : public InventoryService {
inventory.erase(item.name());
}
}

private:
std::map<std::string, int> inventory;

Expand Down Expand Up @@ -98,7 +95,7 @@ int main(int argc, char *argv[])
dds::domain::DomainParticipant participant(arguments.domain_id);

// Create an instance of the service interface
auto service_impl = std::make_shared< InventoryImpl>();
auto service_impl = std::make_shared<InventoryImpl>();

// A server provides the execution environment (a thread pool) for one or
// more services
Expand Down Expand Up @@ -127,4 +124,3 @@ int main(int argc, char *argv[])

return 0;
}

0 comments on commit 317bc66

Please sign in to comment.