Add `bt2_common::OverflowError`
[babeltrace.git] / src / cpp-common / bt2 / internal / utils.hpp
CommitLineData
dcfc2f5c
PP
1/*
2 * Copyright 2019-2020 (c) Philippe Proulx <pproulx@efficios.com>
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef BABELTRACE_CPP_COMMON_BT2_INTERNAL_UTILS_HPP
8#define BABELTRACE_CPP_COMMON_BT2_INTERNAL_UTILS_HPP
9
10#include <type_traits>
11
12#include "../lib-error.hpp"
13
14namespace bt2 {
15namespace internal {
16
17template <typename LibObjPtrT>
18void validateCreatedObjPtr(const LibObjPtrT libOjbPtr)
19{
20 if (!libOjbPtr) {
21 throw LibMemoryError {};
22 }
23}
24
4927bae7
PP
25template <typename ObjT>
26struct TypeDescr;
27
b5f55e9f
PP
28} /* namespace internal */
29} /* namespace bt2 */
dcfc2f5c 30
b5f55e9f 31#endif /* BABELTRACE_CPP_COMMON_BT2_INTERNAL_UTILS_HPP */
This page took 0.027865 seconds and 4 git commands to generate.