User Class Reference

This class is used to represent a user on an IRC server. More...

#include <User.h>

List of all members.

Public Member Functions

virtual const char *const getNick () const throw (Exception &)
 Returns the nick of the user.
virtual const char *const getPrefix () const throw (Exception &)
 Returns the prefix of the user.
virtual bool hasVoice () const throw (Exception &)
 Returns whether or not the user represented by this object has voice.
virtual bool isOp () const throw (Exception &)
 Returns whether or not the user represented by this object is an operator.
void operator delete (void *p)
 All delete's will be handled through this dll.
void * operator new (unsigned int size)
 All new's will be handled through this dll.
bool operator< (const User &rhs) const
 Returns the result of calling the compareTo method on lowercased nicks.
Useroperator= (const User &rhs)
 Performs a deep copy of this object.
bool operator== (const User &rhs) const
 Returns true if the nick represented by this User object is the same as the nick of the User object given as an argument.
bool operator> (const User &rhs) const
 Returns the result of calling the compareTo method on lowercased nicks.
virtual const char *const toString () const throw (Exception &)
 Returns the nick of the user complete with their prefix if they have one, e.g.
 User (const User &user)
 The copy constructor.
 User (const char *const prefix, const char *const nick) throw (Exception &)
 Constructs a User object with a known prefix and nick.
 User () throw (Exception &)
 Constructs a User object with empty string for the prefix and the nick.
virtual ~User ()
 Default virtual destructor.

Private Attributes

UserImpl * m_pimpl
 The private implementation in which you cannot get access to.

Friends

class UserImpl


Detailed Description

This class is used to represent a user on an IRC server.

Instances of this class are returned by the getUsers method in the PircBot class.

Author:
Frank Hassanabad http://pircbotcpp.sourceforge.net/
Version:
1.4.4.1


Constructor & Destructor Documentation

User  )  throw (Exception &)
 

Constructs a User object with empty string for the prefix and the nick.

User const char *const   prefix,
const char *const   nick
throw (Exception &)
 

Constructs a User object with a known prefix and nick.

Parameters:
prefix The status of the user, for example, "@".
nick The nick of the user.

User const User user  ) 
 

The copy constructor.

Performs a deep copy of the object.

Parameters:
user The standard second reference

virtual ~User  )  [virtual]
 

Default virtual destructor.

It will delete the private implementation (pimpl)


Member Function Documentation

virtual const char* const getNick  )  const throw (Exception &) [virtual]
 

Returns the nick of the user.

Returns:
The user's nick.

virtual const char* const getPrefix  )  const throw (Exception &) [virtual]
 

Returns the prefix of the user.

If the User object has been obtained from a list of users in a channel, then this will reflect the user's status in that channel.

Returns:
The prefix of the user. If there is no prefix, then an empty string is returned.

virtual bool hasVoice  )  const throw (Exception &) [virtual]
 

Returns whether or not the user represented by this object has voice.

If the User object has been obtained from a list of users in a channel, then this will reflect the user's voice status in that channel.

Returns:
true if the user has voice in the channel.

virtual bool isOp  )  const throw (Exception &) [virtual]
 

Returns whether or not the user represented by this object is an operator.

If the User object has been obtained from a list of users in a channel, then this will reflect the user's operator status in that channel.

Returns:
true if the user is an operator in the channel.

void operator delete void *  p  ) 
 

All delete's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "new operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
p The pointer to an instance of this object.

void* operator new unsigned int  size  ) 
 

All new's will be handled through this dll.

This is required for dll boundary safety. Instead of allowing the compiler to choose if it wants to inline this we have made it so that it cannot. If we let the compiler choose to inline or not inline this and the "delete operator" we can run into dll boundary issues. The issue would be that the compiler would inline one and not the other. Thus, your executable with its own heap would allocate/delete and this dll would do the other. That's a dll boundary safety violation.

Parameters:
size The size to allocate an instance of this object with.
Returns:
An instance of this object

bool operator< const User rhs  )  const
 

Returns the result of calling the compareTo method on lowercased nicks.

This is useful for sorting lists of User objects.

Parameters:
rhs The right hand side reference
Returns:
the result of calling compareTo on lowercased nicks.

User& operator= const User rhs  ) 
 

Performs a deep copy of this object.

Parameters:
rhs The right hand side reference

bool operator== const User rhs  )  const
 

Returns true if the nick represented by this User object is the same as the nick of the User object given as an argument.

A case insensitive comparison is made.

Parameters:
rhs The right hand side reference
Returns:
true if rhs is a User object with a matching lowercase nick.

bool operator> const User rhs  )  const
 

Returns the result of calling the compareTo method on lowercased nicks.

This is useful for sorting lists of User objects.

Parameters:
rhs The right hand side reference
Returns:
the result of calling compareTo on lowercased nicks.

virtual const char* const toString  )  const throw (Exception &) [virtual]
 

Returns the nick of the user complete with their prefix if they have one, e.g.

"@Dave".

C++ note. I cannot overload the "<<" without having to pull in C++ libraries. And once I pull in an std, then there's no guarantee of dll boundary safety.

Returns:
The user's prefix and nick.


Member Data Documentation

UserImpl* m_pimpl [private]
 

The private implementation in which you cannot get access to.

This shared_ptr holds the private methods and private member variables of this class. This makes ABI (Application Binary Interface) more resilient to change. See the private implementation idiom on the internet for more information about this.


The documentation for this class was generated from the following file:
Generated on Sun Sep 3 16:43:10 2006 for pircbotcpp by  doxygen 1.4.5