RobotCore
1.0
WPILib port to raspberry Pi
Toggle main menu visibility
Loading...
Searching...
No Matches
Topic.java
1
// Copyright (c) FIRST and other WPILib contributors.
2
// Open Source Software; you can modify and/or share it under the terms of
3
// the WPILib BSD license file in the root directory of this project.
4
5
package
org.wpilib.networktables;
6
8
public
class
Topic {
15
Topic(
NetworkTableInstance
inst,
int
handle) {
16
m_inst
= inst;
17
m_handle
= handle;
18
}
19
25
public
boolean
isValid
() {
26
return
m_handle
!= 0;
27
}
28
34
public
int
getHandle
() {
35
return
m_handle
;
36
}
37
43
public
NetworkTableInstance
getInstance
() {
44
return
m_inst
;
45
}
46
52
public
String
getName
() {
53
return
NetworkTablesJNI
.getTopicName(
m_handle
);
54
}
55
61
public
NetworkTableType
getType
() {
62
return
NetworkTableType
.
getFromInt
(
NetworkTablesJNI
.getType(
m_handle
));
63
}
64
71
public
String
getTypeString
() {
72
return
NetworkTablesJNI
.getTopicTypeString(
m_handle
);
73
}
74
80
public
TopicInfo
getInfo
() {
81
return
NetworkTablesJNI
.getTopicInfo(
m_inst
,
m_handle
);
82
}
83
89
public
void
setPersistent
(
boolean
persistent) {
90
NetworkTablesJNI
.setTopicPersistent(
m_handle
, persistent);
91
}
92
98
public
boolean
isPersistent
() {
99
return
NetworkTablesJNI
.getTopicPersistent(
m_handle
);
100
}
101
107
public
void
setRetained
(
boolean
retained) {
108
NetworkTablesJNI
.setTopicRetained(
m_handle
, retained);
109
}
110
116
public
boolean
isRetained
() {
117
return
NetworkTablesJNI
.getTopicRetained(
m_handle
);
118
}
119
126
public
void
setCached
(
boolean
cached) {
127
NetworkTablesJNI
.setTopicCached(
m_handle
, cached);
128
}
129
135
public
boolean
isCached
() {
136
return
NetworkTablesJNI
.getTopicCached(
m_handle
);
137
}
138
144
public
boolean
exists
() {
145
return
NetworkTablesJNI
.getTopicExists(
m_handle
);
146
}
147
154
public
String
getProperty
(String name) {
155
return
NetworkTablesJNI
.getTopicProperty(
m_handle
, name);
156
}
157
165
public
void
setProperty
(String name, String value) {
166
NetworkTablesJNI
.setTopicProperty(
m_handle
, name, value);
167
}
168
174
public
void
deleteProperty
(String name) {
175
NetworkTablesJNI
.deleteTopicProperty(
m_handle
, name);
176
}
177
184
public
String
getProperties
() {
185
return
NetworkTablesJNI
.getTopicProperties(
m_handle
);
186
}
187
196
public
void
setProperties
(String properties) {
197
NetworkTablesJNI
.setTopicProperties(
m_handle
, properties);
198
}
199
208
public
GenericSubscriber
genericSubscribe
(
PubSubOption
... options) {
209
return
genericSubscribe
(
""
, options);
210
}
211
224
public
GenericSubscriber
genericSubscribe
(String typeString,
PubSubOption
... options) {
225
return
new
GenericEntryImpl(
226
this
,
227
NetworkTablesJNI
.subscribe(
228
m_handle
,
NetworkTableType
.
getFromString
(typeString).
getValue
(), typeString, options));
229
}
230
245
public
GenericPublisher
genericPublish
(String typeString,
PubSubOption
... options) {
246
return
new
GenericEntryImpl(
247
this
,
248
NetworkTablesJNI
.publish(
249
m_handle
,
NetworkTableType
.
getFromString
(typeString).
getValue
(), typeString, options));
250
}
251
268
public
GenericPublisher
genericPublishEx
(
269
String typeString, String properties,
PubSubOption
... options) {
270
return
new
GenericEntryImpl(
271
this
,
272
NetworkTablesJNI
.publishEx(
273
m_handle
,
274
NetworkTableType
.
getFromString
(typeString).
getValue
(),
275
typeString,
276
properties,
277
options));
278
}
279
295
public
GenericEntry
getGenericEntry
(
PubSubOption
... options) {
296
return
getGenericEntry
(
""
, options);
297
}
298
315
public
GenericEntry
getGenericEntry
(String typeString,
PubSubOption
... options) {
316
return
new
GenericEntryImpl(
317
this
,
318
NetworkTablesJNI
.getEntry(
319
m_handle
,
NetworkTableType
.
getFromString
(typeString).
getValue
(), typeString, options));
320
}
321
322
@Override
323
public
boolean
equals(Object other) {
324
return
other instanceof
Topic
topic &&
m_handle
== topic.
m_handle
;
325
}
326
327
@Override
328
public
int
hashCode() {
329
return
m_handle
;
330
}
331
333
protected
final
NetworkTableInstance
m_inst
;
334
336
protected
final
int
m_handle
;
337
}
org.wpilib.networktables.NetworkTableInstance
Definition
NetworkTableInstance.java:47
org.wpilib.networktables.NetworkTablesJNI
Definition
NetworkTablesJNI.java:26
org.wpilib.networktables.Topic
Definition
Topic.java:8
org.wpilib.networktables.Topic.m_inst
final NetworkTableInstance m_inst
Definition
Topic.java:333
org.wpilib.networktables.Topic.genericSubscribe
GenericSubscriber genericSubscribe(String typeString, PubSubOption... options)
Definition
Topic.java:224
org.wpilib.networktables.Topic.getProperty
String getProperty(String name)
Definition
Topic.java:154
org.wpilib.networktables.Topic.getGenericEntry
GenericEntry getGenericEntry(String typeString, PubSubOption... options)
Definition
Topic.java:315
org.wpilib.networktables.Topic.getName
String getName()
Definition
Topic.java:52
org.wpilib.networktables.Topic.isValid
boolean isValid()
Definition
Topic.java:25
org.wpilib.networktables.Topic.setProperties
void setProperties(String properties)
Definition
Topic.java:196
org.wpilib.networktables.Topic.genericPublishEx
GenericPublisher genericPublishEx(String typeString, String properties, PubSubOption... options)
Definition
Topic.java:268
org.wpilib.networktables.Topic.deleteProperty
void deleteProperty(String name)
Definition
Topic.java:174
org.wpilib.networktables.Topic.exists
boolean exists()
Definition
Topic.java:144
org.wpilib.networktables.Topic.getGenericEntry
GenericEntry getGenericEntry(PubSubOption... options)
Definition
Topic.java:295
org.wpilib.networktables.Topic.isRetained
boolean isRetained()
Definition
Topic.java:116
org.wpilib.networktables.Topic.setCached
void setCached(boolean cached)
Definition
Topic.java:126
org.wpilib.networktables.Topic.setRetained
void setRetained(boolean retained)
Definition
Topic.java:107
org.wpilib.networktables.Topic.getTypeString
String getTypeString()
Definition
Topic.java:71
org.wpilib.networktables.Topic.isCached
boolean isCached()
Definition
Topic.java:135
org.wpilib.networktables.Topic.m_handle
final int m_handle
Definition
Topic.java:336
org.wpilib.networktables.Topic.setPersistent
void setPersistent(boolean persistent)
Definition
Topic.java:89
org.wpilib.networktables.Topic.getProperties
String getProperties()
Definition
Topic.java:184
org.wpilib.networktables.Topic.getType
NetworkTableType getType()
Definition
Topic.java:61
org.wpilib.networktables.Topic.getInfo
TopicInfo getInfo()
Definition
Topic.java:80
org.wpilib.networktables.Topic.genericPublish
GenericPublisher genericPublish(String typeString, PubSubOption... options)
Definition
Topic.java:245
org.wpilib.networktables.Topic.getInstance
NetworkTableInstance getInstance()
Definition
Topic.java:43
org.wpilib.networktables.Topic.isPersistent
boolean isPersistent()
Definition
Topic.java:98
org.wpilib.networktables.Topic.genericSubscribe
GenericSubscriber genericSubscribe(PubSubOption... options)
Definition
Topic.java:208
org.wpilib.networktables.Topic.getHandle
int getHandle()
Definition
Topic.java:34
org.wpilib.networktables.Topic.setProperty
void setProperty(String name, String value)
Definition
Topic.java:165
org.wpilib.networktables.TopicInfo
Definition
TopicInfo.java:8
org.wpilib.networktables.NetworkTableType
Definition
NetworkTableType.java:8
org.wpilib.networktables.NetworkTableType.getFromString
static NetworkTableType getFromString(String typeString)
Definition
NetworkTableType.java:89
org.wpilib.networktables.NetworkTableType.getValue
int getValue()
Definition
NetworkTableType.java:47
org.wpilib.networktables.NetworkTableType.getFromInt
static NetworkTableType getFromInt(int value)
Definition
NetworkTableType.java:66
org.wpilib.networktables.GenericEntry
Definition
GenericEntry.java:12
org.wpilib.networktables.GenericPublisher
Definition
GenericPublisher.java:13
org.wpilib.networktables.GenericSubscriber
Definition
GenericSubscriber.java:12
org.wpilib.networktables.PubSubOption
Definition
PubSubOption.java:8
org
wpilib
networktables
Topic.java
Generated by
1.18.0