1 // Copyright 2018 The Fuchsia 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 #ifndef LIB_ZX_PROFILE_H_ 6 #define LIB_ZX_PROFILE_H_ 7 8 #include <lib/zx/handle.h> 9 #include <lib/zx/job.h> 10 #include <lib/zx/object.h> 11 12 namespace zx { 13 14 class profile : public object<profile> { 15 public: 16 static constexpr zx_obj_type_t TYPE = ZX_OBJ_TYPE_LOG; 17 18 constexpr profile() = default; 19 profile(zx_handle_t value)20 explicit profile(zx_handle_t value) : object(value) {} 21 profile(handle && h)22 explicit profile(handle&& h) : object(h.release()) {} 23 profile(profile && other)24 profile(profile&& other) : object(other.release()) {} 25 26 profile& operator=(profile&& other) { 27 reset(other.release()); 28 return *this; 29 } 30 31 static zx_status_t create(const job& job, const zx_profile_info_t* info, profile* result); 32 }; 33 34 using unowned_profile = unowned<profile>; 35 36 } // namespace zx 37 38 #endif // LIB_ZX_PROFILE_H_ 39