LIBJXL: jxl/resizable_parallel_runner_cxx.h Source File

LIBJXL

resizable_parallel_runner_cxx.h
Go to the documentation of this file.
1// Copyright (c) the JPEG XL Project Authors. All rights reserved.
2//
3// Use of this source code is governed by a BSD-style
4// license that can be found in the LICENSE file.
5
15
16#ifndef JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
17#define JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
18
19#include <memory>
20
21#include "jxl/resizable_parallel_runner.h"
22
23#if !(defined(__cplusplus) || defined(c_plusplus))
24#error \
25 "This a C++ only header. Use jxl/jxl_resizable_parallel_runner.h from C" \
26 "sources."
27#endif
28
31 struct JxlResizableParallelRunnerDestroyStruct {
33 void operator()(void* runner) { JxlResizableParallelRunnerDestroy(runner); }
34};
35
41typedef std::unique_ptr<void, JxlResizableParallelRunnerDestroyStruct>
42 JxlResizableParallelRunnerPtr;
43
56static inline JxlResizableParallelRunnerPtr JxlResizableParallelRunnerMake(
57 const JxlMemoryManager* memory_manager) {
58 return JxlResizableParallelRunnerPtr(
59 JxlResizableParallelRunnerCreate(memory_manager));
60}
61
62#endif // JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
63
JxlResizableParallelRunnerDestroy
JXL_THREADS_EXPORT void JxlResizableParallelRunnerDestroy(void *runner_opaque)
JxlResizableParallelRunnerPtr
std::unique_ptr< void, JxlResizableParallelRunnerDestroyStruct > JxlResizableParallelRunnerPtr
Definition: resizable_parallel_runner_cxx.h:42
JxlResizableParallelRunnerCreate
JXL_THREADS_EXPORT void * JxlResizableParallelRunnerCreate(const JxlMemoryManager *memory_manager)
resizable_parallel_runner.h
implementation using std::thread of a resizeable JxlParallelRunner.
JxlMemoryManagerStruct
Definition: memory_manager.h:51
JxlResizableParallelRunnerDestroyStruct
Definition: resizable_parallel_runner_cxx.h:31
JxlResizableParallelRunnerDestroyStruct::operator()
void operator()(void *runner)
Calls JxlResizableParallelRunnerDestroy() on the passed runner.
Definition: resizable_parallel_runner_cxx.h:33