10 #include "ErrorBase.h"
15 #include "HAL/cpp/Semaphore.hpp"
16 #include "tables/ITableListener.h"
17 #include "networktables/NetworkTable.h"
39 std::vector<std::string>
GetKeys();
53 "Saving is now automatically performed by the NetworkTables server.")
63 std::shared_ptr<ITable> m_table;
67 std::shared_ptr<nt::Value> value,
bool isNew)
override;
69 std::shared_ptr<nt::Value> value,
70 unsigned int flags)
override;
std::vector< std::string > GetKeys()
Returns a vector of all the keys.
Definition: Preferences.cpp:46
A table whose values can be read and written to.
Definition: ITable.h:43
bool GetBoolean(llvm::StringRef key, bool defaultValue=false)
Returns the boolean at the given key.
Definition: Preferences.cpp:100
void Remove(llvm::StringRef key)
Remove a preference.
Definition: Preferences.cpp:216
std::string GetString(llvm::StringRef key, llvm::StringRef defaultValue="")
Returns the string at the given key.
Definition: Preferences.cpp:55
void PutLong(llvm::StringRef key, int64_t value)
Puts the given long (int64_t) into the preferences table.
Definition: Preferences.cpp:190
bool ContainsKey(llvm::StringRef key)
Returns whether or not there is a key with the given name.
Definition: Preferences.cpp:208
Base class for most objects.
Definition: ErrorBase.h:66
void PutDouble(llvm::StringRef key, double value)
Puts the given double into the preferences table.
Definition: Preferences.cpp:151
A listener that listens to changes in values in a ITable.
Definition: ITableListener.h:18
void PutInt(llvm::StringRef key, int value)
Puts the given int into the preferences table.
Definition: Preferences.cpp:138
static Preferences * GetInstance()
Get the one and only Preferences object.
Definition: Preferences.cpp:37
double GetDouble(llvm::StringRef key, double defaultValue=0.0)
Returns the double at the given key.
Definition: Preferences.cpp:78
void PutString(llvm::StringRef key, llvm::StringRef value)
Puts the given string into the preferences table.
Definition: Preferences.cpp:125
void PutBoolean(llvm::StringRef key, bool value)
Puts the given boolean into the preferences table.
Definition: Preferences.cpp:177
float GetFloat(llvm::StringRef key, float defaultValue=0.0)
Returns the float at the given key.
Definition: Preferences.cpp:89
int GetInt(llvm::StringRef key, int defaultValue=0)
Returns the int at the given key.
Definition: Preferences.cpp:67
The preferences class provides a relatively simple way to save important values to the RoboRIO to acc...
Definition: Preferences.h:35
void PutFloat(llvm::StringRef key, float value)
Puts the given float into the preferences table.
Definition: Preferences.cpp:164
int64_t GetLong(llvm::StringRef key, int64_t defaultValue=0)
Returns the long (int64_t) at the given key.
Definition: Preferences.cpp:112
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:39