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. | |
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 127 of file libxr_type.hpp.
使用指定地址和大小构造 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 139 of file libxr_type.hpp.
|
inline |
默认构造函数,初始化为空数据。 Default constructor initializing to empty data.
Definition at line 145 of file libxr_type.hpp.
使用任意数据类型构造 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 159 of file libxr_type.hpp.
|
default |
拷贝构造函数。 Copy constructor.
data | 另一个 ConstRawData 对象。 Another ConstRawData object. |
从 RawData
构造 ConstRawData
,数据地址和大小保持不变。 Constructs ConstRawData
from RawData
, keeping the same data address and size.
Definition at line 181 of file libxr_type.hpp.
|
inline |
从 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 191 of file libxr_type.hpp.
从 char *
指针构造 ConstRawData
(常量版本)。 Constructs ConstRawData
from a const char *
pointer.
data | C 风格字符串指针。 A C-style string pointer. |
Definition at line 200 of file libxr_type.hpp.
|
default |
赋值运算符重载。 Overloaded assignment operator.
data | 另一个 ConstRawData 对象。 Another ConstRawData object. |
ConstRawData
对象引用。 Returns a reference to the assigned ConstRawData
object. 数据存储地址(常量)。 The storage address of the data (constant).
Definition at line 214 of file libxr_type.hpp.
size_t LibXR::ConstRawData::size_ |
数据大小(字节)。 The size of the data (in bytes).
Definition at line 215 of file libxr_type.hpp.