Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlInlinePacketInterface.h
Go to the documentation of this file.
1#pragma once
2
4#include "SDL/sdl_fwd.h"
5#include "Utility/TSpan.h"
6
7#include <string>
8#include <vector>
9
10namespace ph
11{
12
16{
17public:
19
28 SdlInlinePacketInterface(int clauseIndentAmount, char clauseIndentChar);
29
30 void parse(
31 std::string_view packetCommand,
32 const SdlInputContext& ctx,
33 std::string_view targetName,
34 ISdlResource* targetInstance,
35 SdlInputClauses& out_clauses) const override;
36
37 void generate(
38 const SdlOutputClauses& clauses,
39 const SdlOutputContext& ctx,
40 std::string_view targetName,
41 const ISdlResource* targetInstance,
42 std::string& out_packetCommand) const override;
43
44private:
45 static void parseClauses(
46 TSpanView<std::string> clauseStrings,
47 const SdlInputContext& ctx,
48 SdlInputClauses& out_clauses);
49
50 static void parseSingleClause(
51 TSpanView<std::string> clauseTokens,
52 SdlInputClause& out_clause);
53
54 static void appendSingleClause(
55 const SdlOutputClause& clause,
56 std::string& out_commandStr);
57
58 std::string m_clausePrefix;
59};
60
61}// end namespace ph
Interface for all SDL resource.
Definition ISdlResource.h:22
Parsing & generating a group of SDL clauses.
Definition SdlDataPacketInterface.h:14
Supports the case where the packet command stores SDL clauses directly.
Definition SdlInlinePacketInterface.h:16
void generate(const SdlOutputClauses &clauses, const SdlOutputContext &ctx, std::string_view targetName, const ISdlResource *targetInstance, std::string &out_packetCommand) const override
Turn all data in the clauses into a packet command.
Definition SdlInlinePacketInterface.cpp:66
void parse(std::string_view packetCommand, const SdlInputContext &ctx, std::string_view targetName, ISdlResource *targetInstance, SdlInputClauses &out_clauses) const override
Turn a packet command into out_clauses.
Definition SdlInlinePacketInterface.cpp:48
SdlInlinePacketInterface()
Definition SdlInlinePacketInterface.cpp:20
Carries SDL representation of various data during the input process. Helps to read input data such as...
Definition SdlInputClause.h:15
Container for input clauses.
Definition SdlInputClauses.h:18
Data that SDL input process can rely on.
Definition SdlInputContext.h:19
Carries SDL representation of various data during the output process. Helps to write output data such...
Definition SdlOutputClause.h:14
Definition SdlOutputClauses.h:14
Data that SDL output process can rely on.
Definition SdlOutputContext.h:19
The root for all renderer implementations.
Definition EEngineProject.h:6
std::span< const T, EXTENT > TSpanView
Same as TSpan, except that the objects are const-qualified. Note that for pointer types,...
Definition TSpan.h:19