diff options
| author | Stefan Boberg <[email protected]> | 2023-05-15 21:22:14 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2023-05-15 21:22:14 +0200 |
| commit | 69976764d10f44caa55b4b76334bf6e1fa86693f (patch) | |
| tree | 2b7b02ffe93fc457b4dbd04b96fb3d45c569971e /src/zenutil/include | |
| parent | CidStore::Impl explicit constructor, fixed #ifndef NDEBUG (diff) | |
| download | zen-69976764d10f44caa55b4b76334bf6e1fa86693f.tar.xz zen-69976764d10f44caa55b4b76334bf6e1fa86693f.zip | |
Added some comments to ZenServerInstance etc
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/zenserverprocess.h | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/zenutil/include/zenutil/zenserverprocess.h b/src/zenutil/include/zenutil/zenserverprocess.h index 1c204c144..a0a705f64 100644 --- a/src/zenutil/include/zenutil/zenserverprocess.h +++ b/src/zenutil/include/zenutil/zenserverprocess.h @@ -13,6 +13,10 @@ namespace zen { +/** Class which can be used to manage a Zen server execution environment + + Especially suited for automated testing purposes. + */ class ZenServerEnvironment { public: @@ -37,6 +41,13 @@ private: std::string m_ServerClass; }; +/** Helper class to start, stop and generally manage the lifecycle of + a Zen server instance + + Especially useful for automated testing but can also be used for + management tools. + */ + struct ZenServerInstance { ZenServerInstance(ZenServerEnvironment& TestEnvironment); @@ -57,10 +68,8 @@ struct ZenServerInstance m_TestDir = TestDir; } - void SpawnServer(int BasePort = 0, std::string_view AdditionalServerArgs = std::string_view()); - - void AttachToRunningServer(int BasePort = 0); - + void SpawnServer(int BasePort = 0, std::string_view AdditionalServerArgs = std::string_view()); + void AttachToRunningServer(int BasePort = 0); std::string GetBaseUri() const; private: @@ -76,12 +85,11 @@ private: void CreateShutdownEvent(int BasePort); }; -/** Shared system state - * - * Used as a scratchpad to identify running instances etc - * - * The state lives in a memory-mapped file backed by the swapfile - * +/** Shared Zen system state + + Used as a kind of whiteboard to identify running instances etc + + The state lives in a memory-mapped file backed by the swapfile */ class ZenServerState |