ClientSession.hpp
1 // @formatter:off
2 //
3 // Balau core C++ library
4 //
5 // Copyright (C) 2017 Bora Software (contact@borasoftware.com)
6 //
7 // Licensed under the Boost Software License - Version 1.0 - August 17th, 2003.
8 // See the LICENSE file for the full license text.
9 //
10 
11 #ifndef COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP__CLIENT_SESSION
12 #define COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP__CLIENT_SESSION
13 
14 #include <Balau/Type/UUID.hpp>
15 #include <Balau/Util/DateTime.hpp>
16 
17 namespace Balau::Network::Http {
18 
30 class ClientSession final {
31  public: const std::string sessionId;
32 
36  public: ClientSession(const System::Clock & clock)
37  : sessionId(UUID().asString() + ::toString(clock.millitime())) {}
38 
39  public: ClientSession(const ClientSession & ) = delete;
40  public: ClientSession(ClientSession && ) = delete;
41 };
42 
43 } // namespace Balau::Network::Http
44 
45 #endif // COM_BORA_SOFTWARE__BALAU_NETWORK_HTTP__CLIENT_SESSION
Components and utilities working on HTTP data transmission.
Definition: HttpClient.hpp:26
Base interface of clocks.
Definition: Clock.hpp:47
UUID class, using the Boost uuid implementation.
Date and time utilities.
The session object for a client.
Definition: ClientSession.hpp:30
UUID class, using the Boost uuid implementation.
Definition: UUID.hpp:33
ClientSession(const System::Clock &clock)
Create a client session object with a new session id.
Definition: ClientSession.hpp:36
Balau::U8String< AllocatorT > toString(LoggingLevel level)
Print the logging level as a UTF-8 string.
Definition: LoggingLevel.hpp:73