#ifndef SHARED_STORAGE_FUNCTION_STORE_H #define SHARED_STORAGE_FUNCTION_STORE_H #include "storage_function.h" #include "storage_expression_model_store.h" #include namespace Shared { /* FunctionStore storse functions and gives them a color. */ class StorageFunctionStore : public StorageExpressionModelStore { public: StorageFunctionStore() : StorageExpressionModelStore() {} uint32_t storeChecksum(); // An active function must be defined to be counted int numberOfActiveFunctions() const { return numberOfModelsSatisfyingTest([](StorageExpressionModel * m) { return m->isDefined() && static_cast(m)->isActive(); }); } Ion::Storage::Record activeRecordAtIndex(int i) const { return recordStatifyingTestAtIndex(i, [](StorageExpressionModel * m) { return m->isDefined() && static_cast(m)->isActive(); }); } ExpiringPointer modelForRecord(Ion::Storage::Record record) const { return ExpiringPointer(static_cast(privateModelForRecord(record))); } virtual char symbol() const = 0; }; } #endif