Google
Web alhem.net
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

NukeHandler Class Reference

#include <NukeHandler.h>

List of all members.

Public Member Functions

 NukeHandler ()
 ~NukeHandler ()
void ViewSockets ()
Database * GetDatabase ()
void InitDB ()

Private Attributes

Database * m_db


Constructor & Destructor Documentation

NukeHandler::NukeHandler  ) 
 

Definition at line 35 of file NukeHandler.cpp.

References InitDB().

00036 :SocketHandler() 00037 ,m_db(NULL) 00038 { 00039 InitDB(); 00040 }

NukeHandler::~NukeHandler  ) 
 

Definition at line 43 of file NukeHandler.cpp.

00044 { 00045 }


Member Function Documentation

Database* NukeHandler::GetDatabase  )  [inline]
 

Definition at line 41 of file NukeHandler.h.

References m_db.

00041 { return m_db; }

void NukeHandler::InitDB  ) 
 

Definition at line 67 of file NukeHandler.cpp.

References m_db.

Referenced by NukeHandler().

00068 { 00069 FILE *fil = fopen("nuke.db","rb"); 00070 bool exists = false; 00071 if (fil) 00072 { 00073 exists = true; 00074 fclose(fil); 00075 } 00076 m_db = new Database("nuke.db"); 00077 if (!exists) 00078 { 00079 Query q(m_db); 00080 q.execute("create table sender (" 00081 "num integer primary key," 00082 "email string," 00083 "status string," 00084 "forward string" 00085 ")"); 00086 q.execute("create table recipient (" 00087 "num integer primary key," 00088 "email string," 00089 "status string," 00090 "forward string" 00091 ")"); 00092 q.execute("create table mailinst (" 00093 "id integer primary key," 00094 "host string," 00095 "mail string," 00096 "rcpt string," 00097 "h_from string," 00098 "h_to string," 00099 "h_subject string," 00100 "host_spam string," 00101 "mail_spam string," 00102 "from_spam string," 00103 "subject_spam string" 00104 ")"); 00105 } 00106 }

void NukeHandler::ViewSockets  ) 
 

Definition at line 48 of file NukeHandler.cpp.

Referenced by run().

00049 { 00050 for (socket_m::iterator it = m_sockets.begin(); it != m_sockets.end(); it++) 00051 { 00052 SOCKET s = (*it).first; 00053 Socket *p = (*it).second; 00054 if (dynamic_cast<SMTPSocket *>(p)) 00055 { 00056 printf("%4d: SMTPSocket\n",s); 00057 } 00058 else 00059 if (dynamic_cast<FwdSocket *>(p)) 00060 { 00061 printf("%4d: FwdSocket\n",s); 00062 } 00063 } 00064 }


Member Data Documentation

Database* NukeHandler::m_db [private]
 

Definition at line 45 of file NukeHandler.h.

Referenced by GetDatabase(), and InitDB().


The documentation for this class was generated from the following files:
Generated for C++ Sockets library example: SMTP Proxy by doxygen 1.3.6

www.TV-friendship.com
The matchmaking service with an all new twist.

Quantum 'Teleportation'
Some thoughts
Page, code, and content Copyright (C) 2004 by Anders Hedström