|
Infinity Engine v0.6.20
C++ API Documentation
|
Abstract base class for all Infinity Engine data types. More...
#include <Base.hpp>
Public Member Functions | |
| virtual | ~Base () |
| Virtual destructor. | |
| virtual const Infinity::Types::TypeID & | typeId () const |
| Gets the runtime type identifier for this object. | |
| virtual std::unique_ptr< Base > | clone () const |
| virtual std::istream & | legibleDataRead (std::istream &in) override |
| Deserializes the object from a single-line text representation. | |
| virtual std::ostream & | legibleDataWrite (std::ostream &out) const override |
| Serializes the object to a single-line text representation. | |
Friends | |
| std::istream & | operator>> (std::istream &in, Base &obj) |
| Stream extraction operator for single-line text input. | |
| std::ostream & | operator<< (std::ostream &out, const Base &obj) |
| Stream insertion operator for single-line text output. | |
Abstract base class for all Infinity Engine data types.
Base serves as the root of the Infinity type system hierarchy, providing fundamental capabilities required by all data types in the engine:
All concrete types in the Infinity Engine (meshes, textures, point clouds, procedural data, etc.) derive from Base, enabling polymorphic operations, type-safe downcasting, and unified data handling throughout the system.
Derived classes should override:
Example usage:
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived class resources when deleted through a Base pointer. This is critical for polymorphic usage throughout the engine.
|
virtual |
Reimplemented in Infinity::Types::Containers::Array< T >, Infinity::Types::Containers::Array< Infinity::Types::Containers::Array2D >, Infinity::Types::Containers::Array< Infinity::Types::Containers::Array2D< float > >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector2 >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector3 >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector4 >, Infinity::Types::Containers::Array< Infinity::Types::Rendering::Material >, Infinity::Types::Containers::Array< Infinity::Types::Rendering::SubMesh >, Infinity::Types::Containers::Array< Infinity::Types::Spatial::Transform >, Infinity::Types::Containers::Array< uint8_t >, Infinity::Types::Containers::Array2D< T >, Infinity::Types::Containers::Array3D< T >, Infinity::Types::Containers::ImmutableMap, Infinity::Types::Containers::Map, Infinity::Types::Core::Data, Infinity::Types::Core::Value< T >, Infinity::Types::Math::Ramp< T >, Infinity::Types::Procedural::Landscape, Infinity::Types::Procedural::Noise, Infinity::Types::Rendering::IndexBuffer, Infinity::Types::Rendering::Material, Infinity::Types::Rendering::Mesh, Infinity::Types::Rendering::Renderable, Infinity::Types::Rendering::RenderObject, Infinity::Types::Rendering::VertexBuffer, Infinity::Types::Spatial::Spline2D, and Infinity::Types::Spatial::Spline3D.
|
overridevirtual |
Deserializes the object from a single-line text representation.
Reads the object's state from a compact, single-line text format. This method is specifically designed for parsing default values and inline data in component/system descriptions, configuration files, and YAML/JSON documents.
The format must be concise enough to fit on one line. For example:
Derived classes should override this to parse their specific single-line format. The implementation should not expect or consume newlines.
| in | Input stream to read from (text mode, single line). |
Implements Infinity::Types::Core::IOStreamLegible.
Reimplemented in Infinity::Types::Core::Value< T >.
|
overridevirtual |
Serializes the object to a single-line text representation.
Writes the object's state to a compact, single-line text format suitable for embedding in configuration files, component descriptions, or as default values. This method prioritizes compactness and inline readability over detailed formatting.
The output must fit on a single line without newlines. For example:
Derived classes should override this to format their data as a single line. The implementation should not output newlines or multi-line formatting.
| out | Output stream to write to (text mode). |
Implements Infinity::Types::Core::IOStreamLegible.
Reimplemented in Infinity::Types::Core::Value< T >.
|
virtual |
Gets the runtime type identifier for this object.
Returns the TypeID corresponding to the actual concrete type of this object. This enables runtime type checking, dynamic casting, and type-specific dispatch without RTTI overhead.
Derived classes should override this to return their specific TypeID:
Reimplemented in Infinity::Types::Containers::Array< T >, Infinity::Types::Containers::Array< Infinity::Types::Containers::Array2D >, Infinity::Types::Containers::Array< Infinity::Types::Containers::Array2D< float > >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector2 >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector3 >, Infinity::Types::Containers::Array< Infinity::Types::Math::t_Vector4 >, Infinity::Types::Containers::Array< Infinity::Types::Rendering::Material >, Infinity::Types::Containers::Array< Infinity::Types::Rendering::SubMesh >, Infinity::Types::Containers::Array< Infinity::Types::Spatial::Transform >, Infinity::Types::Containers::Array< uint8_t >, Infinity::Types::Containers::Array2D< T >, Infinity::Types::Containers::Array3D< T >, Infinity::Types::Containers::ImmutableMap, Infinity::Types::Containers::Map, Infinity::Types::Core::Data, Infinity::Types::Core::Pair< L, R >, Infinity::Types::Core::Value< T >, Infinity::Types::Math::Ramp< T >, Infinity::Types::Procedural::Landscape, Infinity::Types::Procedural::Noise, Infinity::Types::Rendering::IndexBuffer, Infinity::Types::Rendering::Material, Infinity::Types::Rendering::Mesh, Infinity::Types::Rendering::Renderable, Infinity::Types::Rendering::RenderObject, Infinity::Types::Rendering::VertexBuffer, Infinity::Types::Spatial::Spline2D, Infinity::Types::Spatial::Spline3D, and Infinity::Types::Spatial::Spline4D.
|
friend |
Stream insertion operator for single-line text output.
Allows Base objects to be written to output streams using the operator. Calls legibleDataWrite() internally.
| out | Output stream to write to. |
| obj | Object to serialize. |
|
friend |
Stream extraction operator for single-line text input.
Allows Base objects to be read from input streams using the >> operator. Calls legibleDataRead() internally.
| in | Input stream to read from. |
| obj | Object to deserialize into. |