15#include <unordered_set>
27 std::vector<std::string> activePythonInterfaces)
28 : m_activePythonInterfaces(
std::move(activePythonInterfaces)) {
30 for (
auto &ws : workspaces) {
31 std::pair<std::string, std::vector<IProjectSerialisable *>> item(ws->getName(),
32 std::vector<IProjectSerialisable *>());
36 for (
auto window : windows) {
37 auto wsNames = window->getWorkspaceNames();
41 if (wsNames.size() == 0) {
48 for (
auto &name : wsNames) {
64 return std::vector<IProjectSerialisable *>();
73 std::unordered_set<IProjectSerialisable *> uniqueWindows;
75 for (
auto &name : wsNames) {
77 uniqueWindows.insert(window);
81 std::vector<IProjectSerialisable *> windows(uniqueWindows.cbegin(), uniqueWindows.cend());
83 return lhs->getWindowName() < rhs->getWindowName();
97 std::vector<std::string> names;
99 names.reserve(windows.size());
100 for (
auto window : windows) {
101 names.emplace_back(window->getWindowName());
111 std::vector<std::string> names;
114 names.emplace_back(item.first);
117 std::sort(names.begin(), names.end());
135 bool includeUnattached)
const {
136 std::vector<WindowInfo> winInfo;
140 winInfo.emplace_back(info);
143 if (includeUnattached) {
146 winInfo.emplace_back(info);
167 std::vector<WorkspaceInfo> wsInfo;
170 for (
auto item : items) {
171 auto ws = item.second;
174 if (ws->id() ==
"WorkspaceGroup") {
175 auto group = std::dynamic_pointer_cast<WorkspaceGroup>(ws);
176 for (
int i = 0; i < group->getNumberOfEntries(); ++i) {
178 info.subWorkspaces.emplace_back(subInfo);
182 wsInfo.emplace_back(info);
194 return ads.getObjects();
200 info.
name = ws->getName();
202 info.
size = ws->getMemorySizeAsStr();
204 info.
type = ws->id();
216 return item->second.size() > 0;
235 return totalSize > warningSize;
245 size_t totalSize = 0;
246 for (
const auto &ws : wsNames) {
const std::vector< double > & rhs
Defines an interface to a MantidPlot class that can be saved into or loaded from a project.
virtual std::string getWindowType()=0
Returns the type of the window.
virtual std::string getWindowName()=0
Returns the user friendly name of the window.
Defines a mapping between a workspace ID and a pixmap to use for an icon.
std::string getIconID(const std::string &windowID) const
Returns an icon ID for the given window ID.
Defines a mapping between a workspace ID and a pixmap to use for an icon.
std::string getIconID(const std::string &workspaceID) const
Returns an icon ID for the given workspace ID.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...
std::shared_ptr< const Workspace > Workspace_const_sptr
shared pointer to Mantid::API::Workspace (const version)