11 m_expression(nullptr),
22 m_color = other.m_color;
23 m_name = other.m_name;
24 m_active = other.m_active;
30 char data[k_dataLengthInBytes/
sizeof(char)] = {};
32 data[k_dataLengthInBytes-2] = m_name !=
nullptr ? m_name[0] : 0;
33 data[k_dataLengthInBytes-1] = m_active ? 1 : 0;
39 if (m_layout !=
nullptr) {
43 if (m_expression !=
nullptr) {
45 m_expression =
nullptr;
54 if (m_layout !=
nullptr) {
58 if (m_expression !=
nullptr) {
60 m_expression =
nullptr;
73 if (m_expression ==
nullptr) {
74 m_expression = Expression::ParseAndSimplify(m_text, *context);
80 if (m_layout ==
nullptr) {
81 Expression * nonSimplifiedExpression = Expression::parse(m_text);
82 if (nonSimplifiedExpression !=
nullptr) {
83 m_layout = nonSimplifiedExpression->
createLayout(PrintFloat::Mode::Decimal);
84 delete nonSimplifiedExpression;
91 return m_text[0] != 0;
103 return m_text[0] == 0;
116 if (m_layout !=
nullptr) {
120 if (m_expression !=
nullptr) {
122 m_expression =
nullptr;
128 template float Shared::Function::templatedApproximateAtAbscissa<float>(float,
Poincare::Context*)
const;
129 template double Shared::Function::templatedApproximateAtAbscissa<double>(double,
Poincare::Context*)
const;
virtual void setContent(const char *c)
void setColor(KDColor m_color)
static constexpr int maxBufferSize()
void(* Function)(const char *input)
const char * text() const
size_t strlcpy(char *dst, const char *src, size_t len)
Poincare::Expression * expression(Poincare::Context *context) const
void setActive(bool active)
virtual uint32_t checksum()
const char * name() const
ExpressionLayout * createLayout(PrintFloat::Mode floatDisplayMode=PrintFloat::Mode::Default, ComplexFormat complexFormat=ComplexFormat::Default) const
Poincare::ExpressionLayout * layout()
static Complex< T > Float(T x)
uint32_t crc32(const uint32_t *data, size_t length)
Function & operator=(const Function &other)
T approximateToScalar(Context &context, AngleUnit angleUnit=AngleUnit::Default) const
void setExpressionForSymbolName(const Expression *expression, const Symbol *symbol, Context &context) override