Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
SdlDataPacketCollection.h
Go to the documentation of this file.
1#pragma once
2
5
6#include <Common/Container/TStdUnorderedStringMap.h>
7
8#include <unordered_map>
9
10namespace ph
11{
12
14{
15public:
16 const SdlInputClauses* get(std::string_view packetName) const override;
17
18 void addUnique(
19 SdlInputClauses packet,
20 std::string_view packetName);
21
22 void addOrUpdate(
23 SdlInputClauses packet,
24 std::string_view packetName);
25
26private:
27 void add(
28 SdlInputClauses packet,
29 std::string_view packetName);
30
31 using PacketMapType = TStdUnorderedStringMap<SdlInputClauses>;
32
33 PacketMapType m_nameToPacket;
34};
35
36inline const SdlInputClauses* SdlDataPacketCollection::get(std::string_view packetName) const
37{
38 const auto& iter = m_nameToPacket.find(packetName);
39 return iter != m_nameToPacket.end() ? &(iter->second) : nullptr;
40}
41
42}// end namespace ph
View for a group of named data packets.
Definition ISdlDataPacketGroup.h:15
Definition SdlDataPacketCollection.h:14
void addUnique(SdlInputClauses packet, std::string_view packetName)
Definition SdlDataPacketCollection.cpp:13
const SdlInputClauses * get(std::string_view packetName) const override
Definition SdlDataPacketCollection.h:36
void addOrUpdate(SdlInputClauses packet, std::string_view packetName)
Definition SdlDataPacketCollection.cpp:27
Container for input clauses.
Definition SdlInputClauses.h:18
The root for all renderer implementations.
Definition EEngineProject.h:6