libxr
Embedded C++ framework for bare-metal, RTOS and Linux
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
 

Public Attributes

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

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
 
FsNode & operator= (const FsNode &)=delete
 
- Protected Attributes inherited from LibXR::RamFS::FsNode
const char * name_ = nullptr
 节点名称缓冲区 / Retained node-name buffer.
 
FsNodeType type_
 节点运行时类型 / Runtime node type.
 
Dir * parent_
 父目录;根目录保持为空 / 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()

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 94 of file ramfs.cpp.

94 : Custom()
95{
96 this->name_ = DuplicateName(name);
97 this->kind_ = kind;
98 this->context_ = context;
99}
RamFS 的自定义节点片段 / Custom-node fragment of RamFS
Definition custom.hpp:10
void * context_
用户自管上下文指针 / Caller-owned user context pointer.
Definition ramfs.hpp:24
uint32_t kind_
用户定义类型标签 / User-defined kind tag.
Definition ramfs.hpp:23
const char * name_
节点名称缓冲区 / Retained node-name buffer.
Definition ramfs.hpp:25

Member Data 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: