Skip to content

Commit eb7f896

Browse files
committed
Address PR comments
1 parent e41ae3d commit eb7f896

File tree

7 files changed

+305
-595
lines changed

7 files changed

+305
-595
lines changed

eventstream_rpc/include/aws/eventstreamrpc/EventStreamClient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,11 @@ namespace Aws
134134
MessageAmendment(const Crt::ByteBuf &payload, Crt::Allocator *allocator = Crt::g_allocator) noexcept;
135135
void AddHeader(EventStreamHeader &&header) noexcept;
136136
void SetPayload(const Crt::Optional<Crt::ByteBuf> &payload) noexcept;
137-
Crt::List<EventStreamHeader> &GetHeaders() const noexcept;
137+
const Crt::List<EventStreamHeader> &GetHeaders() const noexcept;
138138
const Crt::Optional<Crt::ByteBuf> &GetPayload() const noexcept;
139139

140140
private:
141-
mutable Crt::List<EventStreamHeader> m_headers;
141+
Crt::List<EventStreamHeader> m_headers;
142142
Crt::Optional<Crt::ByteBuf> m_payload;
143143
Crt::Allocator *m_allocator;
144144
};

eventstream_rpc/source/EventStreamClient.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace Aws
9797
rhs.m_payload = Crt::Optional<Crt::ByteBuf>();
9898
}
9999

100-
Crt::List<EventStreamHeader> &MessageAmendment::GetHeaders() const noexcept { return m_headers; }
100+
const Crt::List<EventStreamHeader> &MessageAmendment::GetHeaders() const noexcept { return m_headers; }
101101

102102
const Crt::Optional<Crt::ByteBuf> &MessageAmendment::GetPayload() const noexcept { return m_payload; }
103103

@@ -661,12 +661,12 @@ namespace Aws
661661
thisConnection->m_clientState = WAITING_FOR_CONNECT_ACK;
662662
thisConnection->m_underlyingConnection = connection;
663663
MessageAmendment messageAmendment;
664-
auto &messageAmendmentHeaders = messageAmendment.GetHeaders();
664+
Crt::List<EventStreamHeader> messageAmendmentHeaders = messageAmendment.GetHeaders();
665665

666666
if (thisConnection->m_connectMessageAmender)
667667
{
668668
MessageAmendment connectAmendment(thisConnection->m_connectMessageAmender());
669-
auto &amenderHeaderList = connectAmendment.GetHeaders();
669+
Crt::List<EventStreamHeader> amenderHeaderList = connectAmendment.GetHeaders();
670670
/* The version header is necessary for establishing the connection. */
671671
messageAmendment.AddHeader(EventStreamHeader(
672672
Crt::String(EVENTSTREAM_VERSION_HEADER),

eventstream_rpc/tests/EchoTestRpcModel.cpp

Lines changed: 32 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ namespace Awstest
2727
}
2828
}
2929

30-
Aws::Crt::String Product::s_getModelName() noexcept { return Aws::Crt::String("awstest#Product"); }
30+
const char *Product::MODEL_NAME = "awstest#Product";
3131

32-
Aws::Crt::String Product::GetModelName() const noexcept { return Product::s_getModelName(); }
32+
Aws::Crt::String Product::GetModelName() const noexcept { return Product::MODEL_NAME; }
3333

3434
Aws::Crt::ScopedResource<AbstractShapeBase> Product::s_allocateFromPayload(
3535
Aws::Crt::StringView stringView,
@@ -83,9 +83,9 @@ namespace Awstest
8383
}
8484
}
8585

86-
Aws::Crt::String Customer::s_getModelName() noexcept { return Aws::Crt::String("awstest#Customer"); }
86+
const char *Customer::MODEL_NAME = "awstest#Customer";
8787

88-
Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::s_getModelName(); }
88+
Aws::Crt::String Customer::GetModelName() const noexcept { return Customer::MODEL_NAME; }
8989

9090
Aws::Crt::ScopedResource<AbstractShapeBase> Customer::s_allocateFromPayload(
9191
Aws::Crt::StringView stringView,
@@ -131,9 +131,9 @@ namespace Awstest
131131
}
132132
}
133133

134-
Aws::Crt::String Pair::s_getModelName() noexcept { return Aws::Crt::String("awstest#Pair"); }
134+
const char *Pair::MODEL_NAME = "awstest#Pair";
135135

136-
Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::s_getModelName(); }
136+
Aws::Crt::String Pair::GetModelName() const noexcept { return Pair::MODEL_NAME; }
137137

138138
Aws::Crt::ScopedResource<AbstractShapeBase> Pair::s_allocateFromPayload(
139139
Aws::Crt::StringView stringView,
@@ -334,9 +334,9 @@ namespace Awstest
334334
return Aws::Crt::Optional<FruitEnum>();
335335
}
336336

337-
Aws::Crt::String MessageData::s_getModelName() noexcept { return Aws::Crt::String("awstest#MessageData"); }
337+
const char *MessageData::MODEL_NAME = "awstest#MessageData";
338338

