From: Gunnar Beutner Date: Mon, 2 Apr 2012 07:03:29 +0000 (+0200) Subject: Cleaned up includes; using namespace std is the default now. X-Git-Tag: v0.0.1~665 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1b6bfb9db5d21dc15c048319a3a947d3198beec3;p=icinga2 Cleaned up includes; using namespace std is the default now. --- diff --git a/base/application.h b/base/application.h index 1e0a98906..59dfda905 100644 --- a/base/application.h +++ b/base/application.h @@ -1,14 +1,8 @@ #ifndef APPLICATION_H #define APPLICATION_H -#include - namespace icinga { -using std::vector; -using std::map; -using std::string; - class Component; class Application : public Object { diff --git a/base/confighive.h b/base/confighive.h index 8425bf31f..fd5363cea 100644 --- a/base/confighive.h +++ b/base/confighive.h @@ -1,13 +1,9 @@ #ifndef CONFIGHIVE_H #define CONFIGHIVE_H -#include - namespace icinga { -using std::map; - struct ConfigHiveEventArgs : public EventArgs { typedef shared_ptr RefType; diff --git a/base/configobject.h b/base/configobject.h index 150cafb34..53bfd7b8a 100644 --- a/base/configobject.h +++ b/base/configobject.h @@ -6,9 +6,6 @@ namespace icinga { -using std::map; -using std::string; - class ConfigHive; class ConfigObject : public Object diff --git a/base/delegate.h b/base/delegate.h index 8a6f455ce..de8f3cd43 100644 --- a/base/delegate.h +++ b/base/delegate.h @@ -6,9 +6,6 @@ namespace icinga { -using std::tr1::function; -using namespace std::tr1::placeholders; - template int delegate_fwd(int (TObject::*function)(TArgs), weak_ptr wref, const TArgs& args) { diff --git a/base/event.h b/base/event.h index f4dba3343..dcb5425d5 100644 --- a/base/event.h +++ b/base/event.h @@ -4,8 +4,6 @@ namespace icinga { -using std::list; - struct EventArgs : public Object { typedef shared_ptr RefType; diff --git a/base/i2-base.h b/base/i2-base.h index 87757018a..9ecd733d3 100644 --- a/base/i2-base.h +++ b/base/i2-base.h @@ -14,14 +14,22 @@ #include #include #include - +#include #include + +using namespace std; + #ifdef _MSC_VER # include # include + +using namespace std::placeholders; #else # include # include + +using namespace std::tr1; +using namespace std::tr1::placeholders; #endif #define PLATFORM_WINDOWS 1 diff --git a/base/memory.h b/base/memory.h index e23530cc0..1126c8089 100644 --- a/base/memory.h +++ b/base/memory.h @@ -4,8 +4,6 @@ namespace icinga { -using std::exception; - class OutOfMemoryException : public exception { }; class Memory diff --git a/base/object.h b/base/object.h index f62e60815..ec60fcb22 100644 --- a/base/object.h +++ b/base/object.h @@ -4,12 +4,6 @@ namespace icinga { -using std::tr1::shared_ptr; -using std::tr1::weak_ptr; -using std::tr1::enable_shared_from_this; -using std::tr1::static_pointer_cast; -using std::tr1::function; - class Object : public enable_shared_from_this { private: diff --git a/base/socket.cpp b/base/socket.cpp index 210ab9840..ccee82c5c 100644 --- a/base/socket.cpp +++ b/base/socket.cpp @@ -1,10 +1,6 @@ -#include -#include #include "i2-base.h" using namespace icinga; -using std::bind2nd; -using std::equal_to; list Socket::Sockets; diff --git a/base/tcpsocket.cpp b/base/tcpsocket.cpp index 09a85a03b..632fdf417 100644 --- a/base/tcpsocket.cpp +++ b/base/tcpsocket.cpp @@ -27,5 +27,5 @@ void TCPSocket::Bind(const char *hostname, unsigned short port) sin.sin_family = AF_INET; sin.sin_addr.s_addr = hostname ? inet_addr(hostname) : htonl(INADDR_ANY); sin.sin_port = htons(port); - bind(GetFD(), (sockaddr *)&sin, sizeof(sin)); + ::bind(GetFD(), (sockaddr *)&sin, sizeof(sin)); } diff --git a/base/timer.cpp b/base/timer.cpp index 1bdb96521..26a7f8ce2 100644 --- a/base/timer.cpp +++ b/base/timer.cpp @@ -3,9 +3,6 @@ #include "i2-base.h" using namespace icinga; -using std::list; -using std::bind2nd; -using std::equal_to; time_t Timer::NextCall; list Timer::Timers; diff --git a/configfilecomponent/configfilecomponent.cpp b/configfilecomponent/configfilecomponent.cpp index b50eda4d9..c2eed5e7c 100644 --- a/configfilecomponent/configfilecomponent.cpp +++ b/configfilecomponent/configfilecomponent.cpp @@ -4,7 +4,6 @@ #include using namespace icinga; -using std::ifstream; string ConfigFileComponent::GetName(void) { diff --git a/configrpccomponent/configrpccomponent.cpp b/configrpccomponent/configrpccomponent.cpp index 266eda1a4..1dc68cca8 100644 --- a/configrpccomponent/configrpccomponent.cpp +++ b/configrpccomponent/configrpccomponent.cpp @@ -1,7 +1,6 @@ #include "i2-configrpccomponent.h" using namespace icinga; -using std::tr1::dynamic_pointer_cast; IcingaApplication::RefType ConfigRpcComponent::GetIcingaApplication(void) { diff --git a/icinga/icingaapplication.cpp b/icinga/icingaapplication.cpp index 948953382..b7144ca10 100644 --- a/icinga/icingaapplication.cpp +++ b/icinga/icingaapplication.cpp @@ -9,9 +9,6 @@ using namespace icinga; -using std::cout; -using std::endl; - IcingaApplication::IcingaApplication(void) { m_ConnectionManager = new_object(); diff --git a/jsonrpc/connectionmanager.h b/jsonrpc/connectionmanager.h index 934244492..bbc075c91 100644 --- a/jsonrpc/connectionmanager.h +++ b/jsonrpc/connectionmanager.h @@ -4,8 +4,6 @@ namespace icinga { -using std::map; - class ConnectionManager : public Object { list m_Servers; diff --git a/jsonrpc/netstring.cpp b/jsonrpc/netstring.cpp index 05e6227ce..ec7d8f787 100644 --- a/jsonrpc/netstring.cpp +++ b/jsonrpc/netstring.cpp @@ -2,7 +2,6 @@ #include "i2-jsonrpc.h" using namespace icinga; -using std::sprintf; /* based on https://github.com/PeterScott/netstring-c/blob/master/netstring.c */ cJSON *Netstring::ReadJSONFromFIFO(FIFO::RefType fifo)