Numworks Epsilon  1.4.1
Graphing Calculator Operating System
bounded_static_hierarchy.cpp
Go to the documentation of this file.
3 extern "C" {
4 #include <assert.h>
5 }
6 
7 namespace Poincare {
8 
9 template<int T>
11  StaticHierarchy<T>(),
12  m_numberOfOperands(0)
13 {
14 }
15 
16 template<int T>
17 BoundedStaticHierarchy<T>::BoundedStaticHierarchy(const Expression * const * operands, int numberOfOperands, bool cloneOperands) :
18  m_numberOfOperands(numberOfOperands)
19 {
20  StaticHierarchy<T>::build(operands, numberOfOperands, cloneOperands);
21 }
22 
23 template<>
24 BoundedStaticHierarchy<2>::BoundedStaticHierarchy(const Expression * e1, const Expression * e2, bool cloneOperands) :
25  BoundedStaticHierarchy(ExpressionArray(e1, e2).array(), 2, cloneOperands)
26 {
27 }
28 
29 template<>
31  BoundedStaticHierarchy((Expression **)&e, 1, cloneOperands)
32 {
33 }
34 
35 template<int T>
36 void BoundedStaticHierarchy<T>::setArgument(ListData * listData, int numberOfOperands, bool clone) {
37  StaticHierarchy<T>::setArgument(listData, numberOfOperands, clone);
38  m_numberOfOperands = listData->numberOfOperands();
39 }
40 
41 template<int T>
42 bool BoundedStaticHierarchy<T>::hasValidNumberOfOperands(int numberOfOperands) const {
43  return numberOfOperands >= 1 && numberOfOperands <= T;
44 }
45 
47 
48 }
#define T(x)
Definition: events.cpp:26
int numberOfOperands() const
Definition: list_data.cpp:37