Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5127: Another abstraction to allow for non-threaded populator implem…
…entations. The ResourceTreeView is planned to work with the IResourceTreePopulator only.
- Loading branch information
1 parent
4b479e6
commit a8498d4
Showing
7 changed files
with
71 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#pragma once | ||
|
||
#include "ResourceTreeView.h" | ||
|
||
namespace wxutil | ||
{ | ||
|
||
/** | ||
* TreeView populator interface, used to load data | ||
* into a TreeModel instance used by ResourceTreeView. | ||
* | ||
* It provides an interface to deal with threaded implementations: | ||
* - Populate(): will at least start the population, might return | ||
* before or after the work is done. | ||
* - EnsurePopulated(): will ensure that the population has been | ||
* started and will block until it's done. | ||
*/ | ||
class IResourceTreePopulator | ||
{ | ||
public: | ||
using Ptr = std::shared_ptr<IResourceTreePopulator>; | ||
|
||
virtual ~IResourceTreePopulator() {} | ||
|
||
// Will start the population and block until population is done. | ||
virtual void EnsurePopulated() = 0; | ||
|
||
// Start the population process, unless it's already running | ||
// This might spawn a worker thread which performs the | ||
// population in the background - use EnsurePopulated to synchronise. | ||
virtual void Populate() = 0; | ||
}; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters