-
Notifications
You must be signed in to change notification settings - Fork 59
Expand file tree
/
Copy pathclose.hxx
More file actions
38 lines (30 loc) · 1.21 KB
/
close.hxx
File metadata and controls
38 lines (30 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
// Copyright (c) 2024 ZettaScale Technology
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
// which is available at https://www.apache.org/licenses/LICENSE-2.0.
//
// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
//
// Contributors:
// ZettaScale Zenoh Team, <zenoh@zettascale.tech>
#pragma once
#if defined(ZENOHCXX_ZENOHC) && defined(Z_FEATURE_UNSTABLE_API)
namespace zenoh {
/// A close operation handle.
class CloseHandle : public Owned<::zc_owned_concurrent_close_handle_t> {
friend class Session;
CloseHandle(zenoh::detail::null_object_t) : Owned(nullptr){};
public:
/// @brief Blocks until corresponding close operation completes.
/// @param err if not null, the result code will be written to this location, otherwise ZException exception will be
/// thrown in case of error.
void wait(ZResult* err = nullptr) {
__ZENOH_RESULT_CHECK(zc_concurrent_close_handle_wait(interop::as_moved_c_ptr(*this)), err,
"Failed to wait for close operation");
}
};
} // namespace zenoh
#endif