Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Infinity::Types Namespace Reference

Namespaces

namespace  Containers
 
namespace  Core
 
namespace  Math
 
namespace  Procedural
 
namespace  Rendering
 
namespace  Spatial
 
namespace  Util
 

Classes

class  Converters
 Global registry for type conversion functions. More...
 
struct  TypeID
 Runtime type identifier for the Infinity type system. More...
 
class  TypeRegistry
 Global registry for runtime type information and factory functions. More...
 

Typedefs

template<typename F , typename T >
using Converter = T(const F &)
 Function signature for type conversion between two specific types.
 
using ConverterFn = std::function< Core::Base *(const Core::Base *)>
 Type-erased function wrapper for runtime type conversion.
 
typedef const void * TypeTag
 Opaque pointer used as a unique compile-time identifier for types.
 
typedef uint64_t TypeHash
 64-bit hash value computed from a type's name.
 

Functions

INFINITY_API_PUBLIC Core::Basecreate (const Infinity::Types::TypeID &type)
 
template<typename T >
const TypeIDgetTypeID ()
 Gets the TypeID for a given type T.
 

Typedef Documentation

◆ Converter

template<typename F , typename T >
Infinity::Types::Converter

Function signature for type conversion between two specific types.

Defines the signature for statically-typed conversion functions that transform a value of type F (from) into a value of type T (to).

Template Parameters
FThe source type to convert from.
TThe target type to convert to.
// Example converter function
Mesh convertPointCloudToMesh(const PointCloud& pc) {
// Conversion logic...
return mesh;
}

◆ ConverterFn

Type-erased function wrapper for runtime type conversion.

A std::function wrapper that performs conversion between two types known only at runtime. Takes a pointer to the source object (as Core::Base*) and returns a pointer to a newly-created target object (as Core::Base*).

The caller is responsible for managing the lifetime of the returned object.

◆ TypeHash

64-bit hash value computed from a type's name.

TypeHash provides a stable numeric identifier for types that can be serialized, transmitted across network boundaries, or used in hash tables. Unlike TypeTag, TypeHash remains consistent across compilation units and program executions.

◆ TypeTag

Opaque pointer used as a unique compile-time identifier for types.

TypeTag serves as a stable, unique identifier for each type in the system. Typically points to a static string literal representing the type name, ensuring uniqueness through memory address comparison.

Function Documentation

◆ create()

INFINITY_API_PUBLIC Core::Base * Infinity::Types::create ( const Infinity::Types::TypeID type)

◆ getTypeID()

template<typename T >
const TypeID & Infinity::Types::getTypeID ( )

Gets the TypeID for a given type T.

Template function that returns a reference to the singleton TypeID instance for type T. Each type has exactly one TypeID that is created the first time this function is called for that type.

Template Parameters
TThe type to get the identifier for.
Returns
Const reference to the unique TypeID for type T.
Note
Types must be registered using INFINITY_TYPE_IMPL macro before calling this function, otherwise linker errors will occur.
// Register a type (in .cpp file)
INFINITY_TYPE_IMPL(MyCustomType)
// Get its TypeID
const TypeID& id = getTypeID<MyCustomType>();
Runtime type identifier for the Infinity type system.
Definition TypeID.hpp:71