-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAbstractBowl.cppm
More file actions
32 lines (23 loc) · 766 Bytes
/
Copy pathAbstractBowl.cppm
File metadata and controls
32 lines (23 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
export module AbstractBowl;
import AbstractFruit;
import std;
#include "bowls_export.h"
export class BOWLS_EXPORT AbstractBowl {
public:
AbstractBowl() = default;
AbstractBowl &operator=(AbstractBowl const &) = delete;
AbstractBowl(AbstractBowl const &) = delete;
virtual ~AbstractBowl();
std::unique_ptr<AbstractFruit> takeAt(int index);
/// Add a fruit to the bowl.
/// Return the fruit to you if it is not accepted. Return an empty unique_ptr
/// otherwise
virtual std::unique_ptr<AbstractFruit>
add(std::unique_ptr<AbstractFruit> fruit) = 0;
int size() const { return m_fruits.size(); }
protected:
void doAdd(std::unique_ptr<AbstractFruit> fruit);
private:
std::vector<std::unique_ptr<AbstractFruit>> m_fruits;
};