Design Pattern Examples
Overview of object-oriented design patterns
Mediator_Users.h
Go to the documentation of this file.
1
5
6#pragma once
7#ifndef __MEDIATOR_USERS_H__
8#define __MEDIATOR_USERS_H__
9
10#include "helpers/stringlist.h"
11
12#include "Mediator_User.h"
13
18typedef enum
19{
25
26//-----------------------------------------------------------------------------
27
31void Users_Clear(void);
32
43UserErrorCode Users_AddUser(const char* userName);
44
54UserErrorCode Users_RemoveUser(const char* userName);
55
62User* Users_FindUser(const char* userName);
63
75
76#endif // __MEDIATOR_USERS_H__
Declaration of the User structure and the associated support functions as used in the Mediator Patter...
void Users_Clear(void)
Release all memory associated with the list of users.
User * Users_FindUser(const char *userName)
Find a user from the list of users given the user's name.
UserErrorCode Users_RemoveUser(const char *userName)
Remove a user from the list of users.
UserErrorCode Users_GetAllUsers(StringList *userNames)
Retrieve a list of all users.
UserErrorCode
Represents error codes that can be returned from the User functions used in the Mediator Pattern.
@ UserErrorCode_No_Error
Indicates success.
@ UserErrorCode_User_Does_Not_Exist
Indicates the user does not exist.
@ UserErrorCode_No_Memory
Indicates an out of memory condition.
@ UserErrorCode_Null_Argument
Indicates an argument is NULL.
UserErrorCode Users_AddUser(const char *userName)
Add a user to the list of users.
std::vector< std::string > StringList
Typedef for a vector of std::string.
Represents a user with a name.
Definition: Mediator_User.h:14