339-
Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::s_getModelName(); }
339+
Aws::Crt::String MessageData::GetModelName() const noexcept { return MessageData::MODEL_NAME; }
340340

341341
Aws::Crt::ScopedResource<AbstractShapeBase> MessageData::s_allocateFromPayload(
342342
Aws::Crt::StringView stringView,
@@ -410,15 +410,9 @@ namespace Awstest
410410
return *this;
411411
}
412412

413-
Aws::Crt::String EchoStreamingMessage::s_getModelName() noexcept
414-
{
415-
return Aws::Crt::String("awstest#EchoStreamingMessage");
416-
}
413+
const char *EchoStreamingMessage::MODEL_NAME = "awstest#EchoStreamingMessage";
417414

418-
Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept
419-
{
420-
return EchoStreamingMessage::s_getModelName();
421-
}
415+
Aws::Crt::String EchoStreamingMessage::GetModelName() const noexcept { return EchoStreamingMessage::MODEL_NAME; }
422416

423417
Aws::Crt::ScopedResource<AbstractShapeBase> EchoStreamingMessage::s_allocateFromPayload(
424418
Aws::Crt::StringView stringView,
@@ -473,14 +467,11 @@ namespace Awstest
473467
}
474468
}
475469

476-
Aws::Crt::String GetAllProductsResponse::s_getModelName() noexcept
477-
{
478-
return Aws::Crt::String("awstest#GetAllProductsResponse");
479-
}
470+
const char *GetAllProductsResponse::MODEL_NAME = "awstest#GetAllProductsResponse";
480471

481472
Aws::Crt::String GetAllProductsResponse::GetModelName() const noexcept
482473
{
483-
return GetAllProductsResponse::s_getModelName();
474+
return GetAllProductsResponse::MODEL_NAME;
484475
}
485476

486477
Aws::Crt::ScopedResource<AbstractShapeBase> GetAllProductsResponse::s_allocateFromPayload(
@@ -517,15 +508,9 @@ namespace Awstest
517508
(void)jsonView;
518509
}
519510

520-
Aws::Crt::String GetAllProductsRequest::s_getModelName() noexcept
521-
{
522-
return Aws::Crt::String("awstest#GetAllProductsRequest");
523-
}
511+
const char *GetAllProductsRequest::MODEL_NAME = "awstest#GetAllProductsRequest";
524512

525-
Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept
526-
{
527-
return GetAllProductsRequest::s_getModelName();
528-
}
513+
Aws::Crt::String GetAllProductsRequest::GetModelName() const noexcept { return GetAllProductsRequest::MODEL_NAME; }
529514

530515
Aws::Crt::ScopedResource<AbstractShapeBase> GetAllProductsRequest::s_allocateFromPayload(
531516
Aws::Crt::StringView stringView,
@@ -582,14 +567,11 @@ namespace Awstest
582567
}
583568
}
584569

585-
Aws::Crt::String GetAllCustomersResponse::s_getModelName() noexcept
586-
{
587-
return Aws::Crt::String("awstest#GetAllCustomersResponse");
588-
}
570+
const char *GetAllCustomersResponse::MODEL_NAME = "awstest#GetAllCustomersResponse";
589571

590572
Aws::Crt::String GetAllCustomersResponse::GetModelName() const noexcept
591573
{
592-
return GetAllCustomersResponse::s_getModelName();
574+
return GetAllCustomersResponse::MODEL_NAME;
593575
}
594576

595577
Aws::Crt::ScopedResource<AbstractShapeBase> GetAllCustomersResponse::s_allocateFromPayload(
@@ -626,14 +608,11 @@ namespace Awstest
626608
(void)jsonView;
627609
}
628610

629-
Aws::Crt::String GetAllCustomersRequest::s_getModelName() noexcept
630-
{
631-
return Aws::Crt::String("awstest#GetAllCustomersRequest");
632-
}
611+
const char *GetAllCustomersRequest::MODEL_NAME = "awstest#GetAllCustomersRequest";
633612

634613
Aws::Crt::String GetAllCustomersRequest::GetModelName() const noexcept
635614
{
636-
return GetAllCustomersRequest::s_getModelName();
615+
return GetAllCustomersRequest::MODEL_NAME;
637616
}
638617

639618
Aws::Crt::ScopedResource<AbstractShapeBase> GetAllCustomersRequest::s_allocateFromPayload(
@@ -678,15 +657,9 @@ namespace Awstest
678657
}
679658
}
680659

681-
Aws::Crt::String EchoMessageResponse::s_getModelName() noexcept
682-
{
683-
return Aws::Crt::String("awstest#EchoMessageResponse");
684-
}
660+
const char *EchoMessageResponse::MODEL_NAME = "awstest#EchoMessageResponse";
685661

686-
Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept
687-
{
688-
return EchoMessageResponse::s_getModelName();
689-
}
662+
Aws::Crt::String EchoMessageResponse::GetModelName() const noexcept { return EchoMessageResponse::MODEL_NAME; }
690663

