Files
Upsilon/apps/graph/storage_cartesian_function_store.cpp
Émilie Feral a7192df59c [apps/shared] Split ExpressionModelHandle into ExpressionModelHandle and
SingleExpressionModelHandle (in perspective of Sequence model who will
be composed of 3 ExpressionModelHandle)
2019-04-12 15:16:52 +02:00

29 lines
856 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 < maxNumberOfMemoizedModels());
m_functions[cacheIndex] = StorageCartesianFunction(record);
}
SingleExpressionModelHandle * StorageCartesianFunctionStore::memoizedModelAtIndex(int cacheIndex) const {
assert(cacheIndex >= 0 && cacheIndex < maxNumberOfMemoizedModels());
return &m_functions[cacheIndex];
}
}