docc 0.8.3 (0d44999b)
C++ API Reference
Loading...
Searching...
No Matches
sdfg::transformations::replayable_transformation_concept Concept Reference

Concept for transformations that can be replayed from a JSON description. More...

#include <sdfg/transformations/transformation_registry.h>

Concept definition

template<typename T>
const nlohmann::json& desc,
const T& transformation,
nlohmann::json& out
) {
{ T::from_json(builder, desc) } -> std::same_as<T>;
{ transformation.to_json(out) } -> std::same_as<void>;
}
Note: Even though the class references unique_ptr, it will never delete an SDFG it has a reference to...
Definition structured_sdfg_builder.h:44
Concept for transformations that can be replayed from a JSON description.
Definition transformation_registry.h:69
Concept for types that are transformations.
Definition recorder.h:21
Definition function_builder.h:10

Detailed Description

Concept for transformations that can be replayed from a JSON description.

In addition to being a transformation_concept (i.e. derived from Transformation), a replayable transformation must provide the exact serialization contract used by the replayers:

  • a static from_json(builder, desc) factory returning the transformation by value (this also guarantees the type is concrete / non-abstract), and
  • a to_json(json&) const member overriding the pure-virtual base method.

Registering a transformation in dispatch_transformation instantiates this concept, so any type whose from_json/to_json do not match the required form fails to compile with a clear diagnostic.