691664
Aws::Crt::ScopedResource<AbstractShapeBase> EchoMessageResponse::s_allocateFromPayload(
692665
Aws::Crt::StringView stringView,
@@ -730,12 +703,9 @@ namespace Awstest
730703
}
731704
}
732705

733-
Aws::Crt::String EchoMessageRequest::s_getModelName() noexcept
734-
{
735-
return Aws::Crt::String("awstest#EchoMessageRequest");
736-
}
706+
const char *EchoMessageRequest::MODEL_NAME = "awstest#EchoMessageRequest";
737707

738-
Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::s_getModelName(); }
708+
Aws::Crt::String EchoMessageRequest::GetModelName() const noexcept { return EchoMessageRequest::MODEL_NAME; }
739709

740710
Aws::Crt::ScopedResource<AbstractShapeBase> EchoMessageRequest::s_allocateFromPayload(
741711
Aws::Crt::StringView stringView,
@@ -771,15 +741,9 @@ namespace Awstest
771741
(void)jsonView;
772742
}
773743

774-
Aws::Crt::String EchoStreamingResponse::s_getModelName() noexcept
775-
{
776-
return Aws::Crt::String("awstest#EchoStreamingResponse");
777-
}
744+
const char *EchoStreamingResponse::MODEL_NAME = "awstest#EchoStreamingResponse";
778745

779-
Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept
780-
{
781-
return EchoStreamingResponse::s_getModelName();
782-
}
746+
Aws::Crt::String EchoStreamingResponse::GetModelName() const noexcept { return EchoStreamingResponse::MODEL_NAME; }
783747

784748
Aws::Crt::ScopedResource<AbstractShapeBase> EchoStreamingResponse::s_allocateFromPayload(
785749
Aws::Crt::StringView stringView,
@@ -815,15 +779,9 @@ namespace Awstest
815779
(void)jsonView;
816780
}
817781

818-
Aws::Crt::String EchoStreamingRequest::s_getModelName() noexcept
819-
{
820-
return Aws::Crt::String("awstest#EchoStreamingRequest");
821-
}
782+
const char *EchoStreamingRequest::MODEL_NAME = "awstest#EchoStreamingRequest";
822783

823-
Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept
824-
{
825-
return EchoStreamingRequest::s_getModelName();
826-
}
784+
Aws::Crt::String EchoStreamingRequest::GetModelName() const noexcept { return EchoStreamingRequest::MODEL_NAME; }
827785

828786
Aws::Crt::ScopedResource<AbstractShapeBase> EchoStreamingRequest::s_allocateFromPayload(
829787
Aws::Crt::StringView stringView,
@@ -870,9 +828,9 @@ namespace Awstest
870828
}
871829
}
872830

873-
Aws::Crt::String ServiceError::s_getModelName() noexcept { return Aws::Crt::String("awstest#ServiceError"); }
831+
const char *ServiceError::MODEL_NAME = "awstest#ServiceError";
874832

875-
Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::s_getModelName(); }
833+
Aws::Crt::String ServiceError::GetModelName() const noexcept { return ServiceError::MODEL_NAME; }
876834

877835
Aws::Crt::ScopedResource<OperationError> ServiceError::s_allocateFromPayload(
878836
Aws::Crt::StringView stringView,
@@ -908,14 +866,11 @@ namespace Awstest
908866
(void)jsonView;
909867
}
910868

911-
Aws::Crt::String CauseServiceErrorResponse::s_getModelName() noexcept
912-
{
913-
return Aws::Crt::String("awstest#CauseServiceErrorResponse");
914-
}
869+
const char *CauseServiceErrorResponse::MODEL_NAME = "awstest#CauseServiceErrorResponse";
915870

916871
Aws::Crt::String CauseServiceErrorResponse::GetModelName() const noexcept
917872
{
918-
return CauseServiceErrorResponse::s_getModelName();
873+
return CauseServiceErrorResponse::MODEL_NAME;
919874
}
920875

921876
Aws::Crt::ScopedResource<AbstractShapeBase> CauseServiceErrorResponse::s_allocateFromPayload(
@@ -952,14 +907,11 @@ namespace Awstest
952907
(void)jsonView;
953908
}
954909

955-
Aws::Crt::String CauseServiceErrorRequest::s_getModelName() noexcept
956-
{
957-
return Aws::Crt::String("awstest#CauseServiceErrorRequest");
958-
}
910+
const char *CauseServiceErrorRequest::MODEL_NAME = "awstest#CauseServiceErrorRequest";
959911

960912
Aws::Crt::String CauseServiceErrorRequest::GetModelName() const noexcept
961913
{
962-
return CauseServiceErrorRequest::s_getModelName();
914+
return CauseServiceErrorRequest::MODEL_NAME;
963915
}
964916

965917
Aws::Crt::ScopedResource<AbstractShapeBase> CauseServiceErrorRequest::s_allocateFromPayload(

0 commit comments

Comments
 (0)