ircproxy  The Ultimate Cyborg

Flags Class Reference

#include <Flags.h>

List of all members.


Detailed Description

A class to store the relevant part of the flags field from a WHO reply.

Definition at line 26 of file Flags.h.


Public Member Functions

 Flags (void)
 Construct an uninitialized Flags object.
 Flags (Network const &network, std::string const &who_flags)
 Construct an initialized Flags object for network network and string who_flags.
 Flags (Flags const &flags)
 Copy constructor.
Flagsoperator= (Flags const &flags)
 Assignment operator.
void assign (Network const &network, std::string const &who_flags)
 (Re)initialize this object for network network and string who_flags.
Flagsoperator= (std::string const &who_flags)
 Reassign who_flags to this object without changing the network.
bool is_initialized (void) const
 Returns true if this object is initialized.

Private Attributes

unsigned int M_flags
 A mask for the user mode flags.
Network const * M_network
 A pointer to the corresponding network, or NULL when this object is not initialized.

Constructor & Destructor Documentation

Flags::Flags ( void   )  [inline]

Construct an uninitialized Flags object.

Definition at line 33 of file Flags.h.

00033 : M_network(NULL) { }

Flags::Flags ( Network const &  network,
std::string const &  who_flags 
) [inline]

Construct an initialized Flags object for network network and string who_flags.

Definition at line 35 of file Flags.h.

References assign().

00035 { assign(network, who_flags); }

Flags::Flags ( Flags const &  flags  )  [inline]

Copy constructor.

Definition at line 37 of file Flags.h.

00037 : M_flags(flags.M_flags), M_network(flags.M_network) { }


Member Function Documentation

Flags& Flags::operator= ( Flags const &  flags  )  [inline]

Assignment operator.

Definition at line 39 of file Flags.h.

References M_flags, and M_network.

00039 { M_flags = flags.M_flags; M_network = flags.M_network; return *this; }

void Flags::assign ( Network const &  network,
std::string const &  who_flags 
)

(Re)initialize this object for network network and string who_flags.

Definition at line 79 of file Flags.cc.

References Network::char_to_flag(), M_flags, and M_network.

Referenced by Flags(), and operator=().

00080 {
00081   M_flags = 0;
00082   M_network = &network;
00083   for (std::string::const_iterator iter = who_flags.begin(); iter != who_flags.end(); ++iter)
00084     M_flags |= network.char_to_flag(*iter);
00085 }

Flags& Flags::operator= ( std::string const &  who_flags  )  [inline]

Reassign who_flags to this object without changing the network.

Definition at line 45 of file Flags.h.

References ASSERT, assign(), is_initialized(), and M_network.

00045 { ASSERT(is_initialized()); assign(*M_network, who_flags); return *this; }

bool Flags::is_initialized ( void   )  const [inline]

Returns true if this object is initialized.

Definition at line 48 of file Flags.h.

References M_network.

Referenced by operator=().

00048 { return M_network; }


Member Data Documentation

unsigned int Flags::M_flags [private]

A mask for the user mode flags.

Definition at line 28 of file Flags.h.

Referenced by assign(), and operator=().

Network const* Flags::M_network [private]

A pointer to the corresponding network, or NULL when this object is not initialized.

Definition at line 29 of file Flags.h.

Referenced by assign(), is_initialized(), and operator=().


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

Copyright © 2005-2007 Carlo Wood.  All rights reserved.