22#include "../inputSet.hpp"
23#include <jaffarCommon/deserializers/base.hpp>
24#include <jaffarCommon/json.hpp>
25#include <jaffarCommon/serializers/base.hpp>
59 virtual void serializeCold(jaffarCommon::serializer::Base& s)
const = 0;
64 virtual void serializeFull(jaffarCommon::serializer::Base& s)
const = 0;
67 virtual void deserializeFull(jaffarCommon::deserializer::Base& d,
const size_t stepCount) = 0;
71 virtual std::string
toString(
const std::map<InputSet::inputIndex_t, std::string>& inputStringMap,
const size_t stepCount)
const = 0;
Abstract strategy for remembering the input path that produced each search state.
virtual void serializeFull(jaffarCommon::serializer::Base &s) const =0
Writes the self-contained "full" path representation (for standalone snapshot buffers),...
virtual void releaseColdSlot(void *cold, const size_t shard) const
Releases any shared resource a freed cold slot was holding (trie GC).
virtual size_t getColdSize() const =0
Size, in bytes, of the cold path representation in a StateDb slot (EXCLUDING the runner's count).
virtual void reset()=0
Resets the cursor to the empty path.
virtual size_t getFullSize() const =0
Size, in bytes, of the full (self-contained) path representation in a snapshot buffer (EXCLUDING the ...
virtual void deserializeFull(jaffarCommon::deserializer::Base &d, const size_t stepCount)=0
Restores the cursor from a "full" representation.
virtual ~InputHistory()=default
Virtual destructor for the strategy interface.
virtual void serializeCold(jaffarCommon::serializer::Base &s) const =0
Writes the compact "cold" path representation (stored in each StateDb slot), excluding the count.
virtual std::string toString(const std::map< InputSet::inputIndex_t, std::string > &inputStringMap, const size_t stepCount) const =0
Reconstructs the path as a newline-separated string of input strings (the solution).
virtual size_t getApproxMemoryBytes() const
Approximate resident memory of any shared structure (e.g. the trie), in bytes. Default: 0.
virtual void initColdSlot(void *cold) const
Prepares a fresh/recycled cold slot (e.g. marks it as holding no trie node). Default: no-op.
virtual void deserializeCold(jaffarCommon::deserializer::Base &d)=0
Restores the cursor from a "cold" representation (the count is restored by the runner).
virtual void captureColdToFull(const void *cold, void *full) const =0
Converts a stored cold path into a self-contained full one (best/worst snapshot).
virtual void pushInput(const size_t stepCount, const InputSet::inputIndex_t input)=0
Records one applied input at path position stepCount (the runner's current step counter).