git.stg.codes
/
stg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add subscriptions (to replace notifiers).
[stg.git]
/
projects
/
stargazer
/
plugins
/
configuration
/
sgconfig
/
conn.h
diff --git
a/projects/stargazer/plugins/configuration/sgconfig/conn.h
b/projects/stargazer/plugins/configuration/sgconfig/conn.h
index c67c972eb98df40b9f359bab4852f1348fef28a1..a98e593bb6263bfeaca69c8352f384364fe6b0f4 100644
(file)
--- a/
projects/stargazer/plugins/configuration/sgconfig/conn.h
+++ b/
projects/stargazer/plugins/configuration/sgconfig/conn.h
@@
-18,34
+18,32
@@
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
* Author : Maxim Mamontov <faust@stargazer.dp.ua>
*/
-#ifndef __STG_SGCONFIG_CONN_H__
-#define __STG_SGCONFIG_CONN_H__
+#pragma once
#include "parser.h"
#include "dumphelpers.h"
#include "parser.h"
#include "dumphelpers.h"
-#include "stg/os_int.h"
#include "stg/const.h"
#include <stdexcept>
#include <string>
#include "stg/const.h"
#include <stdexcept>
#include <string>
+#include <cstdint>
#include <expat.h>
#include <netinet/in.h>
#include <expat.h>
#include <netinet/in.h>
-class SETTINGS;
-class ADMINS;
-class USERS;
-class TARIFFS;
-class ADMIN;
-class BASE_PARSER;
-class PLUGIN_LOGGER;
-
namespace STG
{
namespace STG
{
+struct Settings;
+struct Admins;
+struct Users;
+struct Tariffs;
+struct Admin;
+class PluginLogger;
+
class DECRYPT_STREAM;
class Conn
class DECRYPT_STREAM;
class Conn
@@
-53,19
+51,19
@@
class Conn
public:
struct Error : public std::runtime_error
{
public:
struct Error : public std::runtime_error
{
- Error(const std::string& message) : runtime_error(message.c_str()) {}
+
explicit
Error(const std::string& message) : runtime_error(message.c_str()) {}
};
Conn(const BASE_PARSER::REGISTRY & registry,
};
Conn(const BASE_PARSER::REGISTRY & registry,
- A
DMINS
& admins, int sock, const sockaddr_in& addr,
- P
LUGIN_LOGGER
& logger);
+ A
dmins
& admins, int sock, const sockaddr_in& addr,
+ P
luginLogger
& logger);
~Conn();
int Sock() const { return m_sock; }
~Conn();
int Sock() const { return m_sock; }
- uint32_t IP() const { return *
(uint32_t *)
(&m_addr.sin_addr); }
+ uint32_t IP() const { return *
reinterpret_cast<const uint32_t *>
(&m_addr.sin_addr); }
uint16_t Port() const { return ntohs(m_addr.sin_port); }
uint16_t Port() const { return ntohs(m_addr.sin_port); }
- std::string endpoint() const { return inet_ntostring(IP()) + ":" +
x2str
(Port()); }
+ std::string endpoint() const { return inet_ntostring(IP()) + ":" +
std::to_string
(Port()); }
bool Read();
bool Read();
@@
-87,9
+85,9
@@
class Conn
const BASE_PARSER::REGISTRY & m_registry;
const BASE_PARSER::REGISTRY & m_registry;
- A
DMINS
& m_admins;
+ A
dmins
& m_admins;
- A
DMIN
* m_admin;
+ A
dmin
* m_admin;
int m_sock;
sockaddr_in m_addr;
int m_sock;
sockaddr_in m_addr;
@@
-108,7
+106,7
@@
class Conn
char m_cryptoLogin[ADM_LOGIN_LEN]; // Without \0
char m_data[1024];
STG::DECRYPT_STREAM * m_stream;
char m_cryptoLogin[ADM_LOGIN_LEN]; // Without \0
char m_data[1024];
STG::DECRYPT_STREAM * m_stream;
- P
LUGIN_LOGGER
& m_logger;
+ P
luginLogger
& m_logger;
BASE_PARSER * GetParser(const std::string & tag) const;
BASE_PARSER * GetParser(const std::string & tag) const;
@@
-142,5
+140,3
@@
class Conn
};
}
};
}
-
-#endif