Apollo  6.0
Open source self driving car software
Static Public Member Functions | List of all members
apollo::common::KVDB Class Reference

Lightweight key-value database to store system-wide parameters. We prefer keys like "apollo:data:commit_id". More...

#include <kv_db.h>

Collaboration diagram for apollo::common::KVDB:
Collaboration graph

Static Public Member Functions

static bool Put (std::string_view key, std::string_view value)
 Store {key, value} to DB. More...
 
static bool Delete (std::string_view key)
 Delete a key. More...
 
static std::optional< std::string > Get (std::string_view key)
 Get value of a key. More...
 

Detailed Description

Lightweight key-value database to store system-wide parameters. We prefer keys like "apollo:data:commit_id".

Member Function Documentation

◆ Delete()

static bool apollo::common::KVDB::Delete ( std::string_view  key)
static

Delete a key.

Returns
Success or not.

◆ Get()

static std::optional<std::string> apollo::common::KVDB::Get ( std::string_view  key)
static

Get value of a key.

Returns
An optional value. Use has_value() to check if there is non-empty value. Use value() to get real value. Use value_or("") to get existing value or fallback to default.

◆ Put()

static bool apollo::common::KVDB::Put ( std::string_view  key,
std::string_view  value 
)
static

Store {key, value} to DB.

Returns
Success or not.

The documentation for this class was generated from the following file: