Only conditionally include clang 3.7 enable_shared_from_this<> hack.

This commit is contained in:
Casey Langen 2016-05-30 11:36:46 -07:00
parent af433288f5
commit 3da84981e1
7 changed files with 83 additions and 69 deletions

View File

@ -1,65 +1,67 @@
#pragma once
#include <sigslot/sigslot.h>
#include <cursespp/ListWindow.h>
#include <cursespp/ScrollAdapterBase.h>
#include <app/query/CategoryListViewQuery.h>
#include <core/library/IQuery.h>
#include <core/library/ILibrary.h>
using musik::core::QueryPtr;
using musik::core::LibraryPtr;
using cursespp::IMessage;
using cursespp::ListWindow;
using cursespp::IScrollAdapter;
using cursespp::ScrollAdapterBase;
namespace musik {
namespace box {
class CategoryListView :
public ListWindow,
public std::enable_shared_from_this<CategoryListView>,
public sigslot::has_slots<>
{
public:
CategoryListView(LibraryPtr library, const std::string& fieldName);
virtual ~CategoryListView();
void Requery();
virtual void ProcessMessage(IMessage &message);
DBID GetSelectedId();
std::string GetFieldName();
void SetFieldName(const std::string& fieldName);
protected:
virtual IScrollAdapter& GetScrollAdapter();
void OnQueryCompleted(QueryPtr query);
class Adapter : public ScrollAdapterBase {
public:
Adapter(CategoryListView &parent);
virtual size_t GetEntryCount();
virtual EntryPtr GetEntry(size_t index);
private:
CategoryListView &parent;
IScrollAdapter::ScrollPosition spos;
};
private:
LibraryPtr library;
Adapter *adapter;
std::string fieldName;
std::shared_ptr<CategoryListViewQuery> activeQuery;
CategoryListViewQuery::ResultList metadata;
};
}
}
#pragma once
#include <sigslot/sigslot.h>
#include <cursespp/ListWindow.h>
#include <cursespp/ScrollAdapterBase.h>
#include <app/query/CategoryListViewQuery.h>
#include <core/library/IQuery.h>
#include <core/library/ILibrary.h>
using musik::core::QueryPtr;
using musik::core::LibraryPtr;
using cursespp::IMessage;
using cursespp::ListWindow;
using cursespp::IScrollAdapter;
using cursespp::ScrollAdapterBase;
namespace musik {
namespace box {
class CategoryListView :
public ListWindow,
#if ( __clang_major__==7 && __clang_minor__==3 )
public std::enable_shared_from_this<CategoryListView>,
#endif
public sigslot::has_slots<>
{
public:
CategoryListView(LibraryPtr library, const std::string& fieldName);
virtual ~CategoryListView();
void Requery();
virtual void ProcessMessage(IMessage &message);
DBID GetSelectedId();
std::string GetFieldName();
void SetFieldName(const std::string& fieldName);
protected:
virtual IScrollAdapter& GetScrollAdapter();
void OnQueryCompleted(QueryPtr query);
class Adapter : public ScrollAdapterBase {
public:
Adapter(CategoryListView &parent);
virtual size_t GetEntryCount();
virtual EntryPtr GetEntry(size_t index);
private:
CategoryListView &parent;
IScrollAdapter::ScrollPosition spos;
};
private:
LibraryPtr library;
Adapter *adapter;
std::string fieldName;
std::shared_ptr<CategoryListViewQuery> activeQuery;
CategoryListViewQuery::ResultList metadata;
};
}
}

View File

@ -13,7 +13,9 @@ namespace musik {
class CommandWindow :
public cursespp::Window,
public cursespp::IInput,
#if ( __clang_major__==7 && __clang_minor__==3 )
public std::enable_shared_from_this<CommandWindow>,
#endif
public sigslot::has_slots<>
{
public:

View File

@ -13,7 +13,9 @@ namespace musik {
namespace box {
class LogWindow :
public cursespp::ScrollableWindow,
#if ( __clang_major__==7 && __clang_minor__==3 )
public std::enable_shared_from_this<LogWindow>,
#endif
public sigslot::has_slots<>
{
public:

View File

@ -8,8 +8,10 @@
namespace musik {
namespace box {
class OutputWindow :
public cursespp::ScrollableWindow,
public std::enable_shared_from_this<OutputWindow>
public cursespp::ScrollableWindow
#if ( __clang_major__==7 && __clang_minor__==3 )
, public std::enable_shared_from_this<OutputWindow>
#endif
{
public:
OutputWindow(cursespp::IWindow *parent = NULL);

View File

@ -8,8 +8,10 @@
namespace musik {
namespace box {
class ResourcesWindow :
public cursespp::Window,
public std::enable_shared_from_this<ResourcesWindow>
public cursespp::Window
#if true || ( __clang_major__==7 && __clang_minor__==3 )
, public std::enable_shared_from_this<ResourcesWindow>
#endif
{
public:
ResourcesWindow(cursespp::IWindow *parent = NULL);

View File

@ -15,7 +15,9 @@ namespace musik {
namespace box {
class TrackListView :
public cursespp::ListWindow,
#if ( __clang_major__==7 && __clang_minor__==3 )
public std::enable_shared_from_this<TrackListView>,
#endif
public sigslot::has_slots<>
{
public:

View File

@ -12,7 +12,9 @@ namespace musik {
namespace box {
class TransportWindow :
public cursespp::Window,
#if ( __clang_major__==7 && __clang_minor__==3 )
public std::enable_shared_from_this<TransportWindow>,
#endif
public sigslot::has_slots<>
{
public: