Design Pattern Examples
Overview of object-oriented design patterns
User Class Reference

Represents a user with a name. More...

#include <Mediator_User_Classes.h>

Collaboration diagram for User:
Collaboration graph

Public Member Functions

 User ()
 Default constructor.
 
 User (std::string name)
 Constructor.
 
std::string Name ()
 The name of the user (read-only).
 
bool Equals (const std::string &s) const
 Compare a string to this User.
 
bool Equals (const User &user) const
 Compare another User name to this User name.
 

Private Attributes

std::string _name
 

Detailed Description

Represents a user with a name.

Definition at line 25 of file Mediator_User_Classes.h.

Constructor & Destructor Documentation

◆ User() [1/2]

User ( )
inline

Default constructor.

Definition at line 34 of file Mediator_User_Classes.h.

◆ User() [2/2]

User ( std::string  name)
inline

Constructor.

Parameters
nameThe name of the user to assign.

Definition at line 42 of file Mediator_User_Classes.h.

Member Function Documentation

◆ Equals() [1/2]

bool Equals ( const std::string &  s) const
inline

Compare a string to this User.

Parameters
sA string containing the name of a user.
Returns
Returns true if the names are equal (case-sensitive).

Definition at line 61 of file Mediator_User_Classes.h.

References User::_name.

Referenced by UserList::_SearchForUser().

◆ Equals() [2/2]

bool Equals ( const User user) const
inline

Compare another User name to this User name.

Parameters
userA User object to compare names with.
Returns
Return true if the names are equal (case-sensitive).

Definition at line 71 of file Mediator_User_Classes.h.

References User::_name.

◆ Name()

std::string Name ( )
inline

The name of the user (read-only).

Definition at line 51 of file Mediator_User_Classes.h.

References User::_name.

Referenced by Visitor_Shop::PickupOrder(), Visitor_Shop::PlaceOrder(), and EntryInformation::ToString().

Member Data Documentation

◆ _name


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