boost::shared_ptr<cTexture> tempTexture = g_simulation->GetTextureManager()->Add( texName, path );
template:
template< class Type > class ResourceManager
boost::shared_ptr<cTexture> tempTexture = g_simulation->GetTextureManager()->Add( texName, path );
template< class Type > class ResourceManager
boost::shared_ptr<Type> Add( std::string name, std::string path = "" )
{
// If the element already exists, then return a pointer to it.
boost::shared_ptr<Type> element = GetElement( name );
if( element != NULL )
{
g_log->SIM( "Resource already in use: %s\n", const_cast<char*>(name.c_str()) );
return element;
}
// Create the resource
boost::shared_ptr<Type> resource(new Type( name, path ));
g_log->SIM( "New resource required: %s\n", const_cast<char*>(name.c_str()) );
// Add the new resource to the manager and return a pointer to it.
return *(m_list->Add( &resource ));
}
error C2661: 'boost::shared_ptr<T>::shared_ptr' : no overloaded function takes 2 arguments
with
[
T=cTexture
]
while compiling class template member function 'boost::shared_ptr<T> ResourceManager<Type>::Add(std::string,std::string)'
with
[
T=boost::shared_ptr<cTexture>,
Type=boost::shared_ptr<cTexture>
]