-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(scouting): small comment fixes
- Loading branch information
Showing
4 changed files
with
40 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,17 @@ | ||
// | ||
// Copyright (c) 2023 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, <[email protected]> | ||
// | ||
|
||
package io.zenoh.jni | ||
|
||
import io.zenoh.Config | ||
|
@@ -8,12 +22,13 @@ import io.zenoh.scouting.Hello | |
import io.zenoh.scouting.Scout | ||
import io.zenoh.scouting.WhatAmI | ||
|
||
/** | ||
* Adapter class to handle the interactions with Zenoh through JNI for a [io.zenoh.scouting.Scout] | ||
* | ||
* @property ptr: raw pointer to the underlying native scout. | ||
*/ | ||
class JNIScout(private val ptr: Long) { | ||
|
||
fun close() { | ||
freePtrViaJNI(ptr) | ||
} | ||
|
||
companion object { | ||
fun <R> scout( | ||
whatAmI: Set<WhatAmI>, | ||
|
@@ -44,4 +59,8 @@ class JNIScout(private val ptr: Long) { | |
@Throws(Exception::class) | ||
external fun freePtrViaJNI(ptr: Long) | ||
} | ||
|
||
fun close() { | ||
freePtrViaJNI(ptr) | ||
} | ||
} |
16 changes: 15 additions & 1 deletion
16
zenoh-kotlin/src/commonMain/kotlin/io/zenoh/jni/callbacks/JNIScoutCallback.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,20 @@ | ||
// | ||
// Copyright (c) 2023 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, <[email protected]> | ||
// | ||
|
||
package io.zenoh.jni.callbacks | ||
|
||
internal fun interface JNIScoutCallback { | ||
|
||
fun run(whatAmI: Int, zid: String, locators: List<String>) | ||
} | ||
} |