4#include "Stroika/Frameworks/StroikaPreComp.h"
14using namespace Stroika::Foundation::Memory;
16using namespace Stroika::Frameworks;
26static_assert (not copyable<Message>);
27static_assert (movable<Message>);
29Message::Message (
Request&& srcRequest, Response&& srcResponse,
const optional<IO::Network::SocketAddress>& peerAddress)
30 : peerAddress{[qStroika_Foundation_Common_Property_ExtraCaptureStuff] ([[maybe_unused]] const auto* property) -> optional<IO::Network::
SocketAddress> {
33 return thisObj->fPeerAddress_;
35 , request{[qStroika_Foundation_Common_Property_ExtraCaptureStuff] ([[maybe_unused]]
const auto* property) ->
const Request& {
38 return thisObj->fRequest_;
40 , rwRequest{[qStroika_Foundation_Common_Property_ExtraCaptureStuff] ([[maybe_unused]]
const auto* property) ->
Request& {
43 return thisObj->fRequest_;
45 , response{[qStroika_Foundation_Common_Property_ExtraCaptureStuff] ([[maybe_unused]]
const auto* property) ->
const Response& {
48 return thisObj->fResponse_;
50 , rwResponse{[qStroika_Foundation_Common_Property_ExtraCaptureStuff] ([[maybe_unused]]
const auto* property) -> Response& {
53 return thisObj->fResponse_;
55 , fPeerAddress_{peerAddress}
56 , fRequest_{move (srcRequest)}
57 , fResponse_{move (srcResponse)}
59#if qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled
60 fRequest_.SetAssertExternallySynchronizedMutexContext (fThisAssertExternallySynchronized_.GetSharedContext ());
61 fResponse_.SetAssertExternallySynchronizedMutexContext (fThisAssertExternallySynchronized_.GetSharedContext ());
65#if qStroika_Foundation_Debug_AssertExternallySynchronizedMutex_Enabled
66void Message::SetAssertExternallySynchronizedMutexContext (
const shared_ptr<AssertExternallySynchronizedMutex::SharedContext>& sharedContext)
68 fThisAssertExternallySynchronized_.SetAssertExternallySynchronizedMutexContext (sharedContext);
69 Assert (fThisAssertExternallySynchronized_.GetSharedContext () == sharedContext);
70 fRequest_.SetAssertExternallySynchronizedMutexContext (sharedContext);
71 fResponse_.SetAssertExternallySynchronizedMutexContext (sharedContext);
77 AssertExternallySynchronizedMutex::ReadContext readLock{fThisAssertExternallySynchronized_};
80 sb <<
"PeerAddress: "sv << fPeerAddress_;
81 sb <<
", Request: "sv << fRequest_;
82 sb <<
", Response: "sv << fResponse_;
Similar to String, but intended to more efficiently construct a String. Mutable type (String is large...
String is like std::u32string, except it is much easier to use, often much more space efficient,...
NOT a real mutex - just a debugging infrastructure support tool so in debug builds can be assured thr...
shared_lock< const AssertExternallySynchronizedMutex > ReadContext
Instantiate AssertExternallySynchronizedMutex::ReadContext to designate an area of code where protect...
unique_lock< AssertExternallySynchronizedMutex > WriteContext
Instantiate AssertExternallySynchronizedMutex::WriteContext to designate an area of code where protec...
Common::ReadOnlyProperty< Response & > rwResponse
Common::ReadOnlyProperty< const Request & > request
Common::ReadOnlyProperty< optional< IO::Network::SocketAddress > > peerAddress
Common::ReadOnlyProperty< const Response & > response
Common::ReadOnlyProperty< Request & > rwRequest
nonvirtual String ToString() const
this represents a HTTP request object for the WebServer module