Imported Upstream version 8.2.2
[platform/upstream/harfbuzz.git] / src / OT / Layout / GPOS / CursivePos.hh
1 #ifndef OT_LAYOUT_GPOS_CURSIVEPOS_HH
2 #define OT_LAYOUT_GPOS_CURSIVEPOS_HH
3
4 #include "CursivePosFormat1.hh"
5
6 namespace OT {
7 namespace Layout {
8 namespace GPOS_impl {
9
10 struct CursivePos
11 {
12   protected:
13   union {
14   HBUINT16              format;         /* Format identifier */
15   CursivePosFormat1     format1;
16   } u;
17
18   public:
19   template <typename context_t, typename ...Ts>
20   typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const
21   {
22     if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
23     TRACE_DISPATCH (this, u.format);
24     switch (u.format) {
25     case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
26     default:return_trace (c->default_return_value ());
27     }
28   }
29 };
30
31 }
32 }
33 }
34
35 #endif /* OT_LAYOUT_GPOS_CURSIVEPOS_HH */