I.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Instance.hpp"
4 
5 namespace iv
6 {
7 
13 template< class ClientType >
14 class I final : public Instance, public ClientType
15 {
16 public:
17 using ClientType::instance;
18 
19  template< class ... CArgs >
20  I( std::string const & name, SystemContainer * sc, CArgs const & ... cargs ) :
21  Instance( sc ),
22  ClientType( static_cast< Instance * >( this ), cargs ... )
23  {
24  static_cast< Instance * >( this )->instance_finalize( name, &static_cast< ClientType * >( this )->cm );
25  }
26 
27  template< class ... CArgs >
28  I( std::string const & name, Instance * parent, CArgs const & ... cargs ) :
29  Instance( parent->getSystemContainer() ),
30  ClientType( static_cast< Instance * >( this ), cargs ... )
31  {
32  static_cast< Instance * >( this )->instance_finalize( name, &static_cast< ClientType * >( this )->cm );
33  static_cast< Instance * >( this )->instance_parent( parent );
34  }
35 };
36 
37 }