|
libxr
1.0
Want to be the best embedded framework
|
模板类,表示数据库中的具体键 (Template class representing a specific key in the database). More...
#include <interface.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). | |
| Key (const Key &other)=delete | |
| 禁止拷贝数据库键对象 (Copy construction is disabled for database keys). | |
| Key (Key &&other)=delete | |
| 禁止移动数据库键对象 (Move construction is disabled for database keys). | |
| Key & | operator= (const Key &other)=delete |
| 禁止拷贝赋值数据库键对象 (Copy assignment is disabled for database keys). | |
| Key & | operator= (Key &&other)=delete |
| 禁止移动赋值数据库键对象 (Move assignment is disabled for database keys). | |
| operator Data () | |
| 类型转换运算符,返回存储的数据 (Type conversion operator returning stored data). | |
| ErrorCode | Save () |
| 保存当前键值到数据库 (Save the current key value to the database). | |
| 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). | |
Public Member Functions inherited from LibXR::Database::KeyBase | |
| 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). | |
Data Fields inherited from LibXR::Database::KeyBase | |
| 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 51 of file interface.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 68 of file interface.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 92 of file interface.hpp.
|
delete |
禁止拷贝数据库键对象 (Copy construction is disabled for database keys).
| other | 被拷贝的键对象 (Database key to copy from). |
|
delete |
禁止移动数据库键对象 (Move construction is disabled for database keys).
| other | 被转移的键对象 (Database key to move from). |
|
inline |
从数据库加载键的值 (Load the key's value from the database).
Definition at line 167 of file interface.hpp.
|
inline |
类型转换运算符,返回存储的数据 (Type conversion operator returning stored data).
Definition at line 141 of file interface.hpp.
|
delete |
禁止拷贝赋值数据库键对象 (Copy assignment is disabled for database keys).
| other | 被拷贝的键对象 (Database key to copy from). |
|
inline |
赋值运算符,设置键的值 (Assignment operator to set the key's value).
| data | 需要存储的新值 (New value to store). |
Definition at line 175 of file interface.hpp.
|
delete |
禁止移动赋值数据库键对象 (Move assignment is disabled for database keys).
| other | 被转移的键对象 (Database key to move from). |
|
inline |
保存当前键值到数据库 (Save the current key value to the database).
Definition at line 148 of file interface.hpp.
|
inline |
设置键的值并更新数据库 (Set the key's value and update the database).
| data | 需要存储的新值 (New value to store). |
Definition at line 156 of file interface.hpp.
| Data LibXR::Database::Key< Data >::data_ |
键存储的数据 (The data stored in the key).
Definition at line 54 of file interface.hpp.
| Database& LibXR::Database::Key< Data >::database_ |
关联的数据库对象 (Reference to the associated database).
Definition at line 55 of file interface.hpp.