SingularResource.inl
Go to the documentation of this file.
1 namespace iv
2 {
3 
4 template< class RT >
6  cm( inst, this, "SingularResource" ),
7  access( inst ),
8  resource( nullptr )
9 {
10  this->cm.owns( this->access.cm );
11  this->path( path );
12 }
13 
14 template< class RT >
16 {
17  return this->access.instance();
18 }
19 
20 template< class RT >
22 {
23  if( path == ResourcePath() || path == ResourcePath( "/" ) )
24  this->resource = nullptr;
25  else
26  this->resource = this->access.template get< RT >( path );
27 }
28 
29 template< class RT >
30 RT const * SingularResource< RT >::get() const
31 {
32  return this->resource;
33 }
34 
35 template< class RT >
37 {
38  return *this->resource;
39 }
40 
41 template< class RT >
43 {
44  return this->resource;
45 }
46 
47 }