Move the intrusive list hooks to the concrete entry types

This commit is contained in:
Thomas Goyne 2014-03-07 16:59:52 -08:00
parent cc7595e3c6
commit 3d35ba894c
5 changed files with 7 additions and 5 deletions

View File

@ -22,7 +22,7 @@
#include <vector> #include <vector>
/// @class AssAttachment /// @class AssAttachment
class AssAttachment : public AssEntry { class AssAttachment : public AssEntry, public AssEntryListHook {
/// ASS uuencoded entry data, including header. /// ASS uuencoded entry data, including header.
boost::flyweight<std::string> entry_data; boost::flyweight<std::string> entry_data;

View File

@ -150,7 +150,7 @@ struct AssDialogueBase {
boost::flyweight<std::string> Text; boost::flyweight<std::string> Text;
}; };
class AssDialogue : public AssEntry, public AssDialogueBase { class AssDialogue : public AssEntry, public AssDialogueBase, public AssEntryListHook {
std::string GetData(bool ssa) const; std::string GetData(bool ssa) const;
/// @brief Parse raw ASS data into everything else /// @brief Parse raw ASS data into everything else

View File

@ -46,7 +46,9 @@ enum class AssEntryGroup {
GROUP_MAX GROUP_MAX
}; };
class AssEntry : public boost::intrusive::make_list_base_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>::type { using AssEntryListHook = boost::intrusive::make_list_base_hook<boost::intrusive::link_mode<boost::intrusive::auto_unlink>>::type;
class AssEntry {
public: public:
virtual ~AssEntry() { } virtual ~AssEntry() { }

View File

@ -48,7 +48,7 @@ class AssStyle;
class wxString; class wxString;
template<typename T> template<typename T>
using EntryList = typename boost::intrusive::make_list<T, boost::intrusive::constant_time_size<false>, boost::intrusive::base_hook<AssEntry>>::type; using EntryList = typename boost::intrusive::make_list<T, boost::intrusive::constant_time_size<false>, boost::intrusive::base_hook<AssEntryListHook>>::type;
struct AssFileCommit { struct AssFileCommit {
wxString const& message; wxString const& message;

View File

@ -39,7 +39,7 @@
#include <array> #include <array>
#include <wx/arrstr.h> #include <wx/arrstr.h>
class AssStyle : public AssEntry { class AssStyle : public AssEntry, public AssEntryListHook {
std::string data; std::string data;
public: public: