Commit dd159d08 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen Committed by Rémi Denis-Courmont

dash: Removing factory another class instantiation.

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent c1a6296e
......@@ -40,8 +40,7 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda
this->node = node;
this->logicType = type;
this->profile = profile;
this->mpdManagerFactory = new MPDManagerFactory();
this->mpdManager = this->mpdManagerFactory->create(this->profile, this->node);
this->mpdManager = mpd::MPDManagerFactory::create(this->profile, this->node);
this->adaptationLogic = AdaptationLogicFactory::create( this->logicType, this->mpdManager );
this->currentChunk = NULL;
......@@ -50,7 +49,6 @@ DASHManager::DASHManager (HTTPConnectionManager *conManager, Node *node, IAda
DASHManager::~DASHManager ()
{
delete(this->adaptationLogic);
delete(this->mpdManager);
}
int DASHManager::read (void *p_buffer, size_t len)
......
......@@ -51,7 +51,6 @@ namespace dash
logic::IAdaptationLogic::LogicType logicType;
mpd::Profile profile;
xml::Node *node;
mpd::MPDManagerFactory *mpdManagerFactory;
mpd::IMPDManager *mpdManager;
};
}
......
......@@ -30,29 +30,19 @@
using namespace dash::mpd;
using namespace dash::xml;
MPDManagerFactory::MPDManagerFactory()
{
// TODO Auto-generated constructor stub
}
MPDManagerFactory::~MPDManagerFactory()
{
// TODO Auto-generated destructor stub
}
IMPDManager* MPDManagerFactory::create (Profile profile, Node *root)
{
switch(profile)
{
case mpd::Basic: return new NullManager();
case mpd::BasicCM: return this->createBasicCMManager(root);
case mpd::BasicCM: return createBasicCMManager(root);
case mpd::Full2011: return new NullManager();
case mpd::NotValid: return new NullManager();
default: return new NullManager();
}
}
IMPDManager* MPDManagerFactory::createBasicCMManager (Node *root)
{
BasicCMParser *parser = new BasicCMParser(root);
......
......@@ -38,13 +38,10 @@ namespace dash
class MPDManagerFactory
{
public:
MPDManagerFactory ();
virtual ~MPDManagerFactory ();
IMPDManager* create(Profile profile, dash::xml::Node *root);
static IMPDManager* create(Profile profile, dash::xml::Node *root);
private:
IMPDManager* createBasicCMManager(dash::xml::Node *root);
static IMPDManager* createBasicCMManager(dash::xml::Node *root);
};
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment