50 lines
1.8 KiB
C
50 lines
1.8 KiB
C
#pragma once
|
|
|
|
/// \file object.h
|
|
/// \author Folling <folling@ikarus.world>
|
|
|
|
#include <ikarus/errors.h>
|
|
#include <ikarus/macros.h>
|
|
|
|
/// \defgroup object Objects
|
|
/// \brief Objects are a compound type of all types of objects in the database.
|
|
/// \details The following objects currently exist:
|
|
/// - \ref blueprint.h "Blueprints"
|
|
/// - \ref property.h "Properties"
|
|
/// - \ref entity.h "Entities"
|
|
/// @{
|
|
|
|
IKARUS_BEGIN_HEADER
|
|
|
|
/// \brief A generic object. Wraps all types of objects, including folders.
|
|
struct IkarusObject;
|
|
|
|
/// \brief Visits an object. Calling the appropriate function for the object's type.
|
|
/// \param object The object to visit.
|
|
/// \param blueprint_visitor The function to call if the object is a blueprint. Skipped if null.
|
|
/// \param property_visitor The function to call if the object is a property. Skipped if null.
|
|
/// \param entity_visitor The function to call if the object is an entity. Skipped if null.
|
|
/// \param data The data passed to the visitor functions.
|
|
/// \param error_out \see errors.h
|
|
IKA_API void ikarus_object_visit(
|
|
IkarusObject * object,
|
|
void (*blueprint_visitor)(struct IkarusBlueprint *, IkarusErrorData * error_out, void *),
|
|
void (*property_visitor)(struct IkarusProperty *, IkarusErrorData * error_out, void *),
|
|
void (*entity_visitor)(struct IkarusEntity *, IkarusErrorData * error_out, void *),
|
|
void * data,
|
|
IkarusErrorData * error_out
|
|
);
|
|
|
|
/// \see ikarus_object_visit
|
|
IKA_API void ikarus_object_visit_const(
|
|
IkarusObject const * object,
|
|
void (*blueprint_visitor)(struct IkarusBlueprint const *, IkarusErrorData * error_out, void *),
|
|
void (*property_visitor)(struct IkarusProperty const *, IkarusErrorData * error_out, void *),
|
|
void (*entity_visitor)(struct IkarusEntity const *, IkarusErrorData * error_out, void *),
|
|
void * data,
|
|
IkarusErrorData * error_out
|
|
);
|
|
|
|
IKARUS_END_HEADER
|
|
|
|
/// @}
|