boost::shared_ptr -> std::shared_ptr, boost::weak_ptr -> std::weak_ptr

This commit is contained in:
casey 2016-05-14 01:16:50 -07:00
parent dd29f1e500
commit 47fffa7f73
25 changed files with 39 additions and 39 deletions

View File

@ -34,7 +34,7 @@
#include "shlwapi.h" #include "shlwapi.h"
#include <string> #include <string>
#include "CddaDataStreamFactory.h" #include "CddaDataStreamFactory.h"
#include "CddaDataStream.h"; #include "CddaDataStream.h"
CddaDataStreamFactory::CddaDataStreamFactory() { CddaDataStreamFactory::CddaDataStreamFactory() {

View File

@ -56,7 +56,7 @@ class WaveOut : public IOutput {
virtual bool Play(IBuffer *buffer, IBufferProvider *provider); virtual bool Play(IBuffer *buffer, IBufferProvider *provider);
public: public:
typedef boost::shared_ptr<WaveOutBuffer> WaveOutBufferPtr; typedef std::shared_ptr<WaveOutBuffer> WaveOutBufferPtr;
static DWORD WINAPI WaveCallbackThreadProc(LPVOID params); static DWORD WINAPI WaveCallbackThreadProc(LPVOID params);
void OnBufferWrittenToOutput(WaveOutBuffer *buffer); void OnBufferWrittenToOutput(WaveOutBuffer *buffer);

View File

@ -42,7 +42,7 @@ namespace musik { namespace core { namespace audio {
class Buffer; class Buffer;
class Stream; class Stream;
typedef boost::shared_ptr<Buffer> BufferPtr; typedef std::shared_ptr<Buffer> BufferPtr;
////////////////////////////////////////// //////////////////////////////////////////
///\brief ///\brief

View File

@ -48,11 +48,11 @@ namespace musik { namespace core { namespace audio {
class Player; class Player;
class Transport; class Transport;
typedef boost::shared_ptr<Player> PlayerPtr; typedef std::shared_ptr<Player> PlayerPtr;
class Player : public IBufferProvider { class Player : public IBufferProvider {
public: public:
typedef boost::shared_ptr<IOutput> OutputPtr; typedef std::shared_ptr<IOutput> OutputPtr;
static PlayerPtr Create(std::string &url,OutputPtr *output=&OutputPtr()); static PlayerPtr Create(std::string &url,OutputPtr *output=&OutputPtr());

View File

@ -47,7 +47,7 @@ namespace musik { namespace core { namespace audio {
class Stream; class Stream;
class Player; class Player;
typedef boost::shared_ptr<Stream> StreamPtr; typedef std::shared_ptr<Stream> StreamPtr;
class Stream { class Stream {
public: public:
@ -77,10 +77,10 @@ namespace musik { namespace core { namespace audio {
private: private:
typedef std::list<BufferPtr> BufferList; typedef std::list<BufferPtr> BufferList;
typedef boost::shared_ptr<IDecoderFactory> DecoderFactoryPtr; typedef std::shared_ptr<IDecoderFactory> DecoderFactoryPtr;
typedef std::vector<DecoderFactoryPtr> DecoderFactoryList; typedef std::vector<DecoderFactoryPtr> DecoderFactoryList;
typedef boost::shared_ptr<IDecoder> DecoderPtr; typedef std::shared_ptr<IDecoder> DecoderPtr;
typedef boost::shared_ptr<IDSP> DspPtr; typedef std::shared_ptr<IDSP> DspPtr;
typedef std::vector<DspPtr> Dsps; typedef std::vector<DspPtr> Dsps;
long preferedBufferSampleSize; long preferedBufferSampleSize;

View File

@ -44,14 +44,14 @@ namespace musik { namespace core { namespace io {
class DataStreamFactory { class DataStreamFactory {
public: public:
typedef boost::shared_ptr<IDataStream> DataStreamPtr; typedef std::shared_ptr<IDataStream> DataStreamPtr;
private: private:
static DataStreamFactory sInstance; static DataStreamFactory sInstance;
DataStreamFactory(); DataStreamFactory();
private: private:
typedef std::vector<boost::shared_ptr<IDataStreamFactory>> DataStreamFactoryVector; typedef std::vector<std::shared_ptr<IDataStreamFactory>> DataStreamFactoryVector;
DataStreamFactoryVector dataStreamFactories; DataStreamFactoryVector dataStreamFactories;
public: public:

View File

@ -10,7 +10,7 @@
namespace musik { namespace core { namespace musik { namespace core {
class ILibrary; class ILibrary;
typedef boost::shared_ptr<ILibrary> LibraryPtr; typedef std::shared_ptr<ILibrary> LibraryPtr;
class ILibrary { class ILibrary {
public: public:

View File

@ -11,7 +11,7 @@
namespace musik { namespace core { namespace musik { namespace core {
class IQuery; class IQuery;
typedef boost::shared_ptr<IQuery> QueryPtr; typedef std::shared_ptr<IQuery> QueryPtr;
class IQuery { class IQuery {
public: public:

View File

@ -753,7 +753,7 @@ void Indexer::ProcessAddRemoveQueue() {
void Indexer::RunAnalyzers() { void Indexer::RunAnalyzers() {
typedef audio::IAnalyzer PluginType; typedef audio::IAnalyzer PluginType;
typedef PluginFactory::DestroyDeleter<PluginType> Deleter; typedef PluginFactory::DestroyDeleter<PluginType> Deleter;
typedef boost::shared_ptr<PluginType> PluginPtr; typedef std::shared_ptr<PluginType> PluginPtr;
typedef std::vector<PluginPtr> PluginVector; typedef std::vector<PluginPtr> PluginVector;
/* short circuit if there aren't any analyzers */ /* short circuit if there aren't any analyzers */

View File

@ -111,13 +111,13 @@ namespace musik { namespace core {
std::string path; std::string path;
}; };
typedef std::vector<boost::shared_ptr<metadata::IMetadataReader>> MetadataReaderList; typedef std::vector<std::shared_ptr<metadata::IMetadataReader>> MetadataReaderList;
std::deque<AddRemoveContext> addRemoveQueue; std::deque<AddRemoveContext> addRemoveQueue;
MetadataReaderList metadataReaders; MetadataReaderList metadataReaders;
}; };
typedef boost::shared_ptr<Indexer> IndexerPtr; typedef std::shared_ptr<Indexer> IndexerPtr;
} } } }

View File

@ -44,7 +44,7 @@
using namespace musik::core; using namespace musik::core;
LibraryFactory& LibraryFactory::Instance() { LibraryFactory& LibraryFactory::Instance() {
typedef boost::shared_ptr<LibraryFactory> InstanceType; typedef std::shared_ptr<LibraryFactory> InstanceType;
static InstanceType sInstance(new LibraryFactory()); static InstanceType sInstance(new LibraryFactory());
return *sInstance; return *sInstance;
}; };

View File

@ -55,7 +55,7 @@ namespace musik { namespace core {
std::string value; std::string value;
}; };
typedef boost::shared_ptr<MetadataValue> MetadataValuePtr; typedef std::shared_ptr<MetadataValue> MetadataValuePtr;
typedef std::vector<MetadataValuePtr> MetadataValueVector; typedef std::vector<MetadataValuePtr> MetadataValueVector;
} } } }

View File

@ -71,7 +71,7 @@ namespace musik { namespace core {
virtual TrackPtr Copy(); virtual TrackPtr Copy();
private: private:
typedef boost::weak_ptr<Track> SelfWeakPtr; typedef std::weak_ptr<Track> SelfWeakPtr;
SelfWeakPtr selfPtr; SelfWeakPtr selfPtr;
Track::MetadataMap metadata; Track::MetadataMap metadata;
std::string uri; std::string uri;

View File

@ -45,7 +45,7 @@
namespace musik { namespace core { namespace musik { namespace core {
class Track; class Track;
typedef boost::shared_ptr<Track> TrackPtr; typedef std::shared_ptr<Track> TrackPtr;
typedef std::vector<TrackPtr> TrackVector; typedef std::vector<TrackPtr> TrackVector;
////////////////////////////////////////// //////////////////////////////////////////

View File

@ -80,7 +80,7 @@ void NonLibraryTrackHelper::ThreadLoop() {
/* load all IMetadataReader plugins */ /* load all IMetadataReader plugins */
typedef metadata::IMetadataReader PluginType; typedef metadata::IMetadataReader PluginType;
typedef PluginFactory::DestroyDeleter<PluginType> Deleter; typedef PluginFactory::DestroyDeleter<PluginType> Deleter;
typedef std::vector<boost::shared_ptr<metadata::IMetadataReader>> MetadataReaderList; typedef std::vector<std::shared_ptr<metadata::IMetadataReader>> MetadataReaderList;
MetadataReaderList metadataReaders = MetadataReaderList metadataReaders =
PluginFactory::Instance() .QueryInterface<PluginType, Deleter>("GetMetadataReader"); PluginFactory::Instance() .QueryInterface<PluginType, Deleter>("GetMetadataReader");

View File

@ -72,7 +72,7 @@ class NonLibraryTrackHelper{
boost::mutex mutex; boost::mutex mutex;
bool threadIsRunning; bool threadIsRunning;
typedef boost::weak_ptr<musik::core::Track> TrackWeakPtr; typedef std::weak_ptr<musik::core::Track> TrackWeakPtr;
std::list<TrackWeakPtr> tracksToRead; std::list<TrackWeakPtr> tracksToRead;
typedef boost::scoped_ptr<boost::thread> ThreadPtr; typedef boost::scoped_ptr<boost::thread> ThreadPtr;

View File

@ -95,12 +95,12 @@ namespace musik{ namespace core{
} }
}; };
template <class T, class D> std::vector<boost::shared_ptr<T>> QueryInterface(const char* functionName) { template <class T, class D> std::vector<std::shared_ptr<T>> QueryInterface(const char* functionName) {
boost::mutex::scoped_lock lock(this->mutex); boost::mutex::scoped_lock lock(this->mutex);
typedef T* STDCALL(PluginInterfaceCall); typedef T* STDCALL(PluginInterfaceCall);
std::vector<boost::shared_ptr<T>> plugins; std::vector<std::shared_ptr<T>> plugins;
HandleList& allDlls = PluginFactory::sInstance.loadedDlls; HandleList& allDlls = PluginFactory::sInstance.loadedDlls;
typedef HandleList::iterator Iterator; typedef HandleList::iterator Iterator;
@ -116,7 +116,7 @@ namespace musik{ namespace core{
T* result = funcPtr(); T* result = funcPtr();
if (result) { if (result) {
plugins.push_back(boost::shared_ptr<T>(result, D())); plugins.push_back(std::shared_ptr<T>(result, D()));
} }
} }

View File

@ -102,10 +102,10 @@ class Preferences{
~IO(void); ~IO(void);
typedef std::map<std::string,Setting> SettingMap; typedef std::map<std::string,Setting> SettingMap;
typedef boost::shared_ptr<SettingMap> SettingMapPtr; typedef std::shared_ptr<SettingMap> SettingMapPtr;
typedef std::map<std::string,SettingMapPtr> NamespaceMap; typedef std::map<std::string,SettingMapPtr> NamespaceMap;
typedef std::map<int,NamespaceMap> LibNamespaceMap; typedef std::map<int,NamespaceMap> LibNamespaceMap;
typedef boost::shared_ptr<IO> Ptr; typedef std::shared_ptr<IO> Ptr;
SettingMapPtr GetNamespace(const char* nameSpace,const char* library,int &libraryId); SettingMapPtr GetNamespace(const char* nameSpace,const char* library,int &libraryId);

View File

@ -8,7 +8,7 @@ using musik::core::db::Connection;
class CategoryListQuery : public QueryBase { class CategoryListQuery : public QueryBase {
public: public:
typedef boost::shared_ptr<std::vector<std::string>> Result; typedef std::shared_ptr<std::vector<std::string>> Result;
CategoryListQuery(); CategoryListQuery();
~CategoryListQuery(); ~CategoryListQuery();

View File

@ -38,6 +38,6 @@ class CategoryListView : public ListWindow, public sigslot::has_slots<> {
LibraryPtr library; LibraryPtr library;
Adapter *adapter; Adapter *adapter;
boost::shared_ptr<CategoryListQuery> activeQuery; std::shared_ptr<CategoryListQuery> activeQuery;
boost::shared_ptr<std::vector<std::string>> metadata; std::shared_ptr<std::vector<std::string>> metadata;
}; };

View File

@ -239,7 +239,7 @@ void CommandWindow::ListPlugins() const {
using musik::core::IPlugin; using musik::core::IPlugin;
using musik::core::PluginFactory; using musik::core::PluginFactory;
typedef std::vector<boost::shared_ptr<IPlugin>> PluginList; typedef std::vector<std::shared_ptr<IPlugin>> PluginList;
typedef PluginFactory::NullDeleter<IPlugin> Deleter; typedef PluginFactory::NullDeleter<IPlugin> Deleter;
PluginList plugins = PluginFactory::Instance() PluginList plugins = PluginFactory::Instance()

View File

@ -31,7 +31,7 @@ class IScrollAdapter {
virtual int64 GetAttrs() = 0; virtual int64 GetAttrs() = 0;
}; };
typedef boost::shared_ptr<IEntry> EntryPtr; typedef std::shared_ptr<IEntry> EntryPtr;
virtual void SetDisplaySize(size_t width, size_t height) = 0; virtual void SetDisplaySize(size_t width, size_t height) = 0;
virtual size_t GetEntryCount() = 0; virtual size_t GetEntryCount() = 0;

View File

@ -56,7 +56,7 @@ void LogWindow::Update() {
std::string s = boost::str(boost::format( std::string s = boost::str(boost::format(
"[%1%] %2%") % entry->tag % entry->message); "[%1%] %2%") % entry->tag % entry->message);
this->adapter->AddEntry(boost::shared_ptr<IEntry>(new MultiLineEntry(s, attrs))); this->adapter->AddEntry(std::shared_ptr<IEntry>(new MultiLineEntry(s, attrs)));
delete entry; delete entry;
} }

View File

@ -26,11 +26,11 @@ class MainLayout : public LayoutBase {
virtual void OnIdle(); virtual void OnIdle();
private: private:
boost::shared_ptr<LogWindow> logs; std::shared_ptr<LogWindow> logs;
boost::shared_ptr<CommandWindow> commands; std::shared_ptr<CommandWindow> commands;
boost::shared_ptr<OutputWindow> output; std::shared_ptr<OutputWindow> output;
boost::shared_ptr<TransportWindow> transport; std::shared_ptr<TransportWindow> transport;
boost::shared_ptr<ResourcesWindow> resources; std::shared_ptr<ResourcesWindow> resources;
std::vector<IWindow*> focusOrder; std::vector<IWindow*> focusOrder;
int focusIndex; int focusIndex;

View File

@ -34,7 +34,7 @@ EntryPtr SimpleScrollAdapter::GetEntry(size_t index) {
return this->entries.at(index); return this->entries.at(index);
} }
void SimpleScrollAdapter::AddEntry(boost::shared_ptr<IEntry> entry) { void SimpleScrollAdapter::AddEntry(std::shared_ptr<IEntry> entry) {
entry->SetWidth(this->GetWidth()); entry->SetWidth(this->GetWidth());
entries.push_back(entry); entries.push_back(entry);