Cleaned up includes; using namespace std is the default now.

This commit is contained in:
Gunnar Beutner 2012-04-02 09:03:29 +02:00
parent 191ded487b
commit 1b6bfb9db5
16 changed files with 10 additions and 43 deletions

View File

@ -1,14 +1,8 @@
#ifndef APPLICATION_H #ifndef APPLICATION_H
#define APPLICATION_H #define APPLICATION_H
#include <map>
namespace icinga { namespace icinga {
using std::vector;
using std::map;
using std::string;
class Component; class Component;
class Application : public Object { class Application : public Object {

View File

@ -1,13 +1,9 @@
#ifndef CONFIGHIVE_H #ifndef CONFIGHIVE_H
#define CONFIGHIVE_H #define CONFIGHIVE_H
#include <map>
namespace icinga namespace icinga
{ {
using std::map;
struct ConfigHiveEventArgs : public EventArgs struct ConfigHiveEventArgs : public EventArgs
{ {
typedef shared_ptr<ConfigHiveEventArgs> RefType; typedef shared_ptr<ConfigHiveEventArgs> RefType;

View File

@ -6,9 +6,6 @@
namespace icinga namespace icinga
{ {
using std::map;
using std::string;
class ConfigHive; class ConfigHive;
class ConfigObject : public Object class ConfigObject : public Object

View File

@ -6,9 +6,6 @@
namespace icinga namespace icinga
{ {
using std::tr1::function;
using namespace std::tr1::placeholders;
template<class TObject, class TArgs> template<class TObject, class TArgs>
int delegate_fwd(int (TObject::*function)(TArgs), weak_ptr<TObject> wref, const TArgs& args) int delegate_fwd(int (TObject::*function)(TArgs), weak_ptr<TObject> wref, const TArgs& args)
{ {

View File

@ -4,8 +4,6 @@
namespace icinga namespace icinga
{ {
using std::list;
struct EventArgs : public Object struct EventArgs : public Object
{ {
typedef shared_ptr<EventArgs> RefType; typedef shared_ptr<EventArgs> RefType;

View File

@ -14,14 +14,22 @@
#include <iostream> #include <iostream>
#include <list> #include <list>
#include <typeinfo> #include <typeinfo>
#include <map>
#include <list> #include <list>
using namespace std;
#ifdef _MSC_VER #ifdef _MSC_VER
# include <memory> # include <memory>
# include <functional> # include <functional>
using namespace std::placeholders;
#else #else
# include <tr1/memory> # include <tr1/memory>
# include <tr1/functional> # include <tr1/functional>
using namespace std::tr1;
using namespace std::tr1::placeholders;
#endif #endif
#define PLATFORM_WINDOWS 1 #define PLATFORM_WINDOWS 1

View File

@ -4,8 +4,6 @@
namespace icinga namespace icinga
{ {
using std::exception;
class OutOfMemoryException : public exception { }; class OutOfMemoryException : public exception { };
class Memory class Memory

View File

@ -4,12 +4,6 @@
namespace icinga 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<Object> class Object : public enable_shared_from_this<Object>
{ {
private: private:

View File

@ -1,10 +1,6 @@
#include <functional>
#include <algorithm>
#include "i2-base.h" #include "i2-base.h"
using namespace icinga; using namespace icinga;
using std::bind2nd;
using std::equal_to;
list<Socket::WeakRefType> Socket::Sockets; list<Socket::WeakRefType> Socket::Sockets;

View File

@ -27,5 +27,5 @@ void TCPSocket::Bind(const char *hostname, unsigned short port)
sin.sin_family = AF_INET; sin.sin_family = AF_INET;
sin.sin_addr.s_addr = hostname ? inet_addr(hostname) : htonl(INADDR_ANY); sin.sin_addr.s_addr = hostname ? inet_addr(hostname) : htonl(INADDR_ANY);
sin.sin_port = htons(port); sin.sin_port = htons(port);
bind(GetFD(), (sockaddr *)&sin, sizeof(sin)); ::bind(GetFD(), (sockaddr *)&sin, sizeof(sin));
} }

View File

@ -3,9 +3,6 @@
#include "i2-base.h" #include "i2-base.h"
using namespace icinga; using namespace icinga;
using std::list;
using std::bind2nd;
using std::equal_to;
time_t Timer::NextCall; time_t Timer::NextCall;
list<Timer::WeakRefType> Timer::Timers; list<Timer::WeakRefType> Timer::Timers;

View File

@ -4,7 +4,6 @@
#include <fstream> #include <fstream>
using namespace icinga; using namespace icinga;
using std::ifstream;
string ConfigFileComponent::GetName(void) string ConfigFileComponent::GetName(void)
{ {

View File

@ -1,7 +1,6 @@
#include "i2-configrpccomponent.h" #include "i2-configrpccomponent.h"
using namespace icinga; using namespace icinga;
using std::tr1::dynamic_pointer_cast;
IcingaApplication::RefType ConfigRpcComponent::GetIcingaApplication(void) IcingaApplication::RefType ConfigRpcComponent::GetIcingaApplication(void)
{ {

View File

@ -9,9 +9,6 @@
using namespace icinga; using namespace icinga;
using std::cout;
using std::endl;
IcingaApplication::IcingaApplication(void) IcingaApplication::IcingaApplication(void)
{ {
m_ConnectionManager = new_object<ConnectionManager>(); m_ConnectionManager = new_object<ConnectionManager>();

View File

@ -4,8 +4,6 @@
namespace icinga namespace icinga
{ {
using std::map;
class ConnectionManager : public Object class ConnectionManager : public Object
{ {
list<JsonRpcServer::RefType> m_Servers; list<JsonRpcServer::RefType> m_Servers;

View File

@ -2,7 +2,6 @@
#include "i2-jsonrpc.h" #include "i2-jsonrpc.h"
using namespace icinga; using namespace icinga;
using std::sprintf;
/* based on https://github.com/PeterScott/netstring-c/blob/master/netstring.c */ /* based on https://github.com/PeterScott/netstring-c/blob/master/netstring.c */
cJSON *Netstring::ReadJSONFromFIFO(FIFO::RefType fifo) cJSON *Netstring::ReadJSONFromFIFO(FIFO::RefType fifo)