blob: 0f3afd175a17d3f761e9ca40696d95a5859d465c [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <lib/zx/handle.h>
#include <lib/zx/object.h>
namespace zx {
class resource final : public object<resource> {
static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_RESOURCE;
constexpr resource() = default;
explicit resource(zx_handle_t value) : object(value) {}
explicit resource(handle&& h) : object(h.release()) {}
resource(resource&& other) : object(other.release()) {}
resource& operator=(resource&& other) {
return *this;
static zx_status_t create(const resource& parent, uint32_t options, uint64_t base, size_t len,
const char* name, size_t namelen, resource* result);
using unowned_resource = unowned<resource>;
} // namespace zx
#endif // LIB_ZX_RESOURCE_H_