1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 19:56:39 +02:00
Files
anope/include/uplink.h
T
Adam d33a0f75a5 Pretty large coding style cleanup, in source doc
cleanup, and allow protocol mods to depend on each
other
2012-11-22 00:50:33 -05:00

58 lines
1.1 KiB
C++

/*
*
* (C) 2003-2012 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*
*/
#ifndef UPLINK_H
#define UPLINK_H
#include "sockets.h"
namespace Uplink
{
extern void Connect();
}
/* This is the socket to our uplink */
class UplinkSocket : public ConnectionSocket, public BufferedSocket
{
public:
UplinkSocket();
~UplinkSocket();
bool Read(const Anope::string &);
void OnConnect();
void OnError(const Anope::string &);
/* A message sent over the uplink socket */
class CoreExport Message
{
private:
/* The source of the message, can be a server (Me), or any user (one of our bots) */
const Server *server;
const User *user;
std::stringstream buffer;
public:
Message();
explicit Message(const Server *);
explicit Message(const User *);
~Message();
template<typename T> Message &operator<<(const T &val)
{
this->buffer << val;
return *this;
}
};
};
extern CoreExport UplinkSocket *UplinkSock;
#endif // UPLINK_H