aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/workspaces.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/zenstore/include/zenstore/workspaces.h b/src/zenstore/include/zenstore/workspaces.h
index e1a024894..2eacf313d 100644
--- a/src/zenstore/include/zenstore/workspaces.h
+++ b/src/zenstore/include/zenstore/workspaces.h
@@ -41,12 +41,18 @@ public:
{
Oid Id;
std::filesystem::path RootPath;
+ inline bool operator==(const WorkspaceConfiguration& Rhs) const { return Id == Rhs.Id && RootPath == Rhs.RootPath; }
};
struct WorkspaceShareConfiguration
{
Oid Id;
std::filesystem::path SharePath;
+ std::string Alias;
+ inline bool operator==(const WorkspaceShareConfiguration& Rhs) const
+ {
+ return Id == Rhs.Id && SharePath == Rhs.SharePath && Alias == Rhs.Alias;
+ }
};
struct WorkspaceInfo
@@ -84,6 +90,14 @@ public:
void WriteState(const std::filesystem::path& WorkspaceStatePath);
void ReadState(const std::filesystem::path& WorkspaceStatePath, std::function<Oid(const std::filesystem::path& Path)>&& PathToIdCB);
+ struct ShareAlias
+ {
+ Oid WorkspaceId;
+ Oid ShareId;
+ };
+
+ std::optional<ShareAlias> GetShareAlias(std::string_view Alias) const;
+
private:
LoggerRef& Log() { return m_Log; }
@@ -95,6 +109,7 @@ private:
LoggerRef m_Log;
mutable RwLock m_Lock;
tsl::robin_map<Oid, Ref<Workspace>, Oid::Hasher> m_Workspaces;
+ tsl::robin_map<std::string, ShareAlias> m_ShareAliases;
};
void workspaces_forcelink();