Commit 34730c66 authored by Jonas Stienen's avatar Jonas Stienen
Browse files

More Linux compat and style

parent 00aca828
/*
* ---------------------------------------------------------------------------------
*
* VVV VVV A
* VVV VVV AAA Virtual Acoustics
......@@ -9,17 +10,8 @@
*
* ---------------------------------------------------------------------------------
*
* Datei: VAAudioReproductionModuleRegistry.h
*
* Zweck: Zentrale Registrierung von Reproduktionsmodulen
*
* Autor(en): Frank Wefers (Frank.Wefers@akustik.rwth-aachen.de)
*
* ---------------------------------------------------------------------------------
*/
// $Id: VAAudioReproductionModuleRegistry.h 3802 2014-11-25 21:13:27Z fwefers $
#ifndef __VA_AUDIOREPRODUCTIONMODULEREGISTRY_H__
#define __VA_AUDIOREPRODUCTIONMODULEREGISTRY_H__
......@@ -41,6 +33,30 @@ public:
virtual IVAAudioReproductionModule* Create( const CVAAudioReproductionModuleInitParams& oParams ) = 0;
};
//! Default factory (template)
template < class TReproduction >
class CVAAudioReproductionModuleDefaultFactory : public IVAAudioReproductionModuleFactory
{
public:
inline CVAAudioReproductionModuleDefaultFactory( const std::string& sClassIdentifier )
: m_sClassIdentifier( sClassIdentifier )
{
};
inline std::string GetClassIdentifier() const
{
return this->m_sClassIdentifier;
};
inline IVAAudioReproductionModule* Create( const CVAAudioReproductionModuleInitParams& oParams )
{
return new TReproduction( oParams );
};
private:
std::string m_sClassIdentifier;
};
//! Module registry (singleton)
class CVAAudioReproductionModuleRegistry
{
......@@ -74,28 +90,5 @@ private:
bool m_bInternalCoreFactoriesRegistered;
};
//! Default factory (template)
template < class TReproduction >
class CVAAudioReproductionModuleDefaultFactory : public IVAAudioReproductionModuleFactory
{
public:
inline CVAAudioReproductionModuleDefaultFactory( const std::string& sClassIdentifier )
: m_sClassIdentifier( sClassIdentifier )
{
};
inline std::string GetClassIdentifier() const
{
return this->m_sClassIdentifier;
};
inline IVAAudioReproductionModule* Create( const CVAAudioReproductionModuleInitParams& oParams )
{
return new TReproduction( oParams );
};
private:
std::string m_sClassIdentifier;
};
#endif // __VA_AUDIOREPRODUCTIONMODULEREGISTRY_H__
......@@ -86,7 +86,7 @@ public:
if( it == m_mObject2ID.end() ) return;
int iID = it->second;
m_mID2Objects.erase( iID );
m_mID2Object.erase( iID );
m_mObject2ID.erase( pObject );
m_mID2Ref.erase( iID );
};
......@@ -213,7 +213,7 @@ private:
int m_iStartID, m_iIDCount, m_iIDLast;
std::map< int, T* > m_mID2Object; // Assoziationen ID -> Objekt
std::map< T*, int > m_mObject2ID; // Assoziationen Objekt -> ID
std::map< int, int> m_mID2Ref; // Referenzzhler
std::map< int, int > m_mID2Ref; // Referenzzhler
};
#endif // __VA_OBJECTCONTAINER_H__
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment