CBOE Emulator  1.0
Public Member Functions | Friends | List of all members
OrderEntry::Authorizer< Handler > Class Template Reference

Logic for looking up and validating credentials for new connections. More...

#include <authorizer.hpp>

Public Member Functions

std::size_t size () const
 Return the number of accounts in the manager.
 
void new_user (std::string username, std::string password)
 Create a new user in the account manager. More...
 
bool has_account (std::string username) const
 Return true if the username exists in the database. More...
 
SystemAccount< Handler > * get_account (std::string username)
 Return the account for the given username. More...
 
bool is_valid (const std::string &username, const std::string &password) const
 Return true if the username and password combination is valid. More...
 

Friends

std::ostream & operator<< (std::ostream &stream, const Authorizer &authorizer)
 Write the data from the authorizer to a stream. More...
 

Detailed Description

template<typename Handler>
class OrderEntry::Authorizer< Handler >

Logic for looking up and validating credentials for new connections.

Template Parameters
Handlerthe handler type for the system accounts being managed

Member Function Documentation

◆ get_account()

template<typename Handler >
SystemAccount<Handler>* OrderEntry::Authorizer< Handler >::get_account ( std::string  username)
inline

Return the account for the given username.

Parameters
usernamethe username to look up in the database
Returns
the account for the given username

◆ has_account()

template<typename Handler >
bool OrderEntry::Authorizer< Handler >::has_account ( std::string  username) const
inline

Return true if the username exists in the database.

Parameters
usernamethe username to look up in the database
Returns
true if the user exists, false otherwise

◆ is_valid()

template<typename Handler >
bool OrderEntry::Authorizer< Handler >::is_valid ( const std::string &  username,
const std::string &  password 
) const
inline

Return true if the username and password combination is valid.

Parameters
usernameto username for the account
passwordthe password for the user's account
Returns
true if the combination is valid, false otherwise

◆ new_user()

template<typename Handler >
void OrderEntry::Authorizer< Handler >::new_user ( std::string  username,
std::string  password 
)
inline

Create a new user in the account manager.

Parameters
usernamethe username for the new account
passwordthe password for the new account

Friends And Related Function Documentation

◆ operator<<

template<typename Handler >
std::ostream& operator<< ( std::ostream &  stream,
const Authorizer< Handler > &  authorizer 
)
friend

Write the data from the authorizer to a stream.

Parameters
streamthe stream to write the data to
authorizerthe authorizer to write to the stream
Returns
the stream with data from the authorizer written to it

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