mirror of
https://github.com/xfarrow/lasd.git
synced 2025-06-05 21:49:14 +02:00
Library 3
container & iterator.hpp
This commit is contained in:
26
librerie/exercise3/queue/queue.hpp
Normal file → Executable file
26
librerie/exercise3/queue/queue.hpp
Normal file → Executable file
@ -13,44 +13,40 @@ namespace lasd {
|
||||
/* ************************************************************************** */
|
||||
|
||||
template <typename Data>
|
||||
class Queue { // Must extend Container
|
||||
class Queue : virtual public Container{ // Must extend Container
|
||||
|
||||
private:
|
||||
|
||||
// ...
|
||||
|
||||
protected:
|
||||
|
||||
// ...
|
||||
|
||||
public:
|
||||
|
||||
// Destructor
|
||||
// ~Queue() specifiers
|
||||
~Queue() = default;
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Copy assignment
|
||||
// type operator=(argument); // Copy assignment of abstract types should not be possible.
|
||||
Queue& operator=(const Queue&) = delete; // Copy assignment of abstract types should not be possible.
|
||||
|
||||
// Move assignment
|
||||
// type operator=(argument); // Move assignment of abstract types should not be possible.
|
||||
Queue& operator=(Queue&&) = delete; // Move assignment of abstract types should not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Comparison operators
|
||||
// type operator==(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
// type operator!=(argument) specifiers; // Comparison of abstract types might not be possible.
|
||||
bool operator==(const Queue&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
bool operator!=(const Queue&) const noexcept = delete; // Comparison of abstract types might not be possible.
|
||||
|
||||
/* ************************************************************************ */
|
||||
|
||||
// Specific member functions
|
||||
|
||||
// type Enqueue(argument) specifiers; // Copy of the value
|
||||
// type Enqueue(argument) specifiers; // Move of the value
|
||||
// type Head() specifiers; // (concrete function must throw std::length_error when empty)
|
||||
// type Dequeue() specifiers; // (concrete function must throw std::length_error when empty)
|
||||
// type HeadNDequeue() specifiers; // (concrete function must throw std::length_error when empty)
|
||||
virtual void Enqueue(const Data&) = 0; // Copy of the value
|
||||
virtual void Enqueue(Data&&) = 0; // Move of the value
|
||||
virtual Data& Head() const = 0; // (concrete function must throw std::length_error when empty)
|
||||
virtual void Dequeue() = 0; // (concrete function must throw std::length_error when empty)
|
||||
virtual Data HeadNDequeue() = 0; // (concrete function must throw std::length_error when empty)
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user