Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
CerealItemComponentFactory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/sem_ver/SemVersion.h"
7#include "mc/platform/string/util/string_hash.h"
8#include "mc/util/CerealSchemaUpgradeSet.h"
9
10// auto generated forward declare list
11// clang-format off
12class Experiments;
13class ItemComponent;
15namespace cereal { struct ReflectionCtx; }
16// clang-format on
17
19public:
20 // CerealItemComponentFactory inner types declare
21 // clang-format off
22 struct ComponentMetadata;
23 // clang-format on
24
25 // CerealItemComponentFactory inner types define
26 struct ComponentMetadata {
27 public:
28 // ComponentMetadata inner types define
29 using Ctor = ::std::unique_ptr<::ItemComponent> (*)();
30
31 using ParseFunction = ::std::function<bool(::Experiments const&, ::SemVersion const&)>;
32
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ItemComponent> (*)()> makeUnique;
37 ::ll::TypedStorage<8, 24, ::std::vector<::PackLoadRequirement>> requirements;
38 ::ll::TypedStorage<8, 32, ::std::optional<::SemVersion>> releasedMinFormatVersion;
39 ::ll::TypedStorage<8, 32, ::std::optional<::SemVersion>> deprecatedVersion;
40 ::ll::TypedStorage<8, 24, ::CerealSchemaUpgradeSet> versionUpgrades;
41 ::ll::TypedStorage<8, 64, ::std::function<bool(::Experiments const&, ::SemVersion const&)>> onParseCallback;
42 // NOLINTEND
43
44 public:
45 // prevent constructor by default
46 ComponentMetadata& operator=(ComponentMetadata const&);
47 ComponentMetadata(ComponentMetadata const&);
48 ComponentMetadata();
49
50 public:
51 // member functions
52 // NOLINTBEGIN
53 MCNAPI ::CerealItemComponentFactory::ComponentMetadata&
55
57 // NOLINTEND
58
59 public:
60 // destructor thunk
61 // NOLINTBEGIN
62 MCNAPI void $dtor();
63 // NOLINTEND
64 };
65
66public:
67 // member variables
68 // NOLINTBEGIN
69 ::ll::TypedStorage<
70 8,
71 64,
72 ::std::unordered_map<
73 ::std::string,
76 ::std::equal_to<void>>>
77 mRegisteredComponents;
78 ::ll::TypedStorage<8, 24, ::SemVersion> mReleasedMinFormatVersionForAnyComponent;
79 // NOLINTEND
80
81public:
82 // static functions
83 // NOLINTBEGIN
84 MCNAPI static void addComponentMetadata(
86 ::std::string const& componentName,
88 ::std::optional<::SemVersion> releasedMinFormatVersion
89 );
90
91 MCNAPI static ::std::shared_ptr<::ItemComponent>
92 constructItemComponent(::std::string const& name, ::cereal::ReflectionCtx const& ctx);
93
95 ::std::string const& name,
96 ::SemVersion const deprecatedVersion,
98 );
99
100 MCNAPI static ::std::optional<::SemVersion>
102
103 MCNAPI static ::CerealItemComponentFactory& setupContextInstanceIfRequired(::cereal::ReflectionCtx& ctx);
104
105 MCNAPI static void
107 // NOLINTEND
108};
Definition CerealItemComponentFactory.h:18
static MCAPI void addComponentMetadata(::cereal::ReflectionCtx &ctx, ::std::string const &componentName, ::CerealItemComponentFactory::ComponentMetadata &&metadata, ::std::optional<::SemVersion > releasedMinFormatVersion)
static MCAPI ::std::optional<::SemVersion > getReleasedMinFormatVersionForAnyComponent(::cereal::ReflectionCtx const &ctx)
static MCAPI ::CerealItemComponentFactory & setupContextInstanceIfRequired(::cereal::ReflectionCtx &ctx)
static MCAPI void deprecateComponentStartingFromVersion(::std::string const &name, ::SemVersion const deprecatedVersion, ::cereal::ReflectionCtx const &ctx)
static MCAPI ::std::shared_ptr<::ItemComponent > constructItemComponent(::std::string const &name, ::cereal::ReflectionCtx const &ctx)
static MCAPI void updateReleasedMinFormatVersionForAnyComponentIfLower(::CerealItemComponentFactory &instance, ::SemVersion version)
Definition Experiments.h:14
Definition ItemComponent.h:16
Definition PackLoadRequirement.h:12
Definition SemVersion.h:15
Definition CerealItemComponentFactory.h:26
MCAPI::CerealItemComponentFactory::ComponentMetadata & operator=(::CerealItemComponentFactory::ComponentMetadata &&)
Definition string_hash.h:7
Definition ReflectionCtx.h:11
Definition ctx.h:5