Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
ResourceManagementSystem
ResourceProvider.cpp
Go to the documentation of this file.
1
#include "
ResourceProvider.hpp
"
2
#include "
ResourceManagementSystem.hpp
"
3
4
namespace
iv
5
{
6
7
ResourceProvider::ResourceProvider
(
Instance
* inst,
size_t
priority ) :
8
cm( inst, this,
"ResourceProvider"
),
9
inst( inst ),
10
rms( inst->getSystem<
ResourceManagementSystem
>() )
11
{
12
if
( this->rms )
13
this->rms->
register_provider
(
this
, priority );
14
}
15
16
ResourceProvider::~ResourceProvider
()
17
{
18
this->
unregister_provider
();
19
}
20
21
Instance
*
ResourceProvider::instance
()
const
22
{
23
return
this->inst;
24
}
25
26
void
ResourceProvider::unregister_provider
()
27
{
28
if
( this->rms )
29
this->rms->
unregister_provider
(
this
);
30
}
31
32
}