MyGUI_Macros.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_MACROS_H_
#define MYGUI_MACROS_H_
#include "MyGUI_Prerequest.h"
#include <limits>
#include <cstddef>
#include <cstdint>
#include <string_view>
namespace MyGUI
{
constexpr size_t ITEM_NONE = (std::numeric_limits<size_t>::max)();
constexpr float ALPHA_MAX = 1.0f;
constexpr float ALPHA_MIN = 0.0f;
constexpr unsigned int MYGUI_FLAG_NONE = 0;
constexpr unsigned int MYGUI_FLAG(uint8_t num)
{
return 1U << num;
}
template<class Map, class Value>
inline void mapSet(Map& map, std::string_view key, const Value& value)
{
auto it = map.find(key);
if (it == map.end())
map.emplace(key, value);
else
it->second = value;
}
} // namespace MyGUI
#endif // MYGUI_MACROS_H_
MyGUI_Prerequest.h
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::mapSet
void mapSet(Map &map, std::string_view key, const Value &value)
Definition MyGUI_Macros.h:36
MyGUI::ALPHA_MAX
constexpr float ALPHA_MAX
Definition MyGUI_Macros.h:20
MyGUI::MYGUI_FLAG
constexpr unsigned int MYGUI_FLAG(uint8_t num)
Definition MyGUI_Macros.h:24
MyGUI::ALPHA_MIN
constexpr float ALPHA_MIN
Definition MyGUI_Macros.h:21
MyGUI::ITEM_NONE
constexpr size_t ITEM_NONE
Definition MyGUI_Macros.h:19
MyGUI::MYGUI_FLAG_NONE
constexpr unsigned int MYGUI_FLAG_NONE
Definition MyGUI_Macros.h:23