Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
ProceduralComponentDescription.hpp
1#pragma once
2
3#include <Infinity/api.h>
4#include <Infinity/IO/Filetype.hpp>
5
6#include <filesystem>
7#include <memory>
8#include <ostream>
9
11{
12
13class ProceduralComponentDescriptionImpl;
14
47class INFINITY_API_PUBLIC ProceduralComponentDescription
48{
49 public:
60 ProceduralComponentDescription(const std::filesystem::path& loadPath);
61
70 ProceduralComponentDescription(const std::string& yamlString, const std::filesystem::path& loadPath = {});
71
81 ProceduralComponentDescription(const uint8_t* buffer, const size_t size, const std::filesystem::path& loadPath = {});
82
89
96
101
109
117
127 bool isFilePCDFlatbuffer(const std::filesystem::path& filepath);
128
141 void dump(const std::filesystem::path& path, Infinity::IO::Filetype type = Infinity::IO::Filetype::Flatbuffer) const;
142
154 const std::filesystem::path& getLoadPath() const;
155
163 friend INFINITY_API_PUBLIC std::ostream& operator<<(std::ostream& os, const ProceduralComponentDescription& desc);
164
165 private:
166 std::unique_ptr<ProceduralComponentDescriptionImpl> _impl;
167
168 friend class Infinity::Procedural::ProceduralComponentDescriptionImpl;
169};
170
171}
Description and configuration data for a ProceduralComponent instance.
Definition ProceduralComponentDescription.hpp:48
ProceduralComponentDescription(const ProceduralComponentDescription &copy)
Copy constructor.
ProceduralComponentDescription(const uint8_t *buffer, const size_t size, const std::filesystem::path &loadPath={})
Creates a ProceduralComponentDescription from a binary FlatBuffer.
friend INFINITY_API_PUBLIC std::ostream & operator<<(std::ostream &os, const ProceduralComponentDescription &desc)
Stream insertion operator for debugging and logging.
ProceduralComponentDescription(const std::filesystem::path &loadPath)
Loads a ProceduralComponentDescription from a file.
void dump(const std::filesystem::path &path, Infinity::IO::Filetype type=Infinity::IO::Filetype::Flatbuffer) const
Serializes this description to a file.
ProceduralComponentDescription & operator=(const ProceduralComponentDescription &copy)
Copy assignment operator.
const std::filesystem::path & getLoadPath() const
Gets the package path associated with this description.
ProceduralComponentDescription & operator=(ProceduralComponentDescription &&other)
Move assignment operator.
bool isFilePCDFlatbuffer(const std::filesystem::path &filepath)
Checks if a file is a FlatBuffer-format component description.
ProceduralComponentDescription(ProceduralComponentDescription &&other)
Move constructor.
ProceduralComponentDescription(const std::string &yamlString, const std::filesystem::path &loadPath={})
Creates a ProceduralComponentDescription from a YAML string.
Filetype
Enumeration of supported file formats for serialization and deserialization.
Definition Filetype.hpp:17
@ Flatbuffer
Definition Filetype.hpp:18
Definition ComponentException.hpp:7