ncm: Add IntegratedContent*Impl

This commit is contained in:
Michael Scire
2023-02-22 15:16:30 -07:00
parent 3cb3b24b4a
commit 605206bb97
5 changed files with 793 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ namespace ams::ncm {
using ListType = ncm::IntegratedList<ncm::IContentMetaDatabase, 2>;
using DataType = ListType::ListData;
private:
os::SdkMutex m_mutex;
os::SdkRecursiveMutex m_mutex;
ListType m_list;
bool m_disabled;
public:

View File

@@ -27,7 +27,7 @@ namespace ams::ncm {
using ListType = ncm::IntegratedList<ncm::IContentStorage, 2>;
using DataType = ListType::ListData;
private:
os::SdkMutex m_mutex;
os::SdkRecursiveMutex m_mutex;
ListType m_list;
bool m_disabled;
public:

View File

@@ -77,6 +77,15 @@ namespace ams::ncm {
R_RETURN(result);
}
Result ForAll(auto callback) {
for (size_t i = 0; i < m_count; ++i) {
R_TRY(callback(this->Get(i)));
}
R_SUCCEED();
}
size_t GetCount() const { return m_count; }
};
}