Skip to content

Commit

Permalink
Restricting visibility for attributes and internal functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIMP committed Sep 12, 2024
1 parent bc68fb4 commit 4e4a169
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 18 deletions.
2 changes: 1 addition & 1 deletion examples/src/main/kotlin/io.zenoh/ZPubThr.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ZPubThr(private val emptyArgs: Boolean) : CliktCommand(

val qos = QoS(
congestionControl = CongestionControl.BLOCK,
priority = priorityInput?.let { Priority.entries[it] } ?: Priority.default(),
priority = priorityInput?.let { Priority.entries[it] } ?: Priority.DATA,
)

Session.open(config).onSuccess {
Expand Down
2 changes: 1 addition & 1 deletion zenoh-kotlin/src/commonMain/kotlin/io/zenoh/Session.kt
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ class Session private constructor(private val config: Config) : AutoCloseable {
attachment: IntoZBytes? = null,
timeout: Duration = Duration.ofMillis(10000),
target: QueryTarget = QueryTarget.BEST_MATCHING,
consolidation: ConsolidationMode = ConsolidationMode.default(),
consolidation: ConsolidationMode = ConsolidationMode.AUTO,
onClose: (() -> Unit)? = null
): Result<Channel<Reply>> {
val channelHandler = ChannelHandler(channel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import io.zenoh.scouting.WhatAmI
*
* @property ptr: raw pointer to the underlying native scout.
*/
class JNIScout(private val ptr: Long) {
internal class JNIScout(private val ptr: Long) {

companion object {
fun <R> scout(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import io.zenoh.ZenohLoad
import io.zenoh.protocol.ZBytes
import io.zenoh.protocol.into

object JNIZBytes {
internal object JNIZBytes {

init {
ZenohLoad
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package io.zenoh.prelude

/** The congestion control to be applied when routing the data. */
enum class CongestionControl (val value: Int) {
enum class CongestionControl (internal val value: Int) {

/**
* Allows the message to be dropped if all buffers are full.
Expand All @@ -28,9 +28,7 @@ enum class CongestionControl (val value: Int) {
*/
BLOCK(1);

companion object {
internal companion object {
fun fromInt(value: Int) = entries.first { it.value == value }

fun default() = DROP
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ enum class Priority(val value: Int) {
DATA_LOW(6),
BACKGROUND(7);

companion object {
internal companion object {
fun fromInt(value: Int) = entries.first { it.value == value }

fun default() = DATA
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum class SampleKind {
PUT,
DELETE;

companion object {
internal companion object {
fun fromInt(value: Int) = entries.first { it.ordinal == value }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,5 @@ enum class ConsolidationMode {
MONOTONIC,

/** Holds back samples to only send the set of samples that had the highest timestamp for their key. */
LATEST;

companion object {
fun default() = AUTO
}
LATEST
}

0 comments on commit 4e4a169

Please sign in to comment.