
''' Generated by OTF2 Template Engine '''

import ctypes

from .Config import EnumBase, EnumBitset

@otf2 for enum in enums|def_enums:
@otf2  if enum is bitset_enum:
class @@enum.type.py_ctype@@(EnumBitset, @@enum.type.py_underlying_ctype@@):
@otf2  else:
class @@enum.type.py_ctype@@(EnumBase, @@enum.type.py_underlying_ctype@@):
@otf2  endif
    pass

@otf2  for entry in enum.entries|py_def_enum_entries:
@@entry.name[5:]@@ = @@enum.type.py_ctype@@._construct(@@entry.value@@, "@@entry.suffix@@")
@otf2  for alias in entry.aliases:
@@alias.name[5:]@@ = @@enum.type.py_ctype@@._construct(@@entry.value@@, "@@alias.suffix@@")
@otf2  endfor
@otf2  endfor
@otf2  if enum is enum_with_terminator:
@@enum.terminator.name[5:]@@ = @@enum.type.py_ctype@@(@@enum.terminator.value@@)
@otf2  endif

@otf2 endfor
METRIC_ACCUMULATED_START = MetricMode._construct(METRIC_VALUE_ACCUMULATED.value | METRIC_TIMING_START.value, "ACCUMULATED_START")
METRIC_ACCUMULATED_POINT = MetricMode._construct(METRIC_VALUE_ACCUMULATED.value | METRIC_TIMING_POINT.value, "ACCUMULATED_POINT")
METRIC_ACCUMULATED_LAST  = MetricMode._construct(METRIC_VALUE_ACCUMULATED.value | METRIC_TIMING_LAST.value, "ACCUMULATED_LAST")
METRIC_ACCUMULATED_NEXT  = MetricMode._construct(METRIC_VALUE_ACCUMULATED.value | METRIC_TIMING_NEXT.value, "ACCUMULATED_NEXT")
METRIC_ABSOLUTE_POINT    = MetricMode._construct(METRIC_VALUE_ABSOLUTE.value    | METRIC_TIMING_POINT.value, "ABSOLUTE_POINT")
METRIC_ABSOLUTE_LAST     = MetricMode._construct(METRIC_VALUE_ABSOLUTE.value    | METRIC_TIMING_LAST.value, "ABSOLUTE_LAST")
METRIC_ABSOLUTE_NEXT     = MetricMode._construct(METRIC_VALUE_ABSOLUTE.value    | METRIC_TIMING_NEXT.value, "ABSOLUTE_NEXT")
METRIC_RELATIVE_POINT    = MetricMode._construct(METRIC_VALUE_RELATIVE.value    | METRIC_TIMING_POINT.value, "RELATIVE_POINT")
METRIC_RELATIVE_LAST     = MetricMode._construct(METRIC_VALUE_RELATIVE.value    | METRIC_TIMING_LAST.value, "RELATIVE_LAST")
METRIC_RELATIVE_NEXT     = MetricMode._construct(METRIC_VALUE_RELATIVE.value    | METRIC_TIMING_NEXT.value, "RELATIVE_NEXT")

__all__ = [
    @otf2 for enum in enums|def_enums:
    '@@enum.type.py_ctype@@',
    @otf2 for entry in enum.entries:
    '@@entry.name[5:]@@',
    @otf2 endfor
    @otf2 if enum is enum_with_terminator:
    '@@enum.terminator.name[5:]@@',
    @otf2 endif
    @otf2 endfor
]
