Tenncor
ileaf.hpp
Go to the documentation of this file.
1 
9 #include "teq/itensor.hpp"
10 #include "teq/idata.hpp"
11 
12 #ifndef TEQ_ILEAF_HPP
13 #define TEQ_ILEAF_HPP
14 
15 namespace teq
16 {
17 
19 struct iLeaf : public iTensor, public iData
20 {
21  virtual ~iLeaf (void) = default;
22 
24  void accept (iTraveler& visiter) override
25  {
26  visiter.visit(this);
27  }
28 
30  virtual bool is_const (void) const = 0;
31 };
32 
34 using LeafptrT = std::shared_ptr<iLeaf>;
35 
36 }
37 
38 #endif // TEQ_ILEAF_HPP
std::shared_ptr< iLeaf > LeafptrT
Leaf smart pointer.
Definition: ileaf.hpp:34
virtual ~iLeaf(void)=default
Interface for unveiling data.
Definition: idata.hpp:19
virtual bool is_const(void) const =0
Return true if leaf is immutable, otherwise false.
Interface to travel through graph, treating iLeaf and iFunctor differently.
Definition: itensor.hpp:24
virtual void visit(iLeaf *leaf)=0
Visit leaf node.
Definition: coord.hpp:16
Interface of traversible and differentiable nodes with shape information.
Definition: itensor.hpp:36
Leaf of the graph commonly representing the variable in an equation.
Definition: ileaf.hpp:19
void accept(iTraveler &visiter) override
Implementation of iTensor.
Definition: ileaf.hpp:24