Skip to content

Commit

Permalink
several improvements but nested output min creation in constructors a…
Browse files Browse the repository at this point in the history
…re not ok yet
  • Loading branch information
rbouqueau committed May 1, 2016
1 parent b290a1f commit 95bab10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/lib_modules/core/output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class IOutputCap {
return safe_cast<InstanceType>(p);
}

private:
virtual size_t getAllocatorSize() const = 0;
virtual void addOutputInternal(IOutput *p) = 0;
};
Expand All @@ -97,7 +96,7 @@ class OutputCap : public virtual IOutputCap {
return outputs[i].get();
}

private:
protected:
virtual size_t getAllocatorSize() const override {
assert(allocatorSize > 0);
return allocatorSize;
Expand All @@ -106,6 +105,7 @@ class OutputCap : public virtual IOutputCap {
outputs.push_back(uptr(p));
}

private:
std::vector<std::unique_ptr<IOutput>> outputs;
const size_t allocatorSize;
};
Expand Down
6 changes: 3 additions & 3 deletions src/lib_modules/utils/helper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@

namespace Modules {

/* this default factory creates output pins with the default output - create nother one for other uses such as low latency */
/* this default factory creates output pins with the default output - create another one for other uses such as low latency */
template <typename InstanceType>
struct ModuleDefault : public InstanceType, public OutputCap {
struct ModuleDefault : public virtual OutputCap, public virtual InstanceType {
template <typename ...Args>
ModuleDefault(size_t allocatorSize, Args&&... args) : InstanceType(std::forward<Args>(args)...), OutputCap(allocatorSize) {}
ModuleDefault(size_t allocatorSize, Args&&... args) : OutputCap(allocatorSize), InstanceType(std::forward<Args>(args)...) {}
};

template <typename InstanceType, typename ...Args>
Expand Down

0 comments on commit 95bab10

Please sign in to comment.