]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Plugins.hxx
b2bcd8aadf1b506418103004c96e401f16a760d2
[cpPlugins.git] / lib / cpPlugins / Interface / Plugins.hxx
1 #ifndef __CPPLUGINS__INTERFACE__PLUGINS__HXX__
2 #define __CPPLUGINS__INTERFACE__PLUGINS__HXX__
3
4 // -------------------------------------------------------------------------
5 template< class T >
6 T* cpPlugins::Interface::Plugins::
7 GetData( const std::string& name )
8 {
9   auto dIt = this->m_DataObjects.find( name );
10   if( dIt != this->m_DataObjects.end( ) )
11     return( dynamic_cast< T* >( dIt->second.second.GetPointer( ) ) );
12   else
13     return( NULL );
14 }
15
16 // -------------------------------------------------------------------------
17 template< class T >
18 const T* cpPlugins::Interface::Plugins::
19 GetData( const std::string& name ) const
20 {
21   auto dIt = this->m_DataObjects.find( name );
22   if( dIt != this->m_DataObjects.end( ) )
23     return( dynamic_cast< const T* >( dIt->second.second.GetPointer( ) ) );
24   else
25     return( NULL );
26 }
27
28 #endif // __CPPLUGINS__INTERFACE__PLUGINS__HXX__
29
30 // eof - $RCSfile$