Skip to content

Commit

Permalink
Remove timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Jan 16, 2024
1 parent 123ae34 commit ebcbc0c
Show file tree
Hide file tree
Showing 54 changed files with 144 additions and 584 deletions.
6 changes: 3 additions & 3 deletions src/ntcore/EntryBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace NetworkTables;

public abstract class EntryBase<T>(T handle) : Subscriber, Publisher where T : struct, INtEntryHandle
public abstract class EntryBase<T>(T handle) : ISubscriber, IPublisher where T : struct, INtEntryHandle
{
private readonly T m_handle = handle;

Expand All @@ -18,9 +18,9 @@ public abstract class EntryBase<T>(T handle) : Subscriber, Publisher where T : s

public abstract Topic Topic { get; }

NtSubscriber PubSub<NtSubscriber>.Handle => new(m_handle.Handle);
NtSubscriber IPubSub<NtSubscriber>.Handle => new(m_handle.Handle);

NtPublisher PubSub<NtPublisher>.Handle => new(m_handle.Handle);
NtPublisher IPubSub<NtPublisher>.Handle => new(m_handle.Handle);

public void Dispose()
{
Expand Down
14 changes: 7 additions & 7 deletions src/ntcore/Generated/BooleanArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ public bool[] Get(bool[] defaultValue)
}


public TimestampedBooleanArray GetAtomic()
public TimestampedObject<bool[]> GetAtomic()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
bool[] baseValue = value.IsBooleanArray ? value.GetBooleanArray() : m_defaultValue;
return new TimestampedBooleanArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<bool[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedBooleanArray GetAtomic(bool[] defaultValue)
public TimestampedObject<bool[]> GetAtomic(bool[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
bool[] baseValue = value.IsBooleanArray ? value.GetBooleanArray() : defaultValue;
return new TimestampedBooleanArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<bool[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedBooleanArray[] ReadQueue()
public TimestampedObject<bool[]>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
TimestampedBooleanArray[] timestamped = new TimestampedBooleanArray[values.Length];
TimestampedObject<bool[]>[] timestamped = new TimestampedObject<bool[]>[values.Length];
for (int i = 0; i < values.Length; i++)
{
timestamped[i] = new TimestampedBooleanArray(values[i].Time, values[i].ServerTime, values[i].GetBooleanArray());
timestamped[i] = new TimestampedObject<bool[]>(values[i].Time, values[i].ServerTime, values[i].GetBooleanArray());
}
return timestamped;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/BooleanArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables BooleanArray publisher. */
public interface IBooleanArrayPublisher : Publisher
public interface IBooleanArrayPublisher : IPublisher
{
/**
* Get the corresponding topic.
Expand Down
8 changes: 4 additions & 4 deletions src/ntcore/Generated/BooleanArraySubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables BooleanArray subscriber. */
public interface IBooleanArraySubscriber : Subscriber
public interface IBooleanArraySubscriber : ISubscriber
{
/**
* Get the corresponding topic.
Expand Down Expand Up @@ -41,7 +41,7 @@ public interface IBooleanArraySubscriber : Subscriber
*
* @return timestamped value
*/
TimestampedBooleanArray GetAtomic();
TimestampedObject<bool[]> GetAtomic();

/**
* Get the last published value along with its timestamp
Expand All @@ -51,7 +51,7 @@ public interface IBooleanArraySubscriber : Subscriber
* @param defaultValue default value to return if no value has been published
* @return timestamped value
*/
TimestampedBooleanArray GetAtomic(bool[] defaultValue);
TimestampedObject<bool[]> GetAtomic(bool[] defaultValue);

/**
* Get an array of all value changes since the last call to readQueue.
Expand All @@ -63,7 +63,7 @@ public interface IBooleanArraySubscriber : Subscriber
* @return Array of timestamped values; empty array if no new changes have
* been published since the previous call.
*/
TimestampedBooleanArray[] ReadQueue();
TimestampedObject<bool[]>[] ReadQueue();

/**
* Get an array of all value changes since the last call to readQueue.
Expand Down
14 changes: 7 additions & 7 deletions src/ntcore/Generated/BooleanEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ public bool Get(bool defaultValue)
}


public TimestampedBoolean GetAtomic()
public TimestampedObject<bool> GetAtomic()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
bool baseValue = value.IsBoolean ? value.GetBoolean() : m_defaultValue;
return new TimestampedBoolean(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<bool>(value.Time, value.ServerTime, baseValue);
}


public TimestampedBoolean GetAtomic(bool defaultValue)
public TimestampedObject<bool> GetAtomic(bool defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
bool baseValue = value.IsBoolean ? value.GetBoolean() : defaultValue;
return new TimestampedBoolean(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<bool>(value.Time, value.ServerTime, baseValue);
}


public TimestampedBoolean[] ReadQueue()
public TimestampedObject<bool>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
TimestampedBoolean[] timestamped = new TimestampedBoolean[values.Length];
TimestampedObject<bool>[] timestamped = new TimestampedObject<bool>[values.Length];
for (int i = 0; i < values.Length; i++)
{
timestamped[i] = new TimestampedBoolean(values[i].Time, values[i].ServerTime, values[i].GetBoolean());
timestamped[i] = new TimestampedObject<bool>(values[i].Time, values[i].ServerTime, values[i].GetBoolean());
}
return timestamped;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/BooleanPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables Boolean publisher. */
public interface IBooleanPublisher : Publisher
public interface IBooleanPublisher : IPublisher
{
/**
* Get the corresponding topic.
Expand Down
8 changes: 4 additions & 4 deletions src/ntcore/Generated/BooleanSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables Boolean subscriber. */
public interface IBooleanSubscriber : Subscriber
public interface IBooleanSubscriber : ISubscriber
{
/**
* Get the corresponding topic.
Expand Down Expand Up @@ -41,7 +41,7 @@ public interface IBooleanSubscriber : Subscriber
*
* @return timestamped value
*/
TimestampedBoolean GetAtomic();
TimestampedObject<bool> GetAtomic();

/**
* Get the last published value along with its timestamp
Expand All @@ -51,7 +51,7 @@ public interface IBooleanSubscriber : Subscriber
* @param defaultValue default value to return if no value has been published
* @return timestamped value
*/
TimestampedBoolean GetAtomic(bool defaultValue);
TimestampedObject<bool> GetAtomic(bool defaultValue);

/**
* Get an array of all value changes since the last call to readQueue.
Expand All @@ -63,7 +63,7 @@ public interface IBooleanSubscriber : Subscriber
* @return Array of timestamped values; empty array if no new changes have
* been published since the previous call.
*/
TimestampedBoolean[] ReadQueue();
TimestampedObject<bool>[] ReadQueue();

/**
* Get an array of all value changes since the last call to readQueue.
Expand Down
14 changes: 7 additions & 7 deletions src/ntcore/Generated/DoubleArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ public double[] Get(double[] defaultValue)
}


public TimestampedDoubleArray GetAtomic()
public TimestampedObject<double[]> GetAtomic()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
double[] baseValue = value.IsDoubleArray ? value.GetDoubleArray() : m_defaultValue;
return new TimestampedDoubleArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<double[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedDoubleArray GetAtomic(double[] defaultValue)
public TimestampedObject<double[]> GetAtomic(double[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
double[] baseValue = value.IsDoubleArray ? value.GetDoubleArray() : defaultValue;
return new TimestampedDoubleArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<double[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedDoubleArray[] ReadQueue()
public TimestampedObject<double[]>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
TimestampedDoubleArray[] timestamped = new TimestampedDoubleArray[values.Length];
TimestampedObject<double[]>[] timestamped = new TimestampedObject<double[]>[values.Length];
for (int i = 0; i < values.Length; i++)
{
timestamped[i] = new TimestampedDoubleArray(values[i].Time, values[i].ServerTime, values[i].GetDoubleArray());
timestamped[i] = new TimestampedObject<double[]>(values[i].Time, values[i].ServerTime, values[i].GetDoubleArray());
}
return timestamped;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/DoubleArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables DoubleArray publisher. */
public interface IDoubleArrayPublisher : Publisher
public interface IDoubleArrayPublisher : IPublisher
{
/**
* Get the corresponding topic.
Expand Down
8 changes: 4 additions & 4 deletions src/ntcore/Generated/DoubleArraySubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables DoubleArray subscriber. */
public interface IDoubleArraySubscriber : Subscriber
public interface IDoubleArraySubscriber : ISubscriber
{
/**
* Get the corresponding topic.
Expand Down Expand Up @@ -41,7 +41,7 @@ public interface IDoubleArraySubscriber : Subscriber
*
* @return timestamped value
*/
TimestampedDoubleArray GetAtomic();
TimestampedObject<double[]> GetAtomic();

/**
* Get the last published value along with its timestamp
Expand All @@ -51,7 +51,7 @@ public interface IDoubleArraySubscriber : Subscriber
* @param defaultValue default value to return if no value has been published
* @return timestamped value
*/
TimestampedDoubleArray GetAtomic(double[] defaultValue);
TimestampedObject<double[]> GetAtomic(double[] defaultValue);

/**
* Get an array of all value changes since the last call to readQueue.
Expand All @@ -63,7 +63,7 @@ public interface IDoubleArraySubscriber : Subscriber
* @return Array of timestamped values; empty array if no new changes have
* been published since the previous call.
*/
TimestampedDoubleArray[] ReadQueue();
TimestampedObject<double[]>[] ReadQueue();

/**
* Get an array of all value changes since the last call to readQueue.
Expand Down
14 changes: 7 additions & 7 deletions src/ntcore/Generated/DoubleEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,29 +50,29 @@ public double Get(double defaultValue)
}


public TimestampedDouble GetAtomic()
public TimestampedObject<double> GetAtomic()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
double baseValue = value.IsDouble ? value.GetDouble() : m_defaultValue;
return new TimestampedDouble(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<double>(value.Time, value.ServerTime, baseValue);
}


public TimestampedDouble GetAtomic(double defaultValue)
public TimestampedObject<double> GetAtomic(double defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
double baseValue = value.IsDouble ? value.GetDouble() : defaultValue;
return new TimestampedDouble(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<double>(value.Time, value.ServerTime, baseValue);
}


public TimestampedDouble[] ReadQueue()
public TimestampedObject<double>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
TimestampedDouble[] timestamped = new TimestampedDouble[values.Length];
TimestampedObject<double>[] timestamped = new TimestampedObject<double>[values.Length];
for (int i = 0; i < values.Length; i++)
{
timestamped[i] = new TimestampedDouble(values[i].Time, values[i].ServerTime, values[i].GetDouble());
timestamped[i] = new TimestampedObject<double>(values[i].Time, values[i].ServerTime, values[i].GetDouble());
}
return timestamped;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/DoublePublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables Double publisher. */
public interface IDoublePublisher : Publisher
public interface IDoublePublisher : IPublisher
{
/**
* Get the corresponding topic.
Expand Down
8 changes: 4 additions & 4 deletions src/ntcore/Generated/DoubleSubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables Double subscriber. */
public interface IDoubleSubscriber : Subscriber
public interface IDoubleSubscriber : ISubscriber
{
/**
* Get the corresponding topic.
Expand Down Expand Up @@ -41,7 +41,7 @@ public interface IDoubleSubscriber : Subscriber
*
* @return timestamped value
*/
TimestampedDouble GetAtomic();
TimestampedObject<double> GetAtomic();

/**
* Get the last published value along with its timestamp
Expand All @@ -51,7 +51,7 @@ public interface IDoubleSubscriber : Subscriber
* @param defaultValue default value to return if no value has been published
* @return timestamped value
*/
TimestampedDouble GetAtomic(double defaultValue);
TimestampedObject<double> GetAtomic(double defaultValue);

/**
* Get an array of all value changes since the last call to readQueue.
Expand All @@ -63,7 +63,7 @@ public interface IDoubleSubscriber : Subscriber
* @return Array of timestamped values; empty array if no new changes have
* been published since the previous call.
*/
TimestampedDouble[] ReadQueue();
TimestampedObject<double>[] ReadQueue();

/**
* Get an array of all value changes since the last call to readQueue.
Expand Down
14 changes: 7 additions & 7 deletions src/ntcore/Generated/FloatArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,29 +51,29 @@ public float[] Get(float[] defaultValue)
}


public TimestampedFloatArray GetAtomic()
public TimestampedObject<float[]> GetAtomic()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
float[] baseValue = value.IsFloatArray ? value.GetFloatArray() : m_defaultValue;
return new TimestampedFloatArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<float[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedFloatArray GetAtomic(float[] defaultValue)
public TimestampedObject<float[]> GetAtomic(float[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
float[] baseValue = value.IsFloatArray ? value.GetFloatArray() : defaultValue;
return new TimestampedFloatArray(value.Time, value.ServerTime, baseValue);
return new TimestampedObject<float[]>(value.Time, value.ServerTime, baseValue);
}


public TimestampedFloatArray[] ReadQueue()
public TimestampedObject<float[]>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
TimestampedFloatArray[] timestamped = new TimestampedFloatArray[values.Length];
TimestampedObject<float[]>[] timestamped = new TimestampedObject<float[]>[values.Length];
for (int i = 0; i < values.Length; i++)
{
timestamped[i] = new TimestampedFloatArray(values[i].Time, values[i].ServerTime, values[i].GetFloatArray());
timestamped[i] = new TimestampedObject<float[]>(values[i].Time, values[i].ServerTime, values[i].GetFloatArray());
}
return timestamped;
}
Expand Down
2 changes: 1 addition & 1 deletion src/ntcore/Generated/FloatArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace NetworkTables;

/** NetworkTables FloatArray publisher. */
public interface IFloatArrayPublisher : Publisher
public interface IFloatArrayPublisher : IPublisher
{
/**
* Get the corresponding topic.
Expand Down
Loading

0 comments on commit ebcbc0c

Please sign in to comment.