Flutter Impeller
backend_cast.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include "flutter/fml/macros.h"
8 
9 namespace impeller {
10 
11 template <class Sub, class Base>
12 class BackendCast {
13  public:
14  static Sub& Cast(Base& base) { return reinterpret_cast<Sub&>(base); }
15 
16  static const Sub& Cast(const Base& base) {
17  return reinterpret_cast<const Sub&>(base);
18  }
19 
20  static Sub* Cast(Base* base) { return reinterpret_cast<Sub*>(base); }
21 
22  static const Sub* Cast(const Base* base) {
23  return reinterpret_cast<const Sub*>(base);
24  }
25 };
26 
27 } // namespace impeller
impeller::BackendCast::Cast
static const Sub * Cast(const Base *base)
Definition: backend_cast.h:22
impeller::BackendCast::Cast
static Sub * Cast(Base *base)
Definition: backend_cast.h:20
impeller::BackendCast
Definition: backend_cast.h:12
impeller::BackendCast::Cast
static Sub & Cast(Base &base)
Definition: backend_cast.h:14
impeller
Definition: aiks_context.cc:10
impeller::BackendCast::Cast
static const Sub & Cast(const Base &base)
Definition: backend_cast.h:16