adchpp Namespace Reference

Classes

class  AdcCommand
class  AsyncStream
class  Bot
struct  BotRemover
class  Buffer
 Reference-counted buffer. More...
class  CID
class  Client
 The client represents one connection to a user. More...
class  ClientManager
 The ClientManager takes care of all protocol details, clients and so on. More...
class  CommandHandler
class  CompareFirst
 Evaluates op(pair<T1, T2>.first, compareTo). More...
class  CompareSecond
 Evaluates op(pair<T1, T2>.second, compareTo). More...
struct  Connection
struct  DeleteFunction
struct  Disconnector
class  Encoder
class  Entity
class  Exception
struct  FastAlloc
class  File
class  Flags
class  Hub
class  LogManager
 Log writing utilities. More...
struct  ManagedConnection
class  ManagedSocket
 An asynchronous socket managed by SocketManager. More...
class  Plugin
 Public plugin interface, for plugin intercom. More...
class  PluginData
class  PluginManager
class  Pool
 A thread safe object pool. More...
struct  PoolDummy
class  ScopedLock
class  Semaphore
struct  ServerInfo
class  Signal
struct  SignalTraits
class  SimplePool
class  SimpleXML
 A simple XML class that loads an XML-ish structure into an internal tree and allows easy access to each element through a "current location". More...
class  Singleton
class  SocketFactory
class  SocketManager
class  SocketStream
struct  Stats
class  Text
 Text handling routines for ADCH++. More...
class  Thread
class  TigerHash
class  TimerManager
class  Util

Typedefs

typedef shared_ptr< AsyncStreamAsyncStreamPtr
typedef std::vector< BufferPtrBufferList
typedef shared_ptr< BufferBufferPtr
typedef ByteVector::iterator ByteIter
typedef std::vector< uint8_t > ByteVector
typedef std::unique_ptr
< Connection
ConnectionPtr
typedef std::map< uint16_t,
std::string > 
FieldMap
 Named parameter map (INF etc), AdcCommand::toField offers conversion.
typedef shared_ptr
< ManagedConnection
ManagedConnectionPtr
typedef shared_ptr< ManagedSocketManagedSocketPtr
typedef int(* PLUGIN_GET_VERSION )()
 PLUGIN_API double pluginGetVersion() This function should just return the constant PLUGINVERSIONFLOAT so that the pluginmanager can determine if this plugin should be loaded or not.
typedef int(* PLUGIN_LOAD )()
 PLUGIN_API void pluginLoad() This function is called when the hub is starting up and loading the plugin.
typedef void * plugin_t
typedef void(* PLUGIN_UNLOAD )()
 PLUGIN_API void pluginUnload() Called when the hub is shutting down.
typedef std::function< void(void *) PluginDataDeleter )
typedef shared_ptr< PluginDataPluginDataHandle
typedef std::vector
< ServerInfoPtr
ServerInfoList
typedef shared_ptr< ServerInfoServerInfoPtr
typedef SocketStream
< ip::tcp::socket > 
SimpleSocketStream
typedef shared_ptr< SocketFactorySocketFactoryPtr
typedef StringList::iterator StringIter
typedef StringList::const_iterator StringIterC
typedef std::vector< std::string > StringList

Functions

void cleanup ()
 Release any resources held by adchpp.
template<typename T1 >
int compare (const T1 &v1, const T1 &v2)
 Compares two values.
void debugTrace (const char *format,...)
void initialize (const std::string &path)
 Initialize configuration.
void logAssert (const char *file, int line, const char *exp)
template<typename F1 , typename F2 >
ManagedConnectionPtr manage (Signal< F1 > *signal, const F2 &f)
static void sgenrand (unsigned long seed)
void shutdown (void(*f)())
 Stop listening for incoming connections.
 STANDARD_EXCEPTION (ThreadException)
 STANDARD_EXCEPTION (SimpleXMLException)
 STANDARD_EXCEPTION (FileException)
 STANDARD_EXCEPTION (ParseException)
void startup (void(*f)())
 Load plugins and start listening for incoming connections.
static size_t sum (const BufferList &l)

Variables

string appName = APPNAME
const char compileTime [] = __DATE__ " " __TIME__
static bool initialized = false
static unsigned long mt [N]
static int mti = N+1
static bool running = false
static const int SOCKET_BUFFER_SIZE = 1024
float versionFloat = VERSIONFLOAT
string versionString = FULLVERSIONSTRING

Typedef Documentation

typedef shared_ptr<AsyncStream> adchpp::AsyncStreamPtr

Definition at line 35 of file AsyncStream.h.

typedef std::vector<BufferPtr> adchpp::BufferList

Definition at line 73 of file Buffer.h.

typedef shared_ptr<Buffer> adchpp::BufferPtr

Definition at line 72 of file Buffer.h.

typedef ByteVector::iterator adchpp::ByteIter

Definition at line 95 of file common.h.

typedef std::vector<uint8_t> adchpp::ByteVector

Definition at line 94 of file common.h.

typedef std::unique_ptr<Connection> adchpp::ConnectionPtr

Definition at line 32 of file Signal.h.

typedef std::map<uint16_t, std::string> adchpp::FieldMap

Named parameter map (INF etc), AdcCommand::toField offers conversion.

Definition at line 26 of file forward.h.

Definition at line 104 of file Signal.h.

Definition at line 31 of file forward.h.

typedef int(* adchpp::PLUGIN_GET_VERSION)()

