Core/Dependencies: Remove ACE_Singleton dependency from the Log and DelayExecutor classes.

Removed an unused function.
This commit is contained in:
Subv committed 2014-06-22 14:07:23 -05:00
1 parent 11d545f01d
commit f9a08ac1c9
4 files changed
+9 -17

No files matched your search

+7 -4
View File
@@ -26,14 +26,11 @@
#include <unordered_map>
#include <string>
#include <ace/Singleton.h>
#define LOGGER_ROOT "root"
class Log
{
friend class ACE_Singleton<Log, ACE_Thread_Mutex>;
typedef std::unordered_map<std::string, Logger> LoggerMap;
typedef std::unordered_map<std::string, Logger const*> CachedLoggerContainer;
@@ -42,6 +39,12 @@ class Log
~Log();
public:
static Log* instance()
{
static Log* instance = new Log();
return instance;
}
void LoadFromConfig();
void Close();
bool ShouldLog(std::string const& type, LogLevel level);
@@ -127,7 +130,7 @@ inline void Log::outMessage(std::string const& filter, LogLevel level, const cha
va_end(ap);
}
#define sLog ACE_Singleton<Log, ACE_Thread_Mutex>::instance()
#define sLog Log::instance()
#if PLATFORM != PLATFORM_WINDOWS
#define TC_LOG_MESSAGE_BODY(filterType__, level__, ...) \
@@ -6,7 +6,8 @@
DelayExecutor* DelayExecutor::instance()
{
return ACE_Singleton<DelayExecutor, ACE_Thread_Mutex>::instance();
static DelayExecutor* instance = new DelayExecutor();
return instance;
}
DelayExecutor::DelayExecutor()
-8
View File
@@ -259,14 +259,6 @@ bool IsIPAddress(char const* ipaddress)
return inet_addr(ipaddress) != INADDR_NONE;
}
bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask)
{
uint32 mask = subnetMask.get_ip_address();
if ((net.get_ip_address() & mask) == (addr.get_ip_address() & mask))
return true;
return false;
}
/// create PID file
uint32 CreatePIDFile(const std::string& filename)
{
-4
View File
@@ -26,7 +26,6 @@
#include <string>
#include <vector>
#include <list>
#include <ace/INET_Addr.h>
// Searcher for map of structs
template<typename T, class S> struct Finder
@@ -348,9 +347,6 @@ void vutf8printf(FILE* out, const char *str, va_list* ap);
bool IsIPAddress(char const* ipaddress);
/// Checks if address belongs to the a network with specified submask
bool IsIPAddrInNetwork(ACE_INET_Addr const& net, ACE_INET_Addr const& addr, ACE_INET_Addr const& subnetMask);
uint32 CreatePIDFile(const std::string& filename);
std::string ByteArrayToHexStr(uint8 const* bytes, uint32 length, bool reverse = false);