Skip to content

Commit

Permalink
adjust common includes
Browse files Browse the repository at this point in the history
  • Loading branch information
yuwenyong.vincent authored and yuwenyong.vincent committed Dec 30, 2018
1 parent 3042a05 commit 2c4717e
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 26 deletions.
2 changes: 2 additions & 0 deletions src/net4cxx/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <algorithm>
#include <array>
#include <exception>
#include <iostream>
#include <list>
#include <map>
#include <memory>
Expand Down Expand Up @@ -66,6 +67,7 @@
#endif


#include <boost/algorithm/string.hpp>
#include <boost/any.hpp>
#include <boost/optional.hpp>
#include <boost/regex.hpp>
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/compress/gzip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/common/compress/gzip.h"
#include <boost/algorithm/string.hpp>
#include <boost/endian/conversion.hpp>
#include <boost/filesystem.hpp>

Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/compress/gzip.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <fstream>
#include <iostream>
#include <sstream>
#include <boost/optional.hpp>
#include "net4cxx/common/compress/zlib.h"
#include "net4cxx/common/utilities/errors.h"

Expand Down
2 changes: 0 additions & 2 deletions src/net4cxx/common/configuration/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@
#define NET4CXX_COMMON_CONFIGURATION_OPTIONS_H

#include "net4cxx/common/common.h"
#include <iostream>
#include <boost/function.hpp>
#include <boost/optional.hpp>
#include <boost/program_options.hpp>
#include <boost/ptr_container/ptr_map.hpp>
#include "net4cxx/common/utilities/errors.h"
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/crypto/hashlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define NET4CXX_COMMON_CRYPTO_HASHLIB_H

#include "net4cxx/common/common.h"

#include <openssl/err.h>
#include <openssl/evp.h>
#include <boost/mpl/string.hpp>
Expand Down
24 changes: 24 additions & 0 deletions src/net4cxx/common/debugging/watcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,30 @@ class NET4CXX_COMMON_API Watcher {

void del(const char *key);

int get(const char *key) const {
std::lock_guard<std::mutex> lock(_lock);
return _objs.at(key);
}

int get(const char *key, int defValue) const {
std::lock_guard<std::mutex> lock(_lock);
auto iter = _objs.find(key);
return iter != _objs.end() ? iter->second : defValue;
}

template <typename FuncT>
void getAll(FuncT func) const {
std::lock_guard<std::mutex> lock(_lock);
for (auto &kv: _objs) {
func(kv.first, kv.second);
}
}

int getCount() const {
std::lock_guard<std::mutex> lock(_lock);
return _objs.size();
}

void addSetCallback(const char *key, const SetCallback &callback);

void addIncCallback(const char *key, const IncCallback &callback);
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/email/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/common/email/utils.h"
#include <boost/algorithm/string.hpp>
#include "net4cxx/common/utilities/strutil.h"


Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/httputils/cookie.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define NET4CXX_COMMON_HTTPUTILS_COOKIE_H

#include "net4cxx/common/common.h"
#include <boost/algorithm/string.hpp>
#include "net4cxx/common/utilities/errors.h"

NS_BEGIN
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/httputils/urlparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/common/httputils/urlparse.h"
#include <boost/algorithm/string.hpp>
#include "net4cxx/common/utilities/errors.h"
#include "net4cxx/common/utilities/strutil.h"

Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/logging/attributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/common/logging/attributes.h"
#include <boost/algorithm/string.hpp>


NS_BEGIN
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/logging/sinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/common/logging/sinks.h"
#include <boost/algorithm/string.hpp>
#include <boost/core/null_deleter.hpp>
#include "net4cxx/common/logging/logging.h"

Expand Down
2 changes: 0 additions & 2 deletions src/net4cxx/common/logging/sinks.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include "net4cxx/common/common.h"
#include <boost/log/sinks.hpp>
#include <boost/log/utility/functional.hpp>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include "net4cxx/common/logging/attributes.h"

NS_BEGIN
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/serialization/archive.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define NET4CXX_COMMON_SERIALIZATION_ARCHIVE_H

#include "net4cxx/common/common.h"
#include <boost/optional.hpp>
#include "net4cxx/common/utilities/errors.h"

NS_BEGIN
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/utilities/strutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define NET4CXX_COMMON_UTILITIES_STRUTIL_H

#include "net4cxx/common/common.h"
#include <boost/algorithm/string.hpp>
#include <boost/format.hpp>


Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/common/utilities/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#define NET4CXX_COMMON_UTILITIES_UTIL_H

#include "net4cxx/common/common.h"
#include <boost/algorithm/string.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/property_tree/ptree.hpp>

Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/core/network/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <boost/asio.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/asio/steady_timer.hpp>
#include <boost/algorithm/string.hpp>
#include "net4cxx/common/utilities/errors.h"
#include "net4cxx/common/utilities/messagebuffer.h"

Expand Down
3 changes: 0 additions & 3 deletions src/net4cxx/core/network/defer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
#define NET4CXX_CORE_NETWORK_DEFER_H

#include "net4cxx/common/common.h"
#include <boost/any.hpp>
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include "net4cxx/common/debugging/assert.h"
#include "net4cxx/common/debugging/watcher.h"
#include "net4cxx/core/network/base.h"
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/core/network/endpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/core/network/endpoints.h"
#include <boost/algorithm/string.hpp>
#include "net4cxx/common/utilities/strutil.h"
#include "net4cxx/core/network/defer.h"
#include "net4cxx/core/network/reactor.h"
Expand Down
2 changes: 0 additions & 2 deletions src/net4cxx/plugins/websocket/protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "net4cxx/plugins/websocket/base.h"
#include <boost/logic/tribool.hpp>
#include <boost/optional.hpp>
#include <boost/regex.hpp>
#include "net4cxx/common/debugging/watcher.h"
#include "net4cxx/common/httputils/urlparse.h"
#include "net4cxx/core/network/protocol.h"
Expand Down
2 changes: 0 additions & 2 deletions src/net4cxx/plugins/websocket/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#define NET4CXX_PLUGINS_WEBSOCKET_UTIL_H

#include "net4cxx/plugins/websocket/base.h"
#include <boost/optional.hpp>
#include <boost/regex.hpp>
#include "net4cxx/common/configuration/json.h"
#include "net4cxx/common/httputils/urlparse.h"
#include "net4cxx/common/utilities/util.h"
Expand Down
2 changes: 1 addition & 1 deletion src/net4cxx/shared/bootstrap/bootstrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Created by yuwenyong.vincent on 2018/10/5.
//

#include <net4cxx/shared/global/constants.h>
#include "net4cxx/shared/bootstrap/bootstrapper.h"
#include "net4cxx/shared/global/constants.h"
#include "net4cxx/common/configuration/options.h"
#include "net4cxx/common/debugging/assert.h"
#include "net4cxx/common/debugging/crashreport.h"
Expand Down
1 change: 0 additions & 1 deletion src/net4cxx/shared/global/loggers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
//

#include "net4cxx/shared/global/loggers.h"
#include <boost/regex.hpp>


NS_BEGIN
Expand Down

0 comments on commit 2c4717e

Please sign in to comment.