linux版本中间件

Session.h 846B

1234567891011121314151617181920212223242526272829303132333435
  1. #pragma once
  2. #include <list>
  3. #include <vector>
  4. #include <memory>
  5. #include "Chan.h"
  6. class Session
  7. {
  8. public:
  9. Session(const std::string&strId);
  10. ~Session();
  11. std::string Id()const { return m_strId; }
  12. void addChan(const std::shared_ptr<Chan>&spChan);
  13. void delChan(const std::shared_ptr<Chan>&spChan);
  14. const std::shared_ptr<Chan> getChan(const std::string&strChanID);
  15. const std::shared_ptr<Chan> getFirstChan();
  16. const std::shared_ptr<Chan> getAssoChan(const std::shared_ptr<Chan>&spChan);
  17. const std::shared_ptr<Chan> getAssoChan(const std::string&strChanID);
  18. void printfChanList();
  19. auto size() const { return m_lstChan.size(); }
  20. auto transSentenceIndex() { return ++m_transSentenceIndex; }
  21. private:
  22. std::string m_strId;
  23. std::list<std::shared_ptr<Chan>> m_lstChan;
  24. std::int32_t m_transSentenceIndex; // 实时转译序号
  25. };