PLUGIN_API double pluginGetVersion() This function should just return the constant PLUGINVERSIONFLOAT so that the pluginmanager can determine if this plugin should be loaded or not.

Definition at line 100 of file PluginManager.h.

typedef int(* adchpp::PLUGIN_LOAD)()

PLUGIN_API void pluginLoad() This function is called when the hub is starting up and loading the plugin.

Here you should load any data your plugin might need and connect to any Managers you might be interested in. Note; you also have to connect to PluginManager itself to receive its events.

Returns:
0 if the plugin was loaded ok, != 0 otherwise (the number will be logged, use as error code). Plugin dll will get unloaded without calling pluginUnload if the return value is not 0 here.
See also:
pluginUnload

Definition at line 113 of file PluginManager.h.

typedef void* adchpp::plugin_t

Definition at line 90 of file PluginManager.h.

typedef void(* adchpp::PLUGIN_UNLOAD)()

PLUGIN_API void pluginUnload() Called when the hub is shutting down.

See also:
pluginLoad

Definition at line 120 of file PluginManager.h.

typedef std::function<void (void*) adchpp::PluginDataDeleter)

Definition at line 39 of file Plugin.h.

typedef shared_ptr<PluginData> adchpp::PluginDataHandle

Definition at line 56 of file Plugin.h.

typedef std::vector<ServerInfoPtr> adchpp::ServerInfoList

Definition at line 38 of file forward.h.

typedef shared_ptr<ServerInfo> adchpp::ServerInfoPtr

Definition at line 36 of file forward.h.

typedef SocketStream<ip::tcp::socket> adchpp::SimpleSocketStream

Definition at line 111 of file SocketManager.cpp.

Definition at line 42 of file forward.h.

typedef StringList::iterator adchpp::StringIter

Definition at line 91 of file common.h.

typedef StringList::const_iterator adchpp::StringIterC

Definition at line 92 of file common.h.

typedef std::vector<std::string> adchpp::StringList

Definition at line 90 of file common.h.


Function Documentation

ADCHPP_DLL void adchpp::cleanup (  ) 

Release any resources held by adchpp.

Before using any library routines again, you must call initalialize.

template<typename T1 >
int adchpp::compare ( const T1 &  v1,
const T1 &  v2 
) [inline]

Compares two values.

Returns:
-1 if v1 < v2, 0 if v1 == v2 and 1 if v1 > v2

Definition at line 58 of file Util.h.

void adchpp::debugTrace ( const char *  format,
  ... 
) [inline]

Definition at line 47 of file common.h.

ADCHPP_DLL void adchpp::initialize ( const string &  configPath  ) 

Initialize configuration.

ADCHPP_DLL void adchpp::logAssert ( const char *  file,
int  line,
const char *  exp 
)
template<typename F1 , typename F2 >
ManagedConnectionPtr adchpp::manage ( Signal< F1 > *  signal,
const F2 &  f 
) [inline]

Definition at line 107 of file Signal.h.

References adchpp::Signal< F >::connect().

Here is the call graph for this function:

static void adchpp::sgenrand ( unsigned long  seed  )  [static]

Definition at line 362 of file Util.cpp.

References mt, mti, and N.

Referenced by adchpp::Util::initialize(), and adchpp::Util::rand().

Here is the caller graph for this function:

ADCHPP_DLL void adchpp::shutdown ( void(*)()  f  ) 

Stop listening for incoming connections.

adchpp::STANDARD_EXCEPTION ( ThreadException   ) 
adchpp::STANDARD_EXCEPTION ( SimpleXMLException   ) 
adchpp::STANDARD_EXCEPTION ( FileException   ) 
adchpp::STANDARD_EXCEPTION ( ParseException   ) 
ADCHPP_DLL void adchpp::startup ( void(*)()  f  ) 

Load plugins and start listening for incoming connections.

static size_t adchpp::sum ( const BufferList &  l  )  [static]

Definition at line 39 of file ManagedSocket.cpp.

Referenced by adchpp::ManagedSocket::getQueuedBytes().

Here is the caller graph for this function:


Variable Documentation

ADCHPP_DLL std::string adchpp::appName = APPNAME

Definition at line 46 of file version.cpp.

ADCHPP_DLL const char adchpp::compileTime = __DATE__ " " __TIME__

Definition at line 30 of file common.cpp.

bool adchpp::initialized = false [static]

Definition at line 32 of file common.cpp.

unsigned long adchpp::mt[N] [static]

Definition at line 358 of file Util.cpp.

Referenced by adchpp::Util::rand(), and sgenrand().

int adchpp::mti = N+1 [static]

Definition at line 359 of file Util.cpp.

Referenced by adchpp::Util::rand(), and sgenrand().

bool adchpp::running = false [static]

Definition at line 33 of file common.cpp.

const int adchpp::SOCKET_BUFFER_SIZE = 1024 [static]

Definition at line 119 of file SocketManager.cpp.

Referenced by adchpp::SocketFactory::handleAccept().

ADCHPP_DLL float adchpp::versionFloat = VERSIONFLOAT

Definition at line 48 of file version.cpp.

ADCHPP_DLL std::string adchpp::versionString = FULLVERSIONSTRING

Definition at line 47 of file version.cpp.

Referenced by adchpp::Hub::Hub().

Generated on Sat Nov 27 23:38:20 2010 for adchpp by  doxygen 1.6.3