My Project
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
uuid::console::Commands::AvailableCommands::const_iterator Class Reference

Iterator of available commands for execution on a Shell. More...

#include <uuid/console.h>

Collaboration diagram for uuid::console::Commands::AvailableCommands::const_iterator:
Collaboration graph
[legend]

Public Types

using iterator_category = std::bidirectional_iterator_tag
 
using difference_type = std::size_t
 
using value_type = AvailableCommand
 
using pointer = const value_type *
 
using reference = const value_type &
 

Public Member Functions

 const_iterator (const Shell &shell, const command_iterator &begin, const command_iterator &command, const command_iterator &end)
 Create an iterator describing an available command in a shell with the current flags. More...
 
reference operator* () const
 Dereference the current available command. More...
 
pointer operator-> () const
 Access the current available command. More...
 
const_iteratoroperator++ ()
 Pre-increment the current iterator to the next available command. More...
 
const_iterator operator++ (int)
 Post-increment the current iterator to the next available command. More...
 
const_iteratoroperator-- ()
 Pre-decrement the current iterator to the previous available command. More...
 
const_iterator operator-- (int)
 Post-decrement the current iterator to the previous available command. More...
 

Private Member Functions

void update ()
 Update the available command from the current command iterator. More...
 

Private Attributes

const Shellshell_
 
const command_iterator begin_
 
command_iterator command_
 
const command_iterator end_
 
std::shared_ptr< AvailableCommandavailable_command_
 

Friends

bool operator== (const const_iterator &lhs, const const_iterator &rhs)
 Compare an available commands iterator to another available commands iterator for equality. More...
 
bool operator!= (const const_iterator &lhs, const const_iterator &rhs)
 Compare an available commands iterator to another available commands iterator for inequality. More...
 

Detailed Description

Iterator of available commands for execution on a Shell.

Since
0.9.0

Definition at line 219 of file console.h.

Member Typedef Documentation

◆ difference_type

Type used by std::distance().

Since
0.9.0

Definition at line 222 of file console.h.

◆ iterator_category

Category of this iterator (bidirectional).

Since
0.9.0

Definition at line 221 of file console.h.

◆ pointer

Pointer type of this iterator.

Since
0.9.0

Definition at line 224 of file console.h.

◆ reference

Reference type of this iterator.

Since
0.9.0

Definition at line 225 of file console.h.

◆ value_type

Type of this iterator's values.

Since
0.9.0

Definition at line 223 of file console.h.

Constructor & Destructor Documentation

◆ const_iterator()

uuid::console::Commands::AvailableCommands::const_iterator::const_iterator ( const Shell shell,
const command_iterator begin,
const command_iterator command,
const command_iterator end 
)

Create an iterator describing an available command in a shell with the current flags.

Iterators are invalidated if the commands, context or flags for the shell change.

Parameters
[in]shellShell that is accessing commands.
[in]beginBeginning of command iterators.
[in]commandInitial command iterator.
[in]endEnd of command iterators.
Since
0.9.0

Definition at line 62 of file commands_iterable.cpp.

Member Function Documentation

◆ operator*()

reference uuid::console::Commands::AvailableCommands::const_iterator::operator* ( ) const
inline

Dereference the current available command.

Returns
A pointer to the current available command, that remains valid only while the iterator at this position exists.
Since
0.9.0

Definition at line 251 of file console.h.

◆ operator++() [1/2]

Commands::AvailableCommands::const_iterator & uuid::console::Commands::AvailableCommands::const_iterator::operator++ ( )

Pre-increment the current iterator to the next available command.

Returns
The iterator to the next available command.
Since
0.9.0

Definition at line 77 of file commands_iterable.cpp.

◆ operator++() [2/2]

const_iterator uuid::console::Commands::AvailableCommands::const_iterator::operator++ ( int  )
inline

Post-increment the current iterator to the next available command.

Returns
The current iterator.
Since
0.9.0

Definition at line 277 of file console.h.

◆ operator--() [1/2]

Commands::AvailableCommands::const_iterator & uuid::console::Commands::AvailableCommands::const_iterator::operator-- ( )

Pre-decrement the current iterator to the previous available command.

Returns
The iterator to the previous available command.
Since
0.9.0

Definition at line 86 of file commands_iterable.cpp.

◆ operator--() [2/2]

const_iterator uuid::console::Commands::AvailableCommands::const_iterator::operator-- ( int  )
inline

Post-decrement the current iterator to the previous available command.

Returns
The current iterator.
Since
0.9.0

Definition at line 294 of file console.h.

◆ operator->()

pointer uuid::console::Commands::AvailableCommands::const_iterator::operator-> ( ) const
inline

Access the current available command.

Returns
A reference to the current available command, that remains valid only while the iterator at this position exists.
Since
0.9.0

Definition at line 260 of file console.h.

◆ update()

void uuid::console::Commands::AvailableCommands::const_iterator::update ( )
private

Update the available command from the current command iterator.

Since
0.9.0

Definition at line 69 of file commands_iterable.cpp.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const const_iterator lhs,
const const_iterator rhs 
)
friend

Compare an available commands iterator to another available commands iterator for inequality.

Parameters
[in]lhsLeft-hand side available commands iterator.
[in]rhsRight-hand side available commands iterator.
Returns
True if the available commands iterators are not equal, otherwise false.
Since
0.9.0

Definition at line 315 of file console.h.

◆ operator==

bool operator== ( const const_iterator lhs,
const const_iterator rhs 
)
friend

Compare an available commands iterator to another available commands iterator for equality.

Parameters
[in]lhsLeft-hand side available commands iterator.
[in]rhsRight-hand side available commands iterator.
Returns
True if the available commands iterators are equal, otherwise false.
Since
0.9.0

Definition at line 305 of file console.h.

Member Data Documentation

◆ available_command_

std::shared_ptr<AvailableCommand> uuid::console::Commands::AvailableCommands::const_iterator::available_command_
private

Current available command.

Since
0.9.0

Definition at line 329 of file console.h.

◆ begin_

const command_iterator uuid::console::Commands::AvailableCommands::const_iterator::begin_
private

Beginning of command iterators.

Since
0.9.0

Definition at line 326 of file console.h.

◆ command_

command_iterator uuid::console::Commands::AvailableCommands::const_iterator::command_
private

Current command iterator.

Since
0.9.0

Definition at line 327 of file console.h.

◆ end_

const command_iterator uuid::console::Commands::AvailableCommands::const_iterator::end_
private

End of command iterators.

Since
0.9.0

Definition at line 328 of file console.h.

◆ shell_

const Shell& uuid::console::Commands::AvailableCommands::const_iterator::shell_
private

Shell that is accessing commands.

Since
0.9.0

Definition at line 325 of file console.h.


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