89 lines
1.0 KiB
C++
89 lines
1.0 KiB
C++
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "AppComponent.hpp"
|
|
|
|
namespace N_AppComponent
|
|
{
|
|
|
|
int32_t AppComponent::create(NGL::Settings *settings)
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->create(settings);
|
|
return 0;
|
|
}
|
|
|
|
|
|
int32_t AppComponent::destroy()
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->destroy();
|
|
return 0;
|
|
}
|
|
|
|
|
|
int32_t AppComponent::init()
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->init();
|
|
return 0;
|
|
}
|
|
|
|
|
|
int32_t AppComponent::deinit()
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->deinit();
|
|
return 0;
|
|
}
|
|
|
|
|
|
int32_t AppComponent::start()
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->start();
|
|
return 0;
|
|
}
|
|
|
|
|
|
int32_t AppComponent::stop()
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
c->stop();
|
|
return 0;
|
|
}
|
|
|
|
|
|
void AppComponent::addChild(IAppComponent *a_child, const QString &a_name)
|
|
{
|
|
if (a_child)
|
|
{
|
|
a_child->setName(a_name);
|
|
m_Childs.push_back(a_child);
|
|
}
|
|
}
|
|
|
|
|
|
IAppComponent *AppComponent::getChild(const QString &a_name)
|
|
{
|
|
for (IAppComponent *c : m_Childs)
|
|
{
|
|
if (a_name == c->getName())
|
|
return c;
|
|
}
|
|
return nullptr;
|
|
}
|
|
|
|
}
|
|
|