EGLplus (0.52.0) a C++ wrapper for EGL

enumerations.hpp
Go to the documentation of this file.
1 
12 #pragma once
13 #ifndef EGLPLUS_ENUMERATIONS_1303201759_HPP
14 #define EGLPLUS_ENUMERATIONS_1303201759_HPP
15 
16 #include <eglplus/config.hpp>
17 #include <eglplus/string.hpp>
18 #include <eglplus/detail/enum_class.hpp>
19 #include <eglplus/detail/base_range.hpp>
20 
21 namespace eglplus {
22 namespace enums {
23 
24 template <typename Enum>
25 struct EnumBaseType
26 {
27  typedef EGLenum Type;
28 };
29 
30 template <typename EnumType>
31 inline StrCRef EnumValueName(EnumType enum_value)
32 {
33 #if !EGLPLUS_NO_ENUM_VALUE_NAMES
34  typedef typename EnumBaseType<EnumType>::Type BaseType;
35  return ValueName_(
36  (EnumType*)nullptr,
37  BaseType(enum_value)
38  );
39 #else
40  OGLPLUS_FAKE_USE(enum_value);
41  return StrCRef();
42 #endif
43 }
44 
45 template <typename EnumType>
46 inline aux::CastIterRange<
47  const typename EnumBaseType<EnumType>::Type*,
48  EnumType
49 > EnumValueRange(void)
50 {
51 #if !EGLPLUS_NO_ENUM_VALUE_RANGES
52  return ValueRange_((EnumType*)nullptr);
53 #else
54  const typename EnumBaseType<EnumType>::Type* x = nullptr;
55  return aux::CastIterRange<
56  const typename EnumBaseType<EnumType>::Type*,
57  EnumType
58  >(x, x);
59 
60 #endif
61 }
62 
63 } // namespace enums
64 
65 using enums::EnumValueName;
66 using enums::EnumValueRange;
67 
68 } // namespace eglplus
69 
70 #endif // include guard
StrCRef EnumValueName(Enum enum_value)
Compile-time configuration options.
Range< Enum > EnumValueRange(void)
String-related typedefs.
::oglplus::StrCRefTpl< char > StrCRef
String const reference wrapper.
Definition: string.hpp:31
StrCRefTpl< GLchar > StrCRef

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).