libxr  1.0
Want to be the best embedded framework
Loading...
Searching...
No Matches
LibXR::RamFS::Custom Class Reference

自定义节点片段 / Custom-node fragment More...

#include <ramfs.hpp>

Inheritance diagram for LibXR::RamFS::Custom:
[legend]
Collaboration diagram for LibXR::RamFS::Custom:
[legend]

Public Member Functions

 Custom (const char *name, uint32_t kind=0, void *context=nullptr)
 构造自定义节点 / Construct a custom node
 
- Public Member Functions inherited from LibXR::RamFS::FsNode
FsNodeType GetNodeType () const
 获取节点类型 / Get the node type
 
const char * GetName () const
 获取节点名称 / Get the node name
 

Data Fields

uint32_t kind_ = 0
 用户定义类型标签 / User-defined kind tag.
 
void * context_ = nullptr
 用户自管上下文指针 / Caller-owned user context pointer.
 

Private Member Functions

 Custom ()
 构造一个空自定义节点壳 / Construct one empty custom-node shell
 

Additional Inherited Members

- Protected Member Functions inherited from LibXR::RamFS::FsNode
 FsNode (FsNodeType node_type)
 用指定节点类型构造基类部分 / Construct the base node with a given node type
 
 FsNode (const FsNode &other)
 拷贝构造节点基类部分 / Copy-construct the base-node portion
 
FsNodeoperator= (const FsNode &)=delete
 
- Protected Attributes inherited from LibXR::RamFS::FsNode
const char * name_ = nullptr
 节点名称缓冲区 / Retained node-name buffer.
 
FsNodeType type_
 节点运行时类型 / Runtime node type.
 
Dirparent_
 父目录;根目录保持为空 / Parent directory; stays null for the root.
 
Tree::Node< FsNode * > tree_node_
 

Detailed Description

自定义节点片段 / Custom-node fragment

RamFS 的自定义节点片段 / Custom-node fragment of RamFS

用户自定义节点,RamFS 仅负责命名和查找 / User-defined node; RamFS only stores and finds it by name

Definition at line 10 of file ramfs.hpp.

Constructor & Destructor Documentation

◆ Custom() [1/2]

RamFS::Custom::Custom ( const char * name,
uint32_t kind = 0,
void * context = nullptr )
explicit

构造自定义节点 / Construct a custom node

构造一个具名自定义节点 Construct one named custom node

Parameters
name节点名称 / Node name
kind用户定义类型 / User-defined kind
context用户上下文指针 / User context pointer
Note
包含动态内存分配 / Contains dynamic memory allocation
Parameters
name节点名称 / Node name
kind用户定义类型 / User-defined kind
context用户上下文指针 / User context pointer

Definition at line 99 of file ramfs.cpp.

99 : Custom()
100{
101 this->name_ = DuplicateName(name);
102 this->kind_ = kind;
103 this->context_ = context;
104}
void * context_
用户自管上下文指针 / Caller-owned user context pointer.
Definition ramfs.hpp:24
Custom()
构造一个空自定义节点壳 / Construct one empty custom-node shell
Definition ramfs.cpp:90
uint32_t kind_
用户定义类型标签 / User-defined kind tag.
Definition ramfs.hpp:23
const char * name_
节点名称缓冲区 / Retained node-name buffer.
Definition ramfs.hpp:25
static char * DuplicateName(const char *name)
复制并持有一个节点名称 / Duplicate and retain one node name
Definition ramfs.cpp:29

◆ Custom() [2/2]

RamFS::Custom::Custom ( )
private

构造一个空自定义节点壳 / Construct one empty custom-node shell

构造一个空自定义节点壳 Construct one empty custom-node shell

Definition at line 90 of file ramfs.cpp.

FsNode(FsNodeType node_type)
用指定节点类型构造基类部分 / Construct the base node with a given node type
Definition ramfs.cpp:47
@ CUSTOM
用户自定义节点 / User-defined node

Field Documentation

◆ context_

void* LibXR::RamFS::Custom::context_ = nullptr

用户自管上下文指针 / Caller-owned user context pointer.

Definition at line 24 of file ramfs.hpp.

◆ kind_

uint32_t LibXR::RamFS::Custom::kind_ = 0

用户定义类型标签 / User-defined kind tag.

Definition at line 23 of file ramfs.hpp.


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