diff --git a/CMakeLists.txt b/CMakeLists.txt index 135f8516..70e3e9c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory( "src/libraries/sapphire/mysqlConnector" ) add_subdirectory( "src/common" ) add_subdirectory( "src/servers" ) +add_subdirectory( "src/dbm" ) add_subdirectory( "src/tools/exd_common_gen" ) add_subdirectory( "src/tools/exd_struct_gen" ) diff --git a/cmake/compiler.cmake b/cmake/compiler.cmake index 20bab671..c614329e 100644 --- a/cmake/compiler.cmake +++ b/cmake/compiler.cmake @@ -1,6 +1,6 @@ if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17") # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32") else() add_definitions(-D_WIN32_WINNT=0x601) diff --git a/src/common/Database/DbConnection.cpp b/src/common/Database/DbConnection.cpp index 7a27717c..460d5bc0 100644 --- a/src/common/Database/DbConnection.cpp +++ b/src/common/Database/DbConnection.cpp @@ -4,7 +4,6 @@ #include "Logging/Logger.h" #include "PreparedStatement.h" -#include #include "Framework.h" extern Core::Framework g_fw; @@ -20,7 +19,7 @@ Core::Db::DbConnection::DbConnection( ConnectionInfo& connInfo ) : } -Core::Db::DbConnection::DbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* queue, +Core::Db::DbConnection::DbConnection( Core::LockedWaitQueue< std::shared_ptr< Operation > >* queue, Core::Db::ConnectionInfo& connInfo ) : m_reconnecting( false ), m_prepareError( false ), @@ -29,7 +28,7 @@ Core::Db::DbConnection::DbConnection( Core::LockedWaitQueue< boost::shared_ptr< m_connectionInfo( connInfo ), m_connectionFlags( CONNECTION_ASYNC ) { - m_worker = boost::make_shared< DbWorker >( m_queue, this ); + m_worker = std::make_shared< DbWorker >( m_queue, this ); } Core::Db::DbConnection::~DbConnection() @@ -53,7 +52,7 @@ void Core::Db::DbConnection::close() uint32_t Core::Db::DbConnection::open() { - boost::shared_ptr< Mysql::MySqlBase > base( new Mysql::MySqlBase() ); + std::shared_ptr< Mysql::MySqlBase > base( new Mysql::MySqlBase() ); Mysql::optionMap options; options[ MYSQL_OPT_RECONNECT ] = "1"; options[ MYSQL_SET_CHARSET_NAME ] = "utf8"; @@ -124,7 +123,7 @@ bool Core::Db::DbConnection::execute( const std::string& sql ) } } -boost::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( const std::string& sql ) +std::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( const std::string& sql ) { try { @@ -140,10 +139,10 @@ boost::shared_ptr< Mysql::ResultSet > Core::Db::DbConnection::query( const std:: } -boost::shared_ptr< Mysql::ResultSet > -Core::Db::DbConnection::query( boost::shared_ptr< Core::Db::PreparedStatement > stmt ) +std::shared_ptr< Mysql::ResultSet > +Core::Db::DbConnection::query( std::shared_ptr< Core::Db::PreparedStatement > stmt ) { - boost::shared_ptr< Mysql::ResultSet > res( nullptr ); + std::shared_ptr< Mysql::ResultSet > res( nullptr ); if( !stmt ) return nullptr; @@ -177,7 +176,7 @@ Core::Db::DbConnection::query( boost::shared_ptr< Core::Db::PreparedStatement > } -bool Core::Db::DbConnection::execute( boost::shared_ptr< Core::Db::PreparedStatement > stmt ) +bool Core::Db::DbConnection::execute( std::shared_ptr< Core::Db::PreparedStatement > stmt ) { if( !stmt ) return false; @@ -202,7 +201,7 @@ bool Core::Db::DbConnection::execute( boost::shared_ptr< Core::Db::PreparedState } } -boost::shared_ptr< Mysql::PreparedStatement > Core::Db::DbConnection::getPreparedStatement( uint32_t index ) +std::shared_ptr< Mysql::PreparedStatement > Core::Db::DbConnection::getPreparedStatement( uint32_t index ) { assert( index < m_stmts.size() ); auto ret = m_stmts[ index ]; @@ -225,7 +224,7 @@ void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string return; } - boost::shared_ptr< Mysql::PreparedStatement > pStmt( nullptr ); + std::shared_ptr< Mysql::PreparedStatement > pStmt( nullptr ); try { @@ -237,7 +236,7 @@ void Core::Db::DbConnection::prepareStatement( uint32_t index, const std::string m_prepareError = true; } - m_stmts[ index ] = boost::shared_ptr< Mysql::PreparedStatement >( pStmt ); + m_stmts[ index ] = std::shared_ptr< Mysql::PreparedStatement >( pStmt ); } diff --git a/src/common/Database/DbConnection.h b/src/common/Database/DbConnection.h index fda87691..750a07c7 100644 --- a/src/common/Database/DbConnection.h +++ b/src/common/Database/DbConnection.h @@ -7,8 +7,6 @@ #include #include #include "Util/LockedWaitQueue.h" -#include -#include namespace Mysql { class Connection; @@ -30,7 +28,7 @@ class Operation; class DbWorker; -using PreparedStmtScopedPtr = boost::scoped_ptr< PreparedStatement >; +using PreparedStmtScopedPtr = std::unique_ptr< PreparedStatement >; enum ConnectionFlags { @@ -53,14 +51,14 @@ struct ConnectionInfo using PreparedStatementMap = std::map< uint32_t, std::pair< std::string, ConnectionFlags > >; class DbConnection : - public boost::enable_shared_from_this< DbConnection > + public std::enable_shared_from_this< DbConnection > { public: // Constructor for synchronous connections. DbConnection( ConnectionInfo& connInfo ); // Constructor for asynchronous connections. - DbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* queue, ConnectionInfo& connInfo ); + DbConnection( Core::LockedWaitQueue< std::shared_ptr< Operation > >* queue, ConnectionInfo& connInfo ); virtual ~DbConnection(); @@ -72,11 +70,11 @@ public: bool execute( const std::string& sql ); - bool execute( boost::shared_ptr< PreparedStatement > stmt ); + bool execute( std::shared_ptr< PreparedStatement > stmt ); - boost::shared_ptr< Mysql::ResultSet > query( const std::string& sql ); + std::shared_ptr< Mysql::ResultSet > query( const std::string& sql ); - boost::shared_ptr< Mysql::ResultSet > query( boost::shared_ptr< PreparedStatement > stmt ); + std::shared_ptr< Mysql::ResultSet > query( std::shared_ptr< PreparedStatement > stmt ); void beginTransaction(); @@ -92,27 +90,27 @@ public: void unlock(); - boost::shared_ptr< Mysql::Connection > getConnection() + std::shared_ptr< Mysql::Connection > getConnection() { return m_pConnection; } - boost::shared_ptr< Mysql::PreparedStatement > getPreparedStatement( uint32_t index ); + std::shared_ptr< Mysql::PreparedStatement > getPreparedStatement( uint32_t index ); void prepareStatement( uint32_t index, const std::string& sql, ConnectionFlags flags ); virtual void doPrepareStatements() = 0; protected: - std::vector< boost::shared_ptr< Mysql::PreparedStatement > > m_stmts; + std::vector< std::shared_ptr< Mysql::PreparedStatement > > m_stmts; PreparedStatementMap m_queries; bool m_reconnecting; bool m_prepareError; private: - LockedWaitQueue< boost::shared_ptr< Operation > >* m_queue; - boost::shared_ptr< DbWorker > m_worker; - boost::shared_ptr< Mysql::Connection > m_pConnection; + LockedWaitQueue< std::shared_ptr< Operation > >* m_queue; + std::shared_ptr< DbWorker > m_worker; + std::shared_ptr< Mysql::Connection > m_pConnection; ConnectionInfo& m_connectionInfo; ConnectionFlags m_connectionFlags; std::mutex m_mutex; diff --git a/src/common/Database/DbWorker.cpp b/src/common/Database/DbWorker.cpp index b184b82f..8aa41a95 100644 --- a/src/common/Database/DbWorker.cpp +++ b/src/common/Database/DbWorker.cpp @@ -2,7 +2,7 @@ #include "Operation.h" #include "Util/LockedWaitQueue.h" -Core::Db::DbWorker::DbWorker( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* newQueue, DbConnection* pConn ) +Core::Db::DbWorker::DbWorker( Core::LockedWaitQueue< std::shared_ptr< Operation > >* newQueue, DbConnection* pConn ) { m_pConn = pConn; m_queue = newQueue; @@ -24,7 +24,7 @@ void Core::Db::DbWorker::workerThread() while( true ) { - boost::shared_ptr< Operation > operation = nullptr; + std::shared_ptr< Operation > operation = nullptr; m_queue->waitAndPop( operation ); diff --git a/src/common/Database/DbWorker.h b/src/common/Database/DbWorker.h index 49f0dd56..7240cab1 100644 --- a/src/common/Database/DbWorker.h +++ b/src/common/Database/DbWorker.h @@ -4,7 +4,7 @@ #include #include #include "Util/LockedWaitQueue.h" -#include +#include namespace Core { namespace Db { @@ -15,12 +15,12 @@ class Operation; class DbWorker { public: - DbWorker( LockedWaitQueue< boost::shared_ptr< Operation > >* newQueue, DbConnection* connection ); + DbWorker( LockedWaitQueue< std::shared_ptr< Operation > >* newQueue, DbConnection* connection ); ~DbWorker(); private: - LockedWaitQueue< boost::shared_ptr< Operation > >* m_queue; + LockedWaitQueue< std::shared_ptr< Operation > >* m_queue; DbConnection* m_pConn; void workerThread(); diff --git a/src/common/Database/DbWorkerPool.cpp b/src/common/Database/DbWorkerPool.cpp index 357c8e13..9c917b6a 100644 --- a/src/common/Database/DbWorkerPool.cpp +++ b/src/common/Database/DbWorkerPool.cpp @@ -5,7 +5,6 @@ #include "StatementTask.h" #include "Operation.h" #include "ZoneDbConnection.h" -#include #include "Framework.h" #include "Logging/Logger.h" @@ -25,7 +24,7 @@ class PingOperation : template< class T > Core::Db::DbWorkerPool< T >::DbWorkerPool() : - m_queue( new Core::LockedWaitQueue< boost::shared_ptr< Operation > >() ), + m_queue( new Core::LockedWaitQueue< std::shared_ptr< Operation > >() ), m_asyncThreads( 0 ), m_synchThreads( 0 ) { @@ -103,34 +102,34 @@ bool Core::Db::DbWorkerPool< T >::prepareStatements() } template< class T > -boost::shared_ptr< Mysql::ResultSet > -Core::Db::DbWorkerPool< T >::query( const std::string& sql, boost::shared_ptr< T > connection ) +std::shared_ptr< Mysql::ResultSet > +Core::Db::DbWorkerPool< T >::query( const std::string& sql, std::shared_ptr< T > connection ) { if( !connection ) connection = getFreeConnection(); - boost::shared_ptr< Mysql::ResultSet > result = connection->query( sql ); + std::shared_ptr< Mysql::ResultSet > result = connection->query( sql ); connection->unlock(); return result; } template< class T > -boost::shared_ptr< Mysql::PreparedResultSet > -Core::Db::DbWorkerPool< T >::query( boost::shared_ptr< PreparedStatement > stmt ) +std::shared_ptr< Mysql::PreparedResultSet > +Core::Db::DbWorkerPool< T >::query( std::shared_ptr< PreparedStatement > stmt ) { auto connection = getFreeConnection(); - auto ret = boost::static_pointer_cast< Mysql::PreparedResultSet >( connection->query( stmt ) ); + auto ret = std::static_pointer_cast< Mysql::PreparedResultSet >( connection->query( stmt ) ); connection->unlock(); return ret; } template< class T > -boost::shared_ptr< Core::Db::PreparedStatement > +std::shared_ptr< Core::Db::PreparedStatement > Core::Db::DbWorkerPool< T >::getPreparedStatement( PreparedStatementIndex index ) { - return boost::make_shared< PreparedStatement >( index ); + return std::make_shared< PreparedStatement >( index ); } template< class T > @@ -159,7 +158,7 @@ void Core::Db::DbWorkerPool< T >::keepAlive() const auto count = m_connections[ IDX_ASYNC ].size(); for( uint8_t i = 0; i < count; ++i ) - enqueue( boost::make_shared< PingOperation >() ); + enqueue( std::make_shared< PingOperation >() ); } template< class T > @@ -173,11 +172,11 @@ uint32_t Core::Db::DbWorkerPool< T >::openConnections( InternalIndex type, uint8 switch( type ) { case IDX_ASYNC: - return boost::make_shared< T >( m_queue.get(), m_connectionInfo ); + return std::make_shared< T >( m_queue.get(), m_connectionInfo ); case IDX_SYNCH: - return boost::make_shared< T >( m_connectionInfo ); + return std::make_shared< T >( m_connectionInfo ); default: - return boost::shared_ptr< T >( nullptr ); + return std::shared_ptr< T >( nullptr ); } }(); @@ -204,17 +203,17 @@ unsigned long Core::Db::DbWorkerPool< T >::escapeString( char* to, const char* f } template< class T > -void Core::Db::DbWorkerPool< T >::enqueue( boost::shared_ptr< Operation > op ) +void Core::Db::DbWorkerPool< T >::enqueue( std::shared_ptr< Operation > op ) { m_queue->push( op ); } template< class T > -boost::shared_ptr< T > Core::Db::DbWorkerPool< T >::getFreeConnection() +std::shared_ptr< T > Core::Db::DbWorkerPool< T >::getFreeConnection() { uint8_t i = 0; const auto numCons = m_connections[ IDX_SYNCH ].size(); - boost::shared_ptr< T > connection = nullptr; + std::shared_ptr< T > connection = nullptr; while( true ) { @@ -236,14 +235,14 @@ const std::string& Core::Db::DbWorkerPool< T >::getDatabaseName() const template< class T > void Core::Db::DbWorkerPool< T >::execute( const std::string& sql ) { - auto task = boost::make_shared< StatementTask >( sql ); + auto task = std::make_shared< StatementTask >( sql ); enqueue( task ); } template< class T > -void Core::Db::DbWorkerPool< T >::execute( boost::shared_ptr< PreparedStatement > stmt ) +void Core::Db::DbWorkerPool< T >::execute( std::shared_ptr< PreparedStatement > stmt ) { - auto task = boost::make_shared< PreparedStatementTask >( stmt ); + auto task = std::make_shared< PreparedStatementTask >( stmt ); enqueue( task ); } @@ -256,7 +255,7 @@ void Core::Db::DbWorkerPool< T >::directExecute( const std::string& sql ) } template< class T > -void Core::Db::DbWorkerPool< T >::directExecute( boost::shared_ptr< PreparedStatement > stmt ) +void Core::Db::DbWorkerPool< T >::directExecute( std::shared_ptr< PreparedStatement > stmt ) { auto connection = getFreeConnection(); connection->execute( stmt ); diff --git a/src/common/Database/DbWorkerPool.h b/src/common/Database/DbWorkerPool.h index 9833cadb..58723877 100644 --- a/src/common/Database/DbWorkerPool.h +++ b/src/common/Database/DbWorkerPool.h @@ -52,21 +52,21 @@ public: // Async execution void execute( const std::string& sql ); - void execute( boost::shared_ptr< PreparedStatement > stmt ); + void execute( std::shared_ptr< PreparedStatement > stmt ); // Sync execution void directExecute( const std::string& sql ); - void directExecute( boost::shared_ptr< PreparedStatement > stmt ); + void directExecute( std::shared_ptr< PreparedStatement > stmt ); - boost::shared_ptr< Mysql::ResultSet > - query( const std::string& sql, boost::shared_ptr< T > connection = nullptr ); + std::shared_ptr< Mysql::ResultSet > + query( const std::string& sql, std::shared_ptr< T > connection = nullptr ); - boost::shared_ptr< Mysql::PreparedResultSet > query( boost::shared_ptr< PreparedStatement > stmt ); + std::shared_ptr< Mysql::PreparedResultSet > query( std::shared_ptr< PreparedStatement > stmt ); using PreparedStatementIndex = typename T::Statements; - boost::shared_ptr< PreparedStatement > getPreparedStatement( PreparedStatementIndex index ); + std::shared_ptr< PreparedStatement > getPreparedStatement( PreparedStatementIndex index ); void escapeString( std::string& str ); @@ -77,14 +77,14 @@ private: unsigned long escapeString( char* to, const char* from, unsigned long length ); - void enqueue( boost::shared_ptr< Operation > op ); + void enqueue( std::shared_ptr< Operation > op ); - boost::shared_ptr< T > getFreeConnection(); + std::shared_ptr< T > getFreeConnection(); const std::string& getDatabaseName() const; - std::unique_ptr< Core::LockedWaitQueue< boost::shared_ptr< Operation > > > m_queue; - std::array< std::vector< boost::shared_ptr< T > >, IDX_SIZE > m_connections; + std::unique_ptr< Core::LockedWaitQueue< std::shared_ptr< Operation > > > m_queue; + std::array< std::vector< std::shared_ptr< T > >, IDX_SIZE > m_connections; ConnectionInfo m_connectionInfo; uint8_t m_asyncThreads; uint8_t m_synchThreads; diff --git a/src/common/Database/PreparedStatement.cpp b/src/common/Database/PreparedStatement.cpp index dadfb16a..2010e5eb 100644 --- a/src/common/Database/PreparedStatement.cpp +++ b/src/common/Database/PreparedStatement.cpp @@ -5,6 +5,7 @@ #include #include +#include Core::Db::PreparedStatement::PreparedStatement( uint32_t index ) : m_stmt( nullptr ), @@ -150,7 +151,7 @@ uint32_t Core::Db::PreparedStatement::getIndex() const return m_index; } -void Core::Db::PreparedStatement::setMysqlPS( boost::shared_ptr< Mysql::PreparedStatement > pStmt ) +void Core::Db::PreparedStatement::setMysqlPS( std::shared_ptr< Mysql::PreparedStatement > pStmt ) { m_stmt = pStmt; } diff --git a/src/common/Database/PreparedStatement.h b/src/common/Database/PreparedStatement.h index 351d3f81..d6127c6d 100644 --- a/src/common/Database/PreparedStatement.h +++ b/src/common/Database/PreparedStatement.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include "Operation.h" namespace Mysql { @@ -70,12 +70,12 @@ public: uint32_t getIndex() const; - void setMysqlPS( boost::shared_ptr< Mysql::PreparedStatement > pStmt ); + void setMysqlPS( std::shared_ptr< Mysql::PreparedStatement > pStmt ); void bindParameters(); protected: - boost::shared_ptr< Mysql::PreparedStatement > m_stmt; + std::shared_ptr< Mysql::PreparedStatement > m_stmt; uint32_t m_index; std::vector< PreparedStatementData > m_statementData; diff --git a/src/common/Database/StatementTask.cpp b/src/common/Database/StatementTask.cpp index 25753d17..87bf6e29 100644 --- a/src/common/Database/StatementTask.cpp +++ b/src/common/Database/StatementTask.cpp @@ -38,7 +38,7 @@ bool Core::Db::StatementTask::execute() } -Core::Db::PreparedStatementTask::PreparedStatementTask( boost::shared_ptr< Core::Db::PreparedStatement > stmt, +Core::Db::PreparedStatementTask::PreparedStatementTask( std::shared_ptr< Core::Db::PreparedStatement > stmt, bool async ) : m_stmt( stmt ) //, m_result(nullptr) diff --git a/src/common/Database/StatementTask.h b/src/common/Database/StatementTask.h index ff30d2e3..782e0f52 100644 --- a/src/common/Database/StatementTask.h +++ b/src/common/Database/StatementTask.h @@ -2,8 +2,8 @@ #define SAPPHIRE_STATEMENTTASK_H #include -#include #include "Operation.h" +#include namespace Core { namespace Db { @@ -35,7 +35,7 @@ class PreparedStatementTask : public Operation { public: - PreparedStatementTask( boost::shared_ptr< PreparedStatement > stmt, bool async = false ); + PreparedStatementTask( std::shared_ptr< PreparedStatement > stmt, bool async = false ); ~PreparedStatementTask(); @@ -43,7 +43,7 @@ public: //PreparedQueryResultFuture getFuture() { return m_result->get_future(); } protected: - boost::shared_ptr< PreparedStatement > m_stmt; + std::shared_ptr< PreparedStatement > m_stmt; bool m_hasResult; //PreparedQueryResultPromise* m_result; }; diff --git a/src/common/Database/ZoneDbConnection.cpp b/src/common/Database/ZoneDbConnection.cpp index 0db28603..6f9e873b 100644 --- a/src/common/Database/ZoneDbConnection.cpp +++ b/src/common/Database/ZoneDbConnection.cpp @@ -6,7 +6,7 @@ Core::Db::ZoneDbConnection::ZoneDbConnection( ConnectionInfo& connInfo ) : { } -Core::Db::ZoneDbConnection::ZoneDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, +Core::Db::ZoneDbConnection::ZoneDbConnection( Core::LockedWaitQueue< std::shared_ptr< Operation > >* q, ConnectionInfo& connInfo ) : DbConnection( q, connInfo ) { diff --git a/src/common/Database/ZoneDbConnection.h b/src/common/Database/ZoneDbConnection.h index a2e97bae..1bf61944 100644 --- a/src/common/Database/ZoneDbConnection.h +++ b/src/common/Database/ZoneDbConnection.h @@ -88,7 +88,7 @@ public: ZoneDbConnection( ConnectionInfo& connInfo ); - ZoneDbConnection( Core::LockedWaitQueue< boost::shared_ptr< Operation > >* q, ConnectionInfo& connInfo ); + ZoneDbConnection( Core::LockedWaitQueue< std::shared_ptr< Operation > >* q, ConnectionInfo& connInfo ); ~ZoneDbConnection(); diff --git a/src/common/Forwards.h b/src/common/Forwards.h index aad65318..15a5c7c0 100644 --- a/src/common/Forwards.h +++ b/src/common/Forwards.h @@ -1,13 +1,13 @@ #ifndef COMMON_FORWARDS_H #define COMMON_FORWARDS_H -#include +#include namespace Core { class ConfigMgr; -typedef boost::shared_ptr< ConfigMgr > ConfigMgrPtr; +typedef std::shared_ptr< ConfigMgr > ConfigMgrPtr; namespace Network { @@ -17,17 +17,17 @@ class Acceptor; class Connection; -typedef boost::shared_ptr< Hive > HivePtr; -typedef boost::shared_ptr< Acceptor > AcceptorPtr; -typedef boost::shared_ptr< Connection > ConnectionPtr; +typedef std::shared_ptr< Hive > HivePtr; +typedef std::shared_ptr< Acceptor > AcceptorPtr; +typedef std::shared_ptr< Connection > ConnectionPtr; namespace Packets { class GamePacket; class FFXIVPacketBase; -typedef boost::shared_ptr< GamePacket > GamePacketPtr; -typedef boost::shared_ptr< FFXIVPacketBase > FFXIVPacketBasePtr; +typedef std::shared_ptr< GamePacket > GamePacketPtr; +typedef std::shared_ptr< FFXIVPacketBase > FFXIVPacketBasePtr; } } @@ -36,4 +36,4 @@ typedef boost::shared_ptr< FFXIVPacketBase > FFXIVPacketBasePtr; } -#endif \ No newline at end of file +#endif diff --git a/src/common/Framework.cpp b/src/common/Framework.cpp index e66463c0..7243f69b 100644 --- a/src/common/Framework.cpp +++ b/src/common/Framework.cpp @@ -1,4 +1,2 @@ #include "Framework.h" #include "Logging/Logger.h" -#include -#include diff --git a/src/common/Framework.h b/src/common/Framework.h index 0f6b57b2..70543813 100644 --- a/src/common/Framework.h +++ b/src/common/Framework.h @@ -4,27 +4,27 @@ #include #include #include -#include +#include #include namespace Core { class Framework { - using TypenameToObject = std::map< std::type_index, boost::shared_ptr< void > >; + using TypenameToObject = std::map< std::type_index, std::shared_ptr< void > >; TypenameToObject ObjectMap; public: template< typename T > - boost::shared_ptr< T > get() + std::shared_ptr< T > get() { auto iType = ObjectMap.find( typeid( T ) ); assert( !( iType == ObjectMap.end() ) ); - return boost::static_pointer_cast< T >( iType->second ); + return std::static_pointer_cast< T >( iType->second ); } template< typename T > - void set( boost::shared_ptr< T > value ) + void set( std::shared_ptr< T > value ) { assert( value ); // why would anyone store nullptrs.... ObjectMap[ typeid( T ) ] = value; diff --git a/src/libraries b/src/libraries index b89d9a2d..883f4850 160000 --- a/src/libraries +++ b/src/libraries @@ -1 +1 @@ -Subproject commit b89d9a2dfcca81ab4241e791a0a78bb9ea34036c +Subproject commit 883f4850885634e2366ca82d69a730b1c2e694e7