Aeon Engine c550894
AeonGames Open Source Game Engine
Loading...
Searching...
No Matches
Component.cpp
1/*
2Copyright (C) 2018,2019,2025,2026 Rodrigo Jose Hernandez Cordoba
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16#include "Factory.h"
17#include "aeongames/StringId.hpp"
18#include "aeongames/Component.hpp"
19
20namespace AeonGames
21{
22 Component::~Component() = default;
23 void Component::SetProperty ( const StringId& aId, const Property& aProperty )
24 {
25 SetProperty ( aId.GetId(), aProperty );
26 }
27 void Component::SetProperty ( const std::string& aId, const Property& aProperty )
28 {
29 SetProperty ( crc32i ( aId.data(), aId.size() ), aProperty );
30 }
31
33}
Abstract base class for node components.
Definition Component.hpp:39
DLL void SetProperty(const StringId &aId, const Property &aProperty)
Set a property by its StringId identifier.
Definition Component.cpp:23
virtual DLL ~Component()=0
Pure virtual destructor.
CRC-based compile-time string identifier.
Definition StringId.hpp:31
constexpr uint32_t GetId() const
Get the CRC32 identifier.
Definition StringId.hpp:52
<- This is here just for the literals
Definition AABB.hpp:31
std::variant< int, long, long long, unsigned, unsigned long, unsigned long long, float, double, std::string, std::filesystem::path > Property
A variant type that can hold any commonly used property value.
Definition Property.hpp:31
uint32_t crc32i(const char *message, size_t size, uint32_t previous_crc)
Compute the CRC32 of a given message, continuing from a previous CRC value.
Definition CRC.cpp:27
FactoryImplementation(Component)
Factory implementation for Component.