TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
data_structures::linked_list::link Class Reference
Collaboration diagram for data_structures::linked_list::link:
[legend]

Public Member Functions

int val ()
 
std::shared_ptr< link > & succ ()
 
 link (int value=0)
 

Private Attributes

int pvalue
 value of the current link
 
std::shared_ptr< linkpsucc
 pointer to the next value on the list
 

Detailed Description

A link class containing a value and pointer to another link

Definition at line 53 of file linked_list.cpp.

Constructor & Destructor Documentation

◆ link()

data_structures::linked_list::link::link ( int value = 0)
inlineexplicit

Creates link with provided value and pointer to next link

Parameters
valueis the integer stored in the link

Definition at line 75 of file linked_list.cpp.

75: pvalue(value), psucc(nullptr) {}

Member Function Documentation

◆ succ()

std::shared_ptr< link > & data_structures::linked_list::link::succ ( )
inline

function returns the pointer to next link

Returns
the pointer to the next link

Definition at line 69 of file linked_list.cpp.

69{ return psucc; }

◆ val()

int data_structures::linked_list::link::val ( )
inline

function returns the integer value stored in the link.

Returns
the integer value stored in the link.

Definition at line 63 of file linked_list.cpp.

63{ return pvalue; }

Member Data Documentation

◆ psucc

std::shared_ptr<link> data_structures::linked_list::link::psucc
private

pointer to the next value on the list

Definition at line 56 of file linked_list.cpp.

◆ pvalue

int data_structures::linked_list::link::pvalue
private

value of the current link

Definition at line 55 of file linked_list.cpp.


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