Skip to content

Commit

Permalink
Add xml docs and format all C# functions
Browse files Browse the repository at this point in the history
  • Loading branch information
ThadHouse committed Feb 13, 2024
1 parent 0bb987f commit de1b7e5
Show file tree
Hide file tree
Showing 62 changed files with 3,734 additions and 4,196 deletions.
12 changes: 6 additions & 6 deletions src/ntcore/Generated/BooleanArrayEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

namespace NetworkTables;

/**
* NetworkTables BooleanArray entry.
*
* <p>Unlike NetworkTableEntry, the entry goes away when close() is called.
*/
/// <summary>
/// NetworkTables BooleanArray entry.
/// </summary>
public interface IBooleanArrayEntry : IBooleanArraySubscriber, IBooleanArrayPublisher
{
/** Stops publishing the entry if it's published. */
/// <summary>
/// Stops publishing the entry if its published.
/// </summary>
void Unpublish();
}
15 changes: 1 addition & 14 deletions src/ntcore/Generated/BooleanArrayEntryImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,8 @@

namespace NetworkTables;

/** NetworkTables BooleanArray implementation. */
internal sealed class BooleanArrayEntryImpl<T> : EntryBase<T>, IBooleanArrayEntry where T : struct, INtEntryHandle
{
/**
* Constructor.
*
* @param topic Topic
* @param handle Native handle
* @param defaultValue Default value for Get()
*/
internal BooleanArrayEntryImpl(BooleanArrayTopic topic, T handle, bool[] defaultValue) : base(handle)
{
Topic = topic;
Expand All @@ -28,7 +20,6 @@ internal BooleanArrayEntryImpl(BooleanArrayTopic topic, T handle, bool[] default

public override BooleanArrayTopic Topic { get; }


public bool[] Get()
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
Expand All @@ -39,7 +30,6 @@ public bool[] Get()
return m_defaultValue;
}


public bool[] Get(bool[] defaultValue)
{
NetworkTableValue value = NtCore.GetEntryValue(Handle);
Expand All @@ -50,23 +40,20 @@ public bool[] Get(bool[] defaultValue)
return defaultValue;
}


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


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


public TimestampedObject<bool[]>[] ReadQueue()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
Expand All @@ -78,7 +65,6 @@ public TimestampedObject<bool[]>[] ReadQueue()
return timestamped;
}


public bool[][] ReadQueueValues()
{
NetworkTableValue[] values = NtCore.ReadQueueValue(Handle);
Expand Down Expand Up @@ -108,6 +94,7 @@ public void SetDefault(ReadOnlySpan<bool> value)
RefNetworkTableValue ntValue = RefNetworkTableValue.MakeBooleanArray(value);
NtCore.SetDefaultEntryValue(Handle, ntValue);
}

public void Unpublish()
{
NtCore.Unpublish(Handle);
Expand Down
45 changes: 20 additions & 25 deletions src/ntcore/Generated/BooleanArrayPublisher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,39 +8,34 @@

namespace NetworkTables;

/** NetworkTables BooleanArray publisher. */
/// <summary>
/// NetworkTables BooleanArray publisher.
/// </summary>
public interface IBooleanArrayPublisher : IPublisher
{
/**
* Get the corresponding topic.
*
* @return Topic
*/

/// <summary>
/// Gets the corresponding topic.
/// </summary>
new BooleanArrayTopic Topic { get; }


/**
* Publish a new value using current NT time.
*
* @param value value to publish
*/
/// <summary>
/// Publish a new value using the current NT time.
/// </summary>
/// <param name="value">value to publish</param>
void Set(ReadOnlySpan<bool> value);

/**
* Publish a new value.
*
* @param value value to publish
* @param time timestamp; 0 indicates current NT time should be used
*/
/// <summary>
/// Publish a new value.
/// </summary>
/// <param name="value">value to publish</param>
/// <param name="time">timestamp; 0 indicates current NT time should be used</param>
void Set(ReadOnlySpan<bool> value, long time);

/**
* Publish a default value.
* On reconnect, a default value will never be used in preference to a
* published value.
*
* @param value value
*/
/// <summary>
/// Publish a default value. On reconnect, a default value will never be used
/// in prference to a published value
/// </summary>
/// <param name="value">value</param>
void SetDefault(ReadOnlySpan<bool> value);
}
97 changes: 43 additions & 54 deletions src/ntcore/Generated/BooleanArraySubscriber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,73 +6,62 @@

namespace NetworkTables;

/** NetworkTables BooleanArray subscriber. */
/// <summary>
/// NetworkTables BooleanArray subscriver.
/// </summary>
public interface IBooleanArraySubscriber : ISubscriber
{
/**
* Get the corresponding topic.
*
* @return Topic
*/

/// <summary>
/// Gets the corresponding topic.
/// </summary>
new BooleanArrayTopic Topic { get; }

/**
* Get the last published value.
* If no value has been published, returns the stored default value.
*
* @return value
*/
/// <summary>
/// Get the last published value.
/// If no value has been published, returns the stored default value.
/// </summary>
/// <returns>value</returns>
bool[] Get();

/**
* Get the last published value.
* If no value has been published, returns the passed defaultValue.
*
* @param defaultValue default value to return if no value has been published
* @return value
*/
/// <summary>
/// Get the last published value.
/// If no value has been published, returns the passed default value.
/// </summary>
/// <param name="defaultValue">default value to return if no value has been published</param>
/// <returns>value</returns>
bool[] Get(bool[] defaultValue);

/**
* Get the last published value along with its timestamp
* If no value has been published, returns the stored default value and a
* timestamp of 0.
*
* @return timestamped value
*/
/// <summary>
/// Get the last published value along with its timestamp.
/// If no value has been published, returns the stored default value and a timestamp of 0.
/// </summary>
/// <returns>timestamped value</returns>
TimestampedObject<bool[]> GetAtomic();

/**
* Get the last published value along with its timestamp
* If no value has been published, returns the passed defaultValue and a
* timestamp of 0.
*
* @param defaultValue default value to return if no value has been published
* @return timestamped value
*/
/// <summary>
/// Get the last published value along with its timestamp.
/// If no value has been published, returns the passed default value and a timestamp of 0.
/// </summary>
/// <param name="defaultValue">default value to return if no value has been published</param>
/// <returns>timestamped value</returns>
TimestampedObject<bool[]> GetAtomic(bool[] defaultValue);

/**
* Get an array of all value changes since the last call to readQueue.
* Also provides a timestamp for each value.
*
* <p>The "poll storage" subscribe option can be used to set the queue
* depth.
*
* @return Array of timestamped values; empty array if no new changes have
* been published since the previous call.
*/
/// <summary>
/// Get an array of all value changes since the last call to ReadQueue.
/// Also provides a timestamp for each value.
/// </summary>
/// <remarks>
/// The "poll storage" subscribe option can be used to set the queue depth.
/// </remarks
/// <returns>Array of timestamped values; emptry if no new changes</returns>
TimestampedObject<bool[]>[] ReadQueue();

/**
* Get an array of all value changes since the last call to readQueue.
*
* <p>The "poll storage" subscribe option can be used to set the queue
* depth.
*
* @return Array of values; empty array if no new changes have been
* published since the previous call.
*/
/// <summary>
/// Get an array of all value changes since the last call to ReadQueue.
/// </summary>
/// <remarks>
/// The "poll storage" subscribe option can be used to set the queue depth.
/// </remarks
/// <returns>Array of values; emptry if no new changes</returns>
bool[][] ReadQueueValues();
}
Loading

0 comments on commit de1b7e5

Please sign in to comment.