Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members

Dv::Ticket::User Class Reference

A User class for use by Dv::Ticket::Ticket. More...

#include <user.h>

List of all members.

Public Member Functions

int id () const
const std::string & name () const
const std::string & category () const
const std::string & info () const
bool operator== (const User &user) const
bool operator< (const User &user) const
 Comparison, first on category, then on id.

Dv::Xml::Node xml (const std::string &name="user") const
 Create XML representation of user.

 User (const std::string &category="anonymous", int id=0, const std::string &name="anonymous", const std::string &info="")
 Constructor.

 User (Dv::Xml::Node::Ref xml_user) throw (Dv::Ticket::Exception)
 Constructor.


Private Attributes

int id_
 Id of user, should be unique within the same category.

std::string category_
 Category of user.

std::string name_
 User name (e.g.

std::string info_
 Extra info.


Friends

class Dv::Ticket::Request
class Dv::Ticket::Authenticator
class Dv::Ticket::Ticket


Detailed Description

A User class for use by Dv::Ticket::Ticket.

A user is identified by a numeric id, and a category. A user also has a name and an uninterpreted info string.

The ticket database stores all components of the user-owner of the ticket.

See also:
Dv::Ticket::Ticket

Definition at line 26 of file user.h.


Constructor & Destructor Documentation

Dv::Ticket::User::User const std::string &  category = "anonymous",
int  id = 0,
const std::string &  name = "anonymous",
const std::string &  info = ""
[inline]
 

Constructor.

Parameters:
category of user.
id of user.
name of user.
info uninterpreted extra info

Definition at line 72 of file user.h.

References category_, id_, info_, and name_.

Dv::Ticket::User::User Dv::Xml::Node::Ref  xml_user  )  throw (Dv::Ticket::Exception)
 

Constructor.

Parameters:
xml_user XML representation of User
Exceptions:
Dv::Ticket::Exception if anything goes wrong
See also:
Dv::Ticket::User::xml


Member Function Documentation

int Dv::Ticket::User::id  )  const [inline]
 

Returns:
id of this user.

Definition at line 32 of file user.h.

References id_.

Referenced by operator==().

const std::string& Dv::Ticket::User::name  )  const [inline]
 

Returns:
name of this user.

Definition at line 34 of file user.h.

References name_.

const std::string& Dv::Ticket::User::category  )  const [inline]
 

Returns:
category of this user.

Definition at line 36 of file user.h.

References category_.

Referenced by operator==().

const std::string& Dv::Ticket::User::info  )  const [inline]
 

Returns:
extra info on this user.

Definition at line 38 of file user.h.

References info_.

bool Dv::Ticket::User::operator== const User user  )  const [inline]
 

Returns:
true iff users have same id and category
Parameters:
user to compare this user with
Warning:
name is not taken into account!

Definition at line 44 of file user.h.

References category(), and id().

bool Dv::Ticket::User::operator< const User user  )  const
 

Comparison, first on category, then on id.

Returns:
true iff this user is smaller than user
Warning:
name is not taken into account!

Dv::Xml::Node Dv::Ticket::User::xml const std::string &  name = "user"  )  const
 

Create XML representation of user.

Returns:
xml::node representing user
 <user>
  <id>123</id>
  <category>student</category>
  <name>fred</name>
  <info>Jan Janssens</info>
 </user>


Friends And Related Function Documentation

friend class Dv::Ticket::Request [friend]
 

Definition at line 27 of file user.h.

friend class Dv::Ticket::Authenticator [friend]
 

Definition at line 28 of file user.h.

friend class Dv::Ticket::Ticket [friend]
 

Definition at line 29 of file user.h.


Member Data Documentation

int Dv::Ticket::User::id_ [private]
 

Id of user, should be unique within the same category.

Definition at line 85 of file user.h.

Referenced by id(), and User().

std::string Dv::Ticket::User::category_ [private]
 

Category of user.

Definition at line 87 of file user.h.

Referenced by category(), and User().

std::string Dv::Ticket::User::name_ [private]
 

User name (e.g.

login name).

Definition at line 89 of file user.h.

Referenced by name(), and User().

std::string Dv::Ticket::User::info_ [private]
 

Extra info.

Definition at line 91 of file user.h.

Referenced by info(), and User().


The documentation for this class was generated from the following file:
dvticket-0.7.1 [24 October, 2003]