diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-19 23:13:07 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-19 23:13:07 +0200 |
commit | 06b0a16d2635dba071ea7967f32c2aabe2b9cbcc (patch) | |
tree | 0d5d9c40f0dbc8d1fadc89e1da897075ecc52a8a | |
parent | ae2d05eee4ffcec4c0611d907779ce8ef61d3a6e (diff) | |
download | ble-toys-06b0a16d2635dba071ea7967f32c2aabe2b9cbcc.tar.gz ble-toys-06b0a16d2635dba071ea7967f32c2aabe2b9cbcc.tar.bz2 ble-toys-06b0a16d2635dba071ea7967f32c2aabe2b9cbcc.tar.xz ble-toys-06b0a16d2635dba071ea7967f32c2aabe2b9cbcc.zip |
o Trying to clean up includes a bit.
-rw-r--r-- | apps/apps.cpp | 9 | ||||
-rw-r--r-- | apps/apps.h | 17 | ||||
-rw-r--r-- | apps/ble-inspect-device.cpp | 2 | ||||
-rw-r--r-- | apps/sample-convert.cpp | 1 | ||||
-rw-r--r-- | apps/sm-db-insert.cpp | 2 | ||||
-rw-r--r-- | apps/sm-db-select.cpp | 2 | ||||
-rw-r--r-- | apps/sm-serial-read-all.cpp | 6 | ||||
-rw-r--r-- | apps/sm-serial-read.cpp | 2 | ||||
-rw-r--r-- | ble/ByteBuffer.cpp | 5 | ||||
-rw-r--r-- | include/ble/Bluetooth.h | 6 | ||||
-rw-r--r-- | include/ble/ByteBuffer.h | 5 | ||||
-rw-r--r-- | sensor/include/trygvis/sensor.h | 5 | ||||
-rw-r--r-- | sensor/include/trygvis/sensor/io.h | 2 | ||||
-rw-r--r-- | sensor/main/io.cpp | 4 | ||||
-rw-r--r-- | sensor/main/sensor.cpp | 5 |
15 files changed, 32 insertions, 41 deletions
diff --git a/apps/apps.cpp b/apps/apps.cpp index 916b0e0..5ff8bf1 100644 --- a/apps/apps.cpp +++ b/apps/apps.cpp @@ -1,7 +1,12 @@ #include "apps.h" -#include <netdb.h> #include <log4cplus/consoleappender.h> -#include <log4cplus/configurator.h> +#include <log4cplus/hierarchy.h> +#include <boost/program_options.hpp> +#include <netdb.h> +#include <stdlib.h> +#include <string.h> +#include <sys/socket.h> +#include <unistd.h> namespace trygvis { namespace apps { diff --git a/apps/apps.h b/apps/apps.h index e9338a4..d54110b 100644 --- a/apps/apps.h +++ b/apps/apps.h @@ -1,10 +1,12 @@ #pragma once -#include <boost/program_options.hpp> #include <log4cplus/logger.h> -#include <log4cplus/loggingmacros.h> -#include "json.hpp" -#include <exception> +#include <boost/program_options/errors.hpp> +#include <boost/program_options/options_description.hpp> +#include <boost/program_options/variables_map.hpp> +#include <stdexcept> +#include <iosfwd> +#include <json.hpp> namespace trygvis { namespace apps { @@ -32,13 +34,6 @@ T get(json j, std::string key) { return ref; } -class unknown_app : public std::runtime_error { -public: - unknown_app(const std::string &app_name) : runtime_error("Unknown application: " + app_name), app_name(app_name) {} - - const std::string app_name; -}; - class app_execution { public: app_execution(po::options_description desc, po::variables_map vm, Logger logger) diff --git a/apps/ble-inspect-device.cpp b/apps/ble-inspect-device.cpp index 763dd9a..6330512 100644 --- a/apps/ble-inspect-device.cpp +++ b/apps/ble-inspect-device.cpp @@ -1,4 +1,4 @@ -#include <exception> +#include <stdexcept> #include <iostream> #include <vector> #include <boost/uuid/uuid_io.hpp> diff --git a/apps/sample-convert.cpp b/apps/sample-convert.cpp index f592291..81c08ca 100644 --- a/apps/sample-convert.cpp +++ b/apps/sample-convert.cpp @@ -1,6 +1,5 @@ #include "trygvis/sensor.h" #include "trygvis/sensor/io.h" -#include "json.hpp" #include "apps.h" #include <fstream> #include <boost/tokenizer.hpp> diff --git a/apps/sm-db-insert.cpp b/apps/sm-db-insert.cpp index b93be09..d42807e 100644 --- a/apps/sm-db-insert.cpp +++ b/apps/sm-db-insert.cpp @@ -2,7 +2,7 @@ #include <boost/lexical_cast.hpp> #include <pqxx/connection.hxx> #include <pqxx/transaction.hxx> -#include "json.hpp" +#include <json.hpp> #include "apps.h" #include <fstream> diff --git a/apps/sm-db-select.cpp b/apps/sm-db-select.cpp index 2390733..d9d7166 100644 --- a/apps/sm-db-select.cpp +++ b/apps/sm-db-select.cpp @@ -2,7 +2,7 @@ #include <boost/lexical_cast.hpp> #include <pqxx/connection.hxx> #include <pqxx/transaction.hxx> -#include "json.hpp" +#include <json.hpp> #include "apps.h" namespace trygvis { diff --git a/apps/sm-serial-read-all.cpp b/apps/sm-serial-read-all.cpp index bf5ef11..a81a016 100644 --- a/apps/sm-serial-read-all.cpp +++ b/apps/sm-serial-read-all.cpp @@ -1,7 +1,7 @@ #include "trygvis/sensor.h" #include "trygvis/sensor/io.h" -#include "json.hpp" #include "apps.h" +#include <dirent.h> #include <thread> #include <boost/asio/serial_port.hpp> @@ -15,7 +15,6 @@ using namespace trygvis::apps; using namespace trygvis::sensor; using namespace trygvis::sensor::io; namespace po = boost::program_options; -using json = nlohmann::json; namespace sm_serial_read_all_utils { @@ -58,9 +57,6 @@ private: // This only supports Linux #if 1 -#include <sys/types.h> -#include <dirent.h> - vector<string> &&find_ports() { DIR *dir = opendir("/dev"); vector<string> ports; diff --git a/apps/sm-serial-read.cpp b/apps/sm-serial-read.cpp index 5005554..980a3f6 100644 --- a/apps/sm-serial-read.cpp +++ b/apps/sm-serial-read.cpp @@ -1,6 +1,5 @@ #include "trygvis/sensor.h" #include "trygvis/sensor/io.h" -#include "json.hpp" #include "apps.h" #include <chrono> #include <thread> @@ -16,7 +15,6 @@ using namespace trygvis::apps; using namespace trygvis::sensor; using namespace trygvis::sensor::io; namespace po = boost::program_options; -using json = nlohmann::json; namespace sm_serial_read_utils { diff --git a/ble/ByteBuffer.cpp b/ble/ByteBuffer.cpp index 66f9270..ff7c928 100644 --- a/ble/ByteBuffer.cpp +++ b/ble/ByteBuffer.cpp @@ -1,8 +1,7 @@ #include "ble/ByteBuffer.h" -#include <string.h> -#include <sstream> -#include <iomanip> #include <cassert> +#include <cstring> +#include <iomanip> using namespace std; diff --git a/include/ble/Bluetooth.h b/include/ble/Bluetooth.h index e9916e9..d238377 100644 --- a/include/ble/Bluetooth.h +++ b/include/ble/Bluetooth.h @@ -1,10 +1,12 @@ #ifndef BLUETOOTH_H #define BLUETOOTH_H -#include <string> -#include <stdexcept> #include <boost/uuid/uuid.hpp> #include <boost/optional.hpp> +#include <iosfwd> +#include <stdexcept> +#include <vector> +#include <cstdint> #include "ByteBuffer.h" diff --git a/include/ble/ByteBuffer.h b/include/ble/ByteBuffer.h index 74a1bf7..d977c67 100644 --- a/include/ble/ByteBuffer.h +++ b/include/ble/ByteBuffer.h @@ -1,11 +1,12 @@ #ifndef BYTE_STREAM_WRAPPER_H #define BYTE_STREAM_WRAPPER_H +#include <cstddef> #include <cstdint> #include <cstdlib> -#include <string> -#include <stdexcept> +#include <iosfwd> #include <memory> +#include <stdexcept> class ByteBufferException : public std::runtime_error { public: diff --git a/sensor/include/trygvis/sensor.h b/sensor/include/trygvis/sensor.h index b5199e2..c109a2a 100644 --- a/sensor/include/trygvis/sensor.h +++ b/sensor/include/trygvis/sensor.h @@ -1,9 +1,10 @@ #pragma once -#include <exception> -#include <string> +#include <stdexcept> +#include <iosfwd> #include <iostream> #include <memory> +#include <vector> #include <boost/optional/optional.hpp> namespace trygvis { diff --git a/sensor/include/trygvis/sensor/io.h b/sensor/include/trygvis/sensor/io.h index b69bd7a..dd1460b 100644 --- a/sensor/include/trygvis/sensor/io.h +++ b/sensor/include/trygvis/sensor/io.h @@ -3,7 +3,7 @@ #include "trygvis/sensor.h" #include <mutex> -#include "boost/asio/buffer.hpp" +#include <boost/asio/buffer.hpp> namespace trygvis { namespace sensor { diff --git a/sensor/main/io.cpp b/sensor/main/io.cpp index a37844a..6c384ff 100644 --- a/sensor/main/io.cpp +++ b/sensor/main/io.cpp @@ -1,8 +1,8 @@ #include "trygvis/sensor/io.h" #include <map> -#include "json.hpp" -#include "boost/tokenizer.hpp" +#include <json.hpp> +#include <boost/tokenizer.hpp> #include <boost/algorithm/string.hpp> namespace trygvis { diff --git a/sensor/main/sensor.cpp b/sensor/main/sensor.cpp index be3d31e..1c0c666 100644 --- a/sensor/main/sensor.cpp +++ b/sensor/main/sensor.cpp @@ -1,10 +1,5 @@ #include "trygvis/sensor.h" - -#include "json.hpp" -#include <set> -#include <boost/regex.hpp> #include <boost/lexical_cast.hpp> -#include <chrono> namespace trygvis { namespace sensor { |