|
libxr
1.0
Want to be the best embedded framework
|
常量原始数据封装类。 A class for encapsulating constant raw data. More...
#include <libxr_type.hpp>
Public Member Functions | |
| ConstRawData (const void *addr, size_t size) | |
使用指定地址和大小构造 ConstRawData 对象。 Constructs a ConstRawData object with the specified address and size. | |
| ConstRawData () | |
| 默认构造函数,初始化为空数据。 Default constructor initializing to empty data. | |
| template<typename DataType > | |
| ConstRawData (const DataType &data) | |
使用任意数据类型构造 ConstRawData,数据地址指向该对象,大小为该类型的字节大小。 Constructs ConstRawData using any data type, pointing to the object and setting the size to the type's byte size. | |
| ConstRawData (const ConstRawData &data)=default | |
| 拷贝构造函数。 Copy constructor. | |
| ConstRawData (const RawData &data) | |
从 RawData 构造 ConstRawData,数据地址和大小保持不变。 Constructs ConstRawData from RawData, keeping the same data address and size. | |
| ConstRawData (char *data) | |
从 char * 指针构造 ConstRawData,数据大小为字符串长度(不含 \0)。 Constructs ConstRawData from a char * pointer, with size set to the string length (excluding \0). | |
| ConstRawData (const char *data) | |
从 char * 指针构造 ConstRawData(常量版本)。 Constructs ConstRawData from a const char * pointer. | |
| template<size_t N> | |
| ConstRawData (const char(&data)[N]) | |
从字符数组构造 ConstRawData,数据大小为数组长度减 1(不含 \0)。 Constructs ConstRawData from a character array, with size set to array length minus 1 (excluding \0). | |
| ConstRawData & | operator= (const ConstRawData &data)=default |
| 赋值运算符重载。 Overloaded assignment operator. | |
Data Fields | |
| const void * | addr_ |
| 数据存储地址(常量)。 The storage address of the data (constant). | |
| size_t | size_ |
| 数据大小(字节)。 The size of the data (in bytes). | |
常量原始数据封装类。 A class for encapsulating constant raw data.
该类与 RawData 类似,但存储的数据地址是 const 类型, 以确保数据不可修改。 This class is similar to RawData, but the stored data address is const, ensuring the data remains immutable.
Definition at line 124 of file libxr_type.hpp.
| ConstRawData::ConstRawData | ( | const void * | addr, |
| size_t | size ) |
使用指定地址和大小构造 ConstRawData 对象。 Constructs a ConstRawData object with the specified address and size.
| addr | 数据的起始地址。 The starting address of the data. |
| size | 数据的大小(字节)。 The size of the data (in bytes). |
Definition at line 11 of file libxr_type.cpp.
| ConstRawData::ConstRawData | ( | ) |
默认构造函数,初始化为空数据。 Default constructor initializing to empty data.
Definition at line 13 of file libxr_type.cpp.
|
inline |
使用任意数据类型构造 ConstRawData,数据地址指向该对象,大小为该类型的字节大小。 Constructs ConstRawData using any data type, pointing to the object and setting the size to the type's byte size.
| DataType | 数据类型。 The data type. |
| data | 需要存储的具体数据。 The actual data to be stored. |
Definition at line 156 of file libxr_type.hpp.
|
default |
拷贝构造函数。 Copy constructor.
| data | 另一个 ConstRawData 对象。 Another ConstRawData object. |
| ConstRawData::ConstRawData | ( | const RawData & | data | ) |
从 RawData 构造 ConstRawData,数据地址和大小保持不变。 Constructs ConstRawData from RawData, keeping the same data address and size.
Definition at line 15 of file libxr_type.cpp.
| ConstRawData::ConstRawData | ( | char * | data | ) |
从 char * 指针构造 ConstRawData,数据大小为字符串长度(不含 \0)。 Constructs ConstRawData from a char * pointer, with size set to the string length (excluding \0).
| data | C 风格字符串指针。 A C-style string pointer. |
Definition at line 17 of file libxr_type.cpp.
| ConstRawData::ConstRawData | ( | const char * | data | ) |
从 char * 指针构造 ConstRawData(常量版本)。 Constructs ConstRawData from a const char * pointer.
| data | C 风格字符串指针。 A C-style string pointer. |
Definition at line 19 of file libxr_type.cpp.
|
inline |
从字符数组构造 ConstRawData,数据大小为数组长度减 1(不含 \0)。 Constructs ConstRawData from a character array, with size set to array length minus 1 (excluding \0).
| N | 数组大小。 The array size. |
| data | 需要存储的字符数组。 The character array to be stored. |
Definition at line 210 of file libxr_type.hpp.
|
default |
赋值运算符重载。 Overloaded assignment operator.
| data | 另一个 ConstRawData 对象。 Another ConstRawData object. |
ConstRawData 对象引用。 Returns a reference to the assigned ConstRawData object. | const void* LibXR::ConstRawData::addr_ |
数据存储地址(常量)。 The storage address of the data (constant).
Definition at line 227 of file libxr_type.hpp.
| size_t LibXR::ConstRawData::size_ |
数据大小(字节)。 The size of the data (in bytes).
Definition at line 228 of file libxr_type.hpp.