[apps/shared/cartesian_function] Rename CartesianFunctionRecordDataBuffer to RecordDataBuffer

This commit is contained in:
Ruben Dashyan
2019-09-06 12:17:45 +02:00
committed by LeaNumworks
parent 278a247c34
commit 9a3ce0df26
2 changed files with 10 additions and 10 deletions

View File

@@ -58,7 +58,7 @@ CartesianFunction CartesianFunction::NewModel(Ion::Storage::Record::ErrorStatus
// Create the record
char nameBuffer[SymbolAbstract::k_maxNameSize];
int numberOfColors = sizeof(Palette::DataColor)/sizeof(KDColor);
CartesianFunctionRecordDataBuffer data(Palette::DataColor[s_colorIndex++ % numberOfColors]);
RecordDataBuffer data(Palette::DataColor[s_colorIndex++ % numberOfColors]);
if (baseName == nullptr) {
DefaultName(nameBuffer, SymbolAbstract::k_maxNameSize);
baseName = nameBuffer;
@@ -261,17 +261,17 @@ void CartesianFunction::setTMax(float tMax) {
}
void * CartesianFunction::Model::expressionAddress(const Ion::Storage::Record * record) const {
return (char *)record->value().buffer+sizeof(CartesianFunctionRecordDataBuffer);
return (char *)record->value().buffer+sizeof(RecordDataBuffer);
}
size_t CartesianFunction::Model::expressionSize(const Ion::Storage::Record * record) const {
return record->value().size-sizeof(CartesianFunctionRecordDataBuffer);
return record->value().size-sizeof(RecordDataBuffer);
}
CartesianFunction::CartesianFunctionRecordDataBuffer * CartesianFunction::recordData() const {
CartesianFunction::RecordDataBuffer * CartesianFunction::recordData() const {
assert(!isNull());
Ion::Storage::Record::Data d = value();
return reinterpret_cast<CartesianFunctionRecordDataBuffer *>(const_cast<void *>(d.buffer));
return reinterpret_cast<RecordDataBuffer *>(const_cast<void *>(d.buffer));
}
template<typename T>

View File

@@ -70,12 +70,12 @@ private:
typedef Poincare::Coordinate2D<double> (*ComputePointOfInterest)(Poincare::Expression e, char * symbol, double start, double step, double max, Poincare::Context * context);
Poincare::Coordinate2D<double> nextPointOfInterestFrom(double start, double step, double max, Poincare::Context * context, ComputePointOfInterest compute) const;
template <typename T> Poincare::Coordinate2D<T> privateEvaluateXYAtParameter(T t, Poincare::Context * context) const;
/* CartesianFunctionRecordDataBuffer is the layout of the data buffer of Record
/* RecordDataBuffer is the layout of the data buffer of Record
* representing a CartesianFunction. See comment on
* Shared::Function::RecordDataBuffer about packing. */
class __attribute__((packed)) CartesianFunctionRecordDataBuffer : public Function::RecordDataBuffer {
class __attribute__((packed)) RecordDataBuffer : public Function::RecordDataBuffer {
public:
CartesianFunctionRecordDataBuffer(KDColor color) :
RecordDataBuffer(KDColor color) :
Function::RecordDataBuffer(color),
m_plotType(PlotType::Cartesian),
m_domain(-INFINITY, INFINITY),
@@ -103,9 +103,9 @@ private:
private:
size_t expressionSize(const Ion::Storage::Record * record) const override;
};
size_t metaDataSize() const override { return sizeof(CartesianFunctionRecordDataBuffer); }
size_t metaDataSize() const override { return sizeof(RecordDataBuffer); }
const ExpressionModel * model() const override { return &m_model; }
CartesianFunctionRecordDataBuffer * recordData() const;
RecordDataBuffer * recordData() const;
template<typename T> Poincare::Coordinate2D<T> templatedApproximateAtParameter(T t, Poincare::Context * context) const;
Model m_model;
};