| 66 | |
| 67 | template <class... A> Read(A &&...a) : t_(std::forward<A>(a)...) {} |
| 68 | static int |
| 69 | handle(TSCont c, TSEvent e, void *d) |
| 70 | { |
| 71 | Self *const self = static_cast<Self *const>(TSContDataGet(c)); |
| 72 | assert(self != nullptr); |
| 73 | switch (e) { |
| 74 | case TS_EVENT_CACHE_OPEN_READ: |
| 75 | assert(d != nullptr); |
| 76 | self->t_.hit(static_cast<TSVConn>(d)); |
| 77 | break; |
| 78 | case TS_EVENT_CACHE_OPEN_READ_FAILED: |
| 79 | self->t_.miss(); |
| 80 | break; |
| 81 | default: |
| 82 | assert(false); // UNREACHABLE. |
| 83 | break; |
| 84 | } |
| 85 | delete self; |
| 86 | TSContDataSet(c, nullptr); |
| 87 | TSContDestroy(c); |
| 88 | return TS_SUCCESS; |
| 89 | } |
| 90 | }; |
| 91 | |
| 92 | template <class T, class... A> |
nothing calls this directly
no test coverage detected