view libserver/malikania/account.hpp @ 81:301599387b40

Common: remove class prefix in resources_locator|loader
author David Demelier <markand@malikania.fr>
date Sun, 22 Jan 2017 10:11:17 +0100
parents 858621081b95
children
line wrap: on
line source

/*
 * account.hpp -- account model
 *
 * Copyright (c) 2013-2017 David Demelier <markand@malikania.fr>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef MALIKANIA_ACCOUNT_HPP
#define MALIKANIA_ACCOUNT_HPP

/**
 * \file account.hpp
 * \brief Account model.
 */

#include <cstdint>
#include <string>

namespace mlk {

/**
 * \brief Account model
 */
class account {
public:
    std::uint64_t id;
    std::string name;
    std::string email;
    std::string first_name;
    std::string last_name;
    std::string password;
};

inline bool operator==(const account &ac1, const account &ac2) noexcept
{
    return ac1.id == ac2.id;
}

inline bool operator!=(const account &ac1, const account &ac2) noexcept
{
    return !(ac1 == ac2);
}

} // !mlk

#endif // !MALIKANIA_ACCOUNT_HPP