Files
Upsilon/apps/graph/storage_cartesian_function_store.cpp
Émilie Feral 4be902be93 [apps/shared] Change name StorageExpressionModel -->
ExpressionModelHandle
2019-04-12 15:16:52 +02:00

29 lines
850 B
C++

#include "storage_cartesian_function_store.h"
extern "C" {
#include <assert.h>
#include <stddef.h>
}
#include <ion.h>
using namespace Shared;
namespace Graph {
Ion::Storage::Record::ErrorStatus StorageCartesianFunctionStore::addEmptyModel() {
Ion::Storage::Record::ErrorStatus error;
StorageCartesianFunction newModel = StorageCartesianFunction::NewModel(&error);
return error;
}
void StorageCartesianFunctionStore::setMemoizedModelAtIndex(int cacheIndex, Ion::Storage::Record record) const {
assert(cacheIndex >= 0 && cacheIndex < k_maxNumberOfMemoizedModels);
m_functions[cacheIndex] = StorageCartesianFunction(record);
}
ExpressionModelHandle * StorageCartesianFunctionStore::memoizedModelAtIndex(int cacheIndex) const {
assert(cacheIndex >= 0 && cacheIndex < k_maxNumberOfMemoizedModels);
return &m_functions[cacheIndex];
}
}