Files
EVEngine/src/modules/network/Session.h
T
西风逍遥游 4377e062dd feat: zeroerr parameter validation + Doxygen API documentation
Squashed onto current main. Adds src/engine/common/Assert.h (EV_PARAM_CHECK / EV_ASSERT backed by zeroerr), an EVENGINE_ENABLE_ASSERTS option (non-Debug builds strip ZEROERR_NO_ASSERT unless enabled), parameter checks at key entry points, Doxygen comments across headers, Doxyfile + make docs / CMake docs targets, and Windows setup + code conventions in AGENTS.md.
2026-08-19 09:01:12 +08:00

33 lines
810 B
C++

#pragma once
#include <string>
#include <unordered_map>
namespace eve::network {
class Channel;
/**
* @brief Named collection of Channels (a "session"). Lookup by name, close all.
* Does not own the channels; the caller owns them.
*/
class Session {
public:
Session() = default;
~Session();
/** @brief Registers a channel under a name (replaces an existing entry). */
void add(std::string name, Channel* ch);
/** @brief Finds a channel by name, or nullptr. */
Channel* get(std::string name);
/** @brief Removes a channel from the session (does not delete it). */
void remove(std::string name);
/** @brief Closes every channel in the session. */
void closeAll();
private:
std::unordered_map<std::string, Channel*> channels_;
};
} // namespace eve::network