CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
27 namespace catapult {
namespace handlers {
30 template<
typename TRequestTraits>
39 template<
typename TResultsProducerFactory>
47 SetResponse(context, maxPacketDataSize, resultsProducerFactory());
53 template<
typename TResultsProducerFactory>
62 SetResponse(context, maxPacketDataSize, resultsProducerFactory(
info.Range));
67 template<
typename TProducer>
79 template<
typename T,
typename =
void>
86 template<
typename TProducer>
91 template<
typename TProducer>
97 template<
typename TRange>
101 :
Range(std::move(range))
112 using RequestStructureType =
typename TRequestTraits::RequestStructureType;
bool appendGeneratedValues(TValueGenerator &&generator)
Definition: PacketPayloadBuilder.h:125
Definition: HandlerFactory.h:98
static void Append(ValuesAppendFlag, ionet::PacketPayloadBuilder &builder, TProducer &producer)
Definition: HandlerFactory.h:92
static constexpr auto Packet_Type
Packet type supported by the created handler.
Definition: HandlerFactory.h:34
A packet header with a data payload.
Definition: Packet.h:32
PacketInfo(TRange &&range)
Definition: HandlerFactory.h:100
Definition: HandlerFactory.h:80
std::integral_constant< AppendType, AppendType::Values > ValuesAppendFlag
Definition: HandlerFactory.h:77
Represents a range of entities.
Definition: EntityRange.h:31
std::integral_constant< AppendType, AppendType::Entities > EntitiesAppendFlag
Definition: HandlerFactory.h:76
void registerHandler(PacketType type, const PacketHandler &handler)
Registers a handler for the specified packet type.
Definition: PacketHandlers.cpp:100
bool IsValid
Definition: HandlerFactory.h:107
static void RegisterZero(ionet::ServerPacketHandlers &handlers, TResultsProducerFactory resultsProducerFactory)
Definition: HandlerFactory.h:40
A packet payload builder for creating payloads composed of heterogeneous data.
Definition: PacketPayloadBuilder.h:29
const PacketPayload & response() const
Gets the response associated with this context.
Definition: PacketHandlers.cpp:46
static constexpr auto Packet_Type
Definition: RemoteNodeApi.cpp:33
static auto ProcessRequest(const ionet::Packet &packet)
Definition: HandlerFactory.h:111
static void SetResponse(ionet::ServerPacketHandlerContext &context, uint32_t maxPacketDataSize, TProducer &&producer)
Definition: HandlerFactory.h:68
bool appendGeneratedEntities(TEntityGenerator &&generator)
Appends all entities produced by generator to the payload.
Definition: PacketPayloadBuilder.h:67
def info(*args)
Definition: forwardsValidation.py:12
typename is_type_expression< T, Enable >::type is_type_expression_t
true if the expression is valid and evaluates to a type, false otherwise.
Definition: Traits.h:98
Definition: AddressExtractionExtension.cpp:28
Factory for creating a handler that returns batch of entities.
Definition: HandlerFactory.h:31
static void RegisterOne(ionet::ServerPacketHandlers &handlers, TResultsProducerFactory resultsProducerFactory)
Definition: HandlerFactory.h:54
uint32_t maxPacketDataSize() const
Gets the max packet data size.
Definition: PacketHandlers.cpp:76
constexpr bool IsPacketValid(const Packet &packet, PacketType type)
Checks if packet is valid with type.
Definition: Packet.h:75
static void Append(EntitiesAppendFlag, ionet::PacketPayloadBuilder &builder, TProducer &producer)
Definition: HandlerFactory.h:87
A collection of packet handlers where there is at most one handler per packet type.
Definition: PacketHandlers.h:62
TRange Range
Definition: HandlerFactory.h:106
AppendType
Definition: HandlerFactory.h:75
Context passed to a server packet handler function.
Definition: PacketHandlers.h:32