Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 05libraries/sec01DesigningClasses.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ std::unique_ptr<AbstractDataManager> DataManagerFactory(std::vector &v)
{
if(v.size() < 1000)
{
return std::make_unique<ShortDataManager>(v);
return std::make_unique<SmallDataManager>(v);
}
else
{
Expand All @@ -439,7 +439,7 @@ std::unique_ptr<AbstractDataManager> DataManagerFactory(std::vector &v)
```

- `AbstractDataManager` is an abstract base class
- `ShortDataManager` and `LargeDataManager` are two concrete classes which inherit from `AbstractDataManager`, and are optimised for dealing with data on different scales.
- `SmallDataManager` and `LargeDataManager` are two concrete classes which inherit from `AbstractDataManager`, and are optimised for dealing with data on different scales.
- The factory uses the size of the data being passed in to make a decision about the approach that is going to be taken. The size of the vector is only known at runtime.

## Implementing Multiple Interfaces
Expand Down
Loading