Data Structures in C++
Public Member Functions
Queue< T > Class Template Referenceabstract

Abstract queue interface. More...

#include <Queue.hpp>

Inheritance diagram for Queue< T >:
Collaboration diagram for Queue< T >:

Public Member Functions

std::string getName ()
 Provides the name of the data structure as a string representation. More...
 
virtual void enqueue (T val)=0
 Add an element to the end of the queue. More...
 
virtual T dequeue ()=0
 Remove an element from the queue. More...
 
virtual T peek ()=0
 See the first value from the queue, without removing it. More...
 
- Public Member Functions inherited from DataStructure
virtual int getSize ()=0
 Outputs the number of elements stored in the structure. More...
 
virtual bool isEmpty ()=0
 Check whether the structure is empty. More...
 
virtual bool isFull ()=0
 Check whether the structure is full. More...
 

Detailed Description

template<class T>
class Queue< T >

Abstract queue interface.

Author
Douglas De Rizzo Meneghetti (dougl.nosp@m.asri.nosp@m.zzom@.nosp@m.gmai.nosp@m.l.com)
Date
2017-6-14Abstract queue interface
Template Parameters
TThe type of object the data structure will contain

Definition at line 16 of file Queue.hpp.

Member Function Documentation

◆ dequeue()

template<class T>
virtual T Queue< T >::dequeue ( )
pure virtual

Remove an element from the queue.

Returns
the value that is being removed

Implemented in StaticQueue< T >, and DynamicQueue< T >.

◆ enqueue()

template<class T>
virtual void Queue< T >::enqueue ( val)
pure virtual

Add an element to the end of the queue.

Parameters
valthe value to be added to the queue

Implemented in StaticQueue< T >, and DynamicQueue< T >.

◆ getName()

template<class T>
std::string Queue< T >::getName ( )
inlinevirtual

Provides the name of the data structure as a string representation.

Returns
name of the data structure

Implements DataStructure.

Reimplemented in DynamicQueue< T >.

Definition at line 19 of file Queue.hpp.

19 { return "Queue Interface"; }

◆ peek()

template<class T>
virtual T Queue< T >::peek ( )
pure virtual

See the first value from the queue, without removing it.

Returns
The first value on the queue

Implemented in StaticQueue< T >, and DynamicQueue< T >.


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