CARLA
StreamStateBase.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma
2 // de Barcelona (UAB).
3 //
4 // This work is licensed under the terms of the MIT license.
5 // For a copy, see <https://opensource.org/licenses/MIT>.
6 
7 #pragma once
8 
9 #include "carla/NonCopyable.h"
12 
13 #include <memory>
14 
15 namespace carla {
16 
17  class BufferPool;
18 
19 namespace streaming {
20 namespace detail {
21 
22  /// Shared state among all the copies of a stream. Provides access to the
23  /// underlying server session(s) if active.
24  class StreamStateBase : private NonCopyable {
25  public:
26 
27  explicit StreamStateBase(const token_type &token);
28 
29  virtual ~StreamStateBase();
30 
31  const token_type &token() const {
32  return _token;
33  }
34 
36 
37  virtual void ConnectSession(std::shared_ptr<Session> session) = 0;
38 
39  virtual void DisconnectSession(std::shared_ptr<Session> session) = 0;
40 
41  virtual void ClearSessions() = 0;
42 
43  private:
44 
46 
47  const std::shared_ptr<BufferPool> _buffer_pool;
48  };
49 
50 } // namespace detail
51 } // namespace streaming
52 } // namespace carla
virtual void ConnectSession(std::shared_ptr< Session > session)=0
const std::shared_ptr< BufferPool > _buffer_pool
This file contains definitions of common data structures used in traffic manager. ...
Definition: Carla.cpp:133
Serializes a stream endpoint.
Definition: detail/Token.h:61
A piece of raw data.
Definition: carla/Buffer.h:42
virtual void DisconnectSession(std::shared_ptr< Session > session)=0
Inherit (privately) to suppress copy/move construction and assignment.
Shared state among all the copies of a stream.