WPILibC++ 2023.4.3
Table Functions

Functions

NT_Entry NT_GetEntry (NT_Inst inst, const char *name, size_t name_len)
 Get Entry Handle. More...
 
char * NT_GetEntryName (NT_Entry entry, size_t *name_len)
 Gets the name of the specified entry. More...
 
enum NT_Type NT_GetEntryType (NT_Entry entry)
 Gets the type for the specified key, or unassigned if non existent. More...
 
uint64_t NT_GetEntryLastChange (NT_Entry entry)
 Gets the last time the entry was changed. More...
 
void NT_GetEntryValue (NT_Entry entry, struct NT_Value *value)
 Get Entry Value. More...
 
NT_Bool NT_SetDefaultEntryValue (NT_Entry entry, const struct NT_Value *default_value)
 Set Default Entry Value. More...
 
NT_Bool NT_SetEntryValue (NT_Entry entry, const struct NT_Value *value)
 Set Entry Value. More...
 
void NT_SetEntryFlags (NT_Entry entry, unsigned int flags)
 Set Entry Flags. More...
 
unsigned int NT_GetEntryFlags (NT_Entry entry)
 Get Entry Flags. More...
 
struct NT_ValueNT_ReadQueueValue (NT_Handle subentry, size_t *count)
 Read Entry Queue. More...
 

Detailed Description

Function Documentation

◆ NT_GetEntry()

NT_Entry NT_GetEntry ( NT_Inst  inst,
const char *  name,
size_t  name_len 
)

Get Entry Handle.

Parameters
instinstance handle
nameentry name (UTF-8 string)
name_lenlength of name in bytes
Returns
entry handle

◆ NT_GetEntryFlags()

unsigned int NT_GetEntryFlags ( NT_Entry  entry)

Get Entry Flags.

Parameters
entryentry handle
Returns
Flags value (bitmask of NT_EntryFlags)

◆ NT_GetEntryLastChange()

uint64_t NT_GetEntryLastChange ( NT_Entry  entry)

Gets the last time the entry was changed.

Returns 0 if the handle is invalid.

Parameters
entryentry handle
Returns
Entry last change time

◆ NT_GetEntryName()

char * NT_GetEntryName ( NT_Entry  entry,
size_t *  name_len 
)

Gets the name of the specified entry.

Returns an empty string if the handle is invalid.

Parameters
entryentry handle
name_lenlength of the returned string (output parameter)
Returns
Entry name

◆ NT_GetEntryType()

enum NT_Type NT_GetEntryType ( NT_Entry  entry)

Gets the type for the specified key, or unassigned if non existent.

Parameters
entryentry handle
Returns
Entry type

◆ NT_GetEntryValue()

void NT_GetEntryValue ( NT_Entry  entry,
struct NT_Value value 
)

Get Entry Value.

Returns copy of current entry value. Note that one of the type options is "unassigned".

Parameters
entryentry handle
valuestorage for returned entry value

It is the caller's responsibility to free value once it's no longer needed (the utility function NT_DisposeValue() is useful for this purpose).

◆ NT_ReadQueueValue()

struct NT_Value * NT_ReadQueueValue ( NT_Handle  subentry,
size_t *  count 
)

Read Entry Queue.

Returns new entry values since last call. The returned array must be freed using NT_DisposeValueArray().

Parameters
subentrysubscriber or entry handle
countcount of items in returned array (output)
Returns
entry value array; returns NULL and count=0 if no new values

◆ NT_SetDefaultEntryValue()

NT_Bool NT_SetDefaultEntryValue ( NT_Entry  entry,
const struct NT_Value default_value 
)

Set Default Entry Value.

Returns copy of current entry value if it exists. Otherwise, sets passed in value, and returns set value. Note that one of the type options is "unassigned".

Parameters
entryentry handle
default_valuevalue to be set if name does not exist
Returns
0 on error (value not set), 1 on success

◆ NT_SetEntryFlags()

void NT_SetEntryFlags ( NT_Entry  entry,
unsigned int  flags 
)

Set Entry Flags.

Parameters
entryentry handle
flagsflags value (bitmask of NT_EntryFlags)

◆ NT_SetEntryValue()

NT_Bool NT_SetEntryValue ( NT_Entry  entry,
const struct NT_Value value 
)

Set Entry Value.

Sets new entry value. If type of new value differs from the type of the currently stored entry, returns error and does not update value.

Parameters
entryentry handle
valuenew entry value
Returns
0 on error (type mismatch), 1 on success