summaryrefslogtreecommitdiff
path: root/src/system_fsm/include
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-10-30 15:47:38 +1100
committerjacqueline <me@jacqueline.id.au>2023-10-30 15:52:26 +1100
commitb58c08150853b8055093dc116d407ffd543f8ec8 (patch)
tree9b82d130d2c833fc234bca0f12f0fba1b7202c4d /src/system_fsm/include
parent18d90051c9145ead86d4da701a2bc54f45e4fb66 (diff)
downloadtangara-fw-b58c08150853b8055093dc116d407ffd543f8ec8.tar.gz
add locale-aware colation to db indexes
Diffstat (limited to 'src/system_fsm/include')
-rw-r--r--src/system_fsm/include/service_locator.hpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/system_fsm/include/service_locator.hpp b/src/system_fsm/include/service_locator.hpp
index 1dcf0f5e..24dc1eb9 100644
--- a/src/system_fsm/include/service_locator.hpp
+++ b/src/system_fsm/include/service_locator.hpp
@@ -10,6 +10,7 @@
#include "battery.hpp"
#include "bluetooth.hpp"
+#include "collation.hpp"
#include "database.hpp"
#include "gpios.hpp"
#include "nvs.hpp"
@@ -101,6 +102,15 @@ class ServiceLocator {
queue_ = std::move(i);
}
+ auto collator() -> locale::ICollator& {
+ assert(collator_ != nullptr);
+ return *collator_;
+ }
+
+ auto collator(std::unique_ptr<locale::ICollator> i) {
+ collator_ = std::move(i);
+ }
+
// Not copyable or movable.
ServiceLocator(const ServiceLocator&) = delete;
ServiceLocator& operator=(const ServiceLocator&) = delete;
@@ -117,6 +127,7 @@ class ServiceLocator {
std::shared_ptr<database::Database> database_;
std::unique_ptr<database::ITagParser> tag_parser_;
+ std::unique_ptr<locale::ICollator> collator_;
drivers::SdState sd_;
};