libxr 1.0
Want to be the best embedded framework
|
模板类,表示数据库中的具体键 (Template class representing a specific key in the database). More...
#include <database.hpp>
Public Member Functions | |
Key (Database &database, const char *name, Data init_value) | |
构造函数,初始化键并从数据库加载数据 (Constructor to initialize key and load data from the database). | |
Key (Database &database, const char *name) | |
构造函数,初始化键,并在数据库不存在时赋默认值 (Constructor to initialize key, assigning default value if not found in the database). | |
operator Data () | |
类型转换运算符,返回存储的数据 (Type conversion operator returning stored data). | |
ErrorCode | Set (Data data) |
设置键的值并更新数据库 (Set the key's value and update the database). | |
ErrorCode | Load () |
从数据库加载键的值 (Load the key's value from the database). | |
ErrorCode | operator= (Data data) |
赋值运算符,设置键的值 (Assignment operator to set the key's value). | |
![]() | |
KeyBase (const char *name, RawData raw_data) | |
构造函数,初始化键名和原始数据 (Constructor to initialize key name and raw data). | |
Data Fields | |
Data | data_ |
键存储的数据 (The data stored in the key). | |
Database & | database_ |
关联的数据库对象 (Reference to the associated database). | |
![]() | |
const char * | name_ |
键名 (Key name). | |
RawData | raw_data_ |
原始数据 (Raw data associated with the key). | |
模板类,表示数据库中的具体键 (Template class representing a specific key in the database).
Data | 存储的数据类型 (The type of data stored). |
Definition at line 48 of file database.hpp.
|
inline |
构造函数,初始化键并从数据库加载数据 (Constructor to initialize key and load data from the database).
If the key does not exist in the database, it is initialized with the provided value. 如果键在数据库中不存在,则使用提供的值进行初始化。
database | 关联的数据库对象 (Reference to the associated database). |
name | 键名 (Key name). |
init_value | 初始化值 (Initial value for the key). |
Definition at line 65 of file database.hpp.
|
inline |
构造函数,初始化键,并在数据库不存在时赋默认值 (Constructor to initialize key, assigning default value if not found in the database).
If the key does not exist in the database, it is initialized with zero. 如果键在数据库中不存在,则初始化为零。
database | 关联的数据库对象 (Reference to the associated database). |
name | 键名 (Key name). |
Definition at line 85 of file database.hpp.
|
inline |
从数据库加载键的值 (Load the key's value from the database).
Definition at line 113 of file database.hpp.
|
inline |
类型转换运算符,返回存储的数据 (Type conversion operator returning stored data).
Definition at line 100 of file database.hpp.
|
inline |
赋值运算符,设置键的值 (Assignment operator to set the key's value).
data | 需要存储的新值 (New value to store). |
Definition at line 120 of file database.hpp.
|
inline |
设置键的值并更新数据库 (Set the key's value and update the database).
data | 需要存储的新值 (New value to store). |
Definition at line 107 of file database.hpp.
Data LibXR::Database::Key< Data >::data_ |
键存储的数据 (The data stored in the key).
Definition at line 51 of file database.hpp.
Database& LibXR::Database::Key< Data >::database_ |
关联的数据库对象 (Reference to the associated database).
Definition at line 52 of file database.hpp.