RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
TopicInfo.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
5package org.wpilib.networktables;
6
8public final class TopicInfo {
10 public final int topic;
11
13 public final String name;
14
16 public final NetworkTableType type;
17
19 public final String typeStr;
20
30 public TopicInfo(NetworkTableInstance inst, int handle, String name, int type, String typeStr) {
31 this.m_inst = inst;
32 this.topic = handle;
33 this.name = name;
34 this.type = NetworkTableType.getFromInt(type);
35 this.typeStr = typeStr;
36 }
37
38 /* Network table instance. */
39 private final NetworkTableInstance m_inst;
40
41 /* Cached topic object. */
42 private Topic m_topicObject;
43
50 return m_inst;
51 }
52
58 public Topic getTopic() {
59 if (m_topicObject == null) {
60 m_topicObject = new Topic(m_inst, topic);
61 }
62 return m_topicObject;
63 }
64}
NetworkTableInstance getInstance()
final NetworkTableType type
TopicInfo(NetworkTableInstance inst, int handle, String name, int type, String typeStr)
static NetworkTableType getFromInt(int value)