Skip to content
Extraits de code Groupes Projets
Valider 3d35ba89 rédigé par Thomas Goyne's avatar Thomas Goyne
Parcourir les fichiers

Move the intrusive list hooks to the concrete entry types

parent cc7595e3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -22,7 +22,7 @@ ...@@ -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;
......
...@@ -150,7 +150,7 @@ struct AssDialogueBase { ...@@ -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
......
...@@ -46,7 +46,9 @@ enum class AssEntryGroup { ...@@ -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() { }
......
...@@ -48,7 +48,7 @@ class AssStyle; ...@@ -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;
......
...@@ -39,7 +39,7 @@ ...@@ -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:
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter