resizable_parallel_runner_cxx.h
Go to the documentation of this file.
// Copyright (c) the JPEG XL Project Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#ifndef JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
#define JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
#include <memory>
#include "jxl/resizable_parallel_runner.h"
#if !(defined(__cplusplus) || defined(c_plusplus))
#error \
"This a C++ only header. Use jxl/jxl_resizable_parallel_runner.h from C" \
"sources."
#endif
struct JxlResizableParallelRunnerDestroyStruct {
void operator()(void* runner) { JxlResizableParallelRunnerDestroy(runner); }
};
typedef std::unique_ptr<void, JxlResizableParallelRunnerDestroyStruct>
JxlResizableParallelRunnerPtr;
static inline JxlResizableParallelRunnerPtr JxlResizableParallelRunnerMake(
const JxlMemoryManager* memory_manager) {
return JxlResizableParallelRunnerPtr(
JxlResizableParallelRunnerCreate(memory_manager));
}
#endif // JXL_RESIZABLE_PARALLEL_RUNNER_CXX_H_
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