diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:25:12 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2015-10-02 21:25:12 +0100 |
commit | c9382a9c89ce03f1fcde3fadd294a3938b894e47 (patch) | |
tree | 7e5de1834f121b44f2485132741a6b3fe8431129 /project2/compression/decompressStream.cpp | |
parent | Compat fix (diff) | |
parent | Big tidy up of loggers and logger factories (diff) | |
download | project2-c9382a9c89ce03f1fcde3fadd294a3938b894e47.tar.bz2 project2-c9382a9c89ce03f1fcde3fadd294a3938b894e47.tar.xz project2-c9382a9c89ce03f1fcde3fadd294a3938b894e47.zip |
Merge branch 'project2-adhoc-plugins'
Diffstat (limited to 'project2/compression/decompressStream.cpp')
-rw-r--r-- | project2/compression/decompressStream.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/project2/compression/decompressStream.cpp b/project2/compression/decompressStream.cpp index c1d52ab..7d4023b 100644 --- a/project2/compression/decompressStream.cpp +++ b/project2/compression/decompressStream.cpp @@ -1,10 +1,8 @@ #include "stream.h" -#include "componentLoader.h" #include "decompressor.h" #include "scripts.h" #include "variables.h" #include "scriptStorage.h" -#include "instanceStore.impl.h" class DecompressStream : public Stream { public: @@ -12,12 +10,12 @@ class DecompressStream : public Stream { Stream(p), method(p, "method") { - p->script->loader.addLoadTarget(p, Storer::into<ElementLoader>(&stream)); + p->script->loader.addLoadTarget(p, Storer::into<StreamFactory>(&stream)); } void runStream(const Sink & sink, ExecContext * ec) const { - DecompressorPtr decomp = DecompressorLoader::getFor(method(ec))->create(); + DecompressorPtr decomp = DecompressorFactory::createNew(method(ec)); stream->runStream([&](const char * data, size_t len) -> size_t { decomp->decompress(data, len, sink); return len; @@ -28,6 +26,5 @@ class DecompressStream : public Stream { const Variable method; }; -DECLARE_LOADER("decompstream", DecompressStream); -INSTANTIATESTORE(std::string, DecompressorLoader); +NAMEDFACTORY("decompstream", DecompressStream, StreamFactory); |