Orxonox  0.0.5 Codename: Arcturus
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
orxonox::IRC Class Reference

The IRC class creates a Tcl-thread (see TclThreadManager) and connects to an IRC server. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/command/IRC.h>

Static Public Member Functions

static IRCgetInstance ()
 Returns the only existing instance of IRC. More...
 
static void msg (const std::string &channel, const std::string &message)
 Console command: Sends a message to a given channel or nickname on the IRC server. More...
 
static void nick (const std::string &nickname)
 Console command: Changes the nickname on the IRC server. More...
 
static void say (const std::string &message)
 Console command: Sends a message to the current channel on the IRC server. More...
 
static void tcl_action (Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
 Tcl-callback: Prints an action-message (usually /me ...) that was received from the current IRC channel to the console. More...
 
static void tcl_info (Tcl::object const &channel, Tcl::object const &args)
 Tcl-callback: Prints all kinds of information that were received from the IRC server or channel (connection info, join, part, modes, ...) to the console. More...
 
static void tcl_privmsg (Tcl::object const &query, Tcl::object const &nick, Tcl::object const &args)
 Tcl-callback: Prints a private message that was received from a user to the console. More...
 
static void tcl_say (Tcl::object const &channel, Tcl::object const &nick, Tcl::object const &args)
 Tcl-callback: Prints a message that was received from the current IRC channel to the console. More...
 

Private Member Functions

 IRC ()
 Constructor: Doesn't yet connect to IRC nor does it create a Tcl interpreter. More...
 
 IRC (const IRC &)=delete
 
 ~IRC ()=default
 
void initialize ()
 Creates and initializes a new multithreaded Tcl-interpreter and defines some callbacks to display IRC-messages in the console. More...
 
IRCoperator= (const IRC &)=delete
 

Static Private Member Functions

static bool eval (const std::string &command)
 Executes a Tcl-command on the Tcl-interpreter. More...
 

Private Attributes

Tcl::interpreter * interpreter_
 The Tcl interpreter that is used for the IRC connection. More...
 
std::string nickname_
 The user's nickname on the IRC server. More...
 

Detailed Description

The IRC class creates a Tcl-thread (see TclThreadManager) and connects to an IRC server.

It provides different console commands to send messages and to perform other actions on the IRC server.

Constructor & Destructor Documentation

orxonox::IRC::IRC ( )
private

Constructor: Doesn't yet connect to IRC nor does it create a Tcl interpreter.

The IRC object will automatically connect to the IRC server if one of the registered console commands is used the first time.

orxonox::IRC::~IRC ( )
privatedefault
orxonox::IRC::IRC ( const IRC )
privatedelete

Member Function Documentation

bool orxonox::IRC::eval ( const std::string &  command)
staticprivate

Executes a Tcl-command on the Tcl-interpreter.

IRC & orxonox::IRC::getInstance ( )
static

Returns the only existing instance of IRC.

void orxonox::IRC::initialize ( )
private

Creates and initializes a new multithreaded Tcl-interpreter and defines some callbacks to display IRC-messages in the console.

void orxonox::IRC::msg ( const std::string &  channel,
const std::string &  message 
)
static

Console command: Sends a message to a given channel or nickname on the IRC server.

void orxonox::IRC::nick ( const std::string &  nickname)
static

Console command: Changes the nickname on the IRC server.

IRC& orxonox::IRC::operator= ( const IRC )
privatedelete
void orxonox::IRC::say ( const std::string &  message)
static

Console command: Sends a message to the current channel on the IRC server.

void orxonox::IRC::tcl_action ( Tcl::object const &  channel,
Tcl::object const &  nick,
Tcl::object const &  args 
)
static

Tcl-callback: Prints an action-message (usually /me ...) that was received from the current IRC channel to the console.

void orxonox::IRC::tcl_info ( Tcl::object const &  channel,
Tcl::object const &  args 
)
static

Tcl-callback: Prints all kinds of information that were received from the IRC server or channel (connection info, join, part, modes, ...) to the console.

void orxonox::IRC::tcl_privmsg ( Tcl::object const &  query,
Tcl::object const &  nick,
Tcl::object const &  args 
)
static

Tcl-callback: Prints a private message that was received from a user to the console.

void orxonox::IRC::tcl_say ( Tcl::object const &  channel,
Tcl::object const &  nick,
Tcl::object const &  args 
)
static

Tcl-callback: Prints a message that was received from the current IRC channel to the console.

Member Data Documentation

Tcl::interpreter* orxonox::IRC::interpreter_
private

The Tcl interpreter that is used for the IRC connection.

std::string orxonox::IRC::nickname_
private

The user's nickname on the IRC server.


The documentation for this class was generated from the following files: