1 Star 0 Fork 5.3K

OpenHarmony_EU incubator / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ohos-list-t.md 13.91 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

OHOS::List< T >

Overview

Related Modules:

Graphic

Description:

Defines a linked list template class, which implements the data structure of bidirectional linked list and provides basic functions such as adding, deleting, inserting, clearing, popping up, and obtaining the size of the linked list.

Since:

1.0

Version:

1.0

Summary

Public Member Functions

Public Member Function Name

Description

List ()

A default constructor used to create a List instance. The initial size is 0.

~List ()

virtual

A destructor used to delete the List instance.

Front () const

const T

Obtains the head node data of a linked list.

Back () const

const T

Obtains the tail node data of a linked list.

PushBack (T data)

void

Inserts data at the end of a linked list.

PushFront (T data)

void

Inserts data at the start of a linked list.

PopBack ()

void

Pops up a data record at the end of a linked list.

PopFront ()

void

Pops up a data record at the start of a linked list.

Insert (ListNode< T > *node, T data)

void

Inserts data before a specified node, which follows the inserted data node.

Remove (ListNode< T > *node)

void

Deletes a data node.

Clear ()

void

Deletes all nodes from a linked list.

Head () const

ListNode< T > *

Obtains the head node address of a linked list.

Tail () const

ListNode< T > *

Obtains the tail node address of a linked list.

Begin () const

ListNode< T > *

Obtains the head node address of a linked list.

End () const

const ListNode< T > *

Obtains the end node address of a linked list.

Next (const ListNode< T > *node) const

ListNode< T > *

Obtains the address of the node following the specified node.

IsEmpty () const

bool

Checks whether a linked list is empty.

Size () const

uint16_t

Obtains the size of a linked list.

operator new (size_t size)

void *

Overrides the new function.

operator delete (void *p)

void

Overrides the delete function.

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/open-harmony-eu-incubator/docs.git
git@gitee.com:open-harmony-eu-incubator/docs.git
open-harmony-eu-incubator
docs
docs
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891