codac 2.0.0
Loading...
Searching...
No Matches
codac2_VarBase.h
Go to the documentation of this file.
1
9
10#pragma once
11
12#include "codac2_ExprBase.h"
13
14namespace codac2
15{
23 class VarBase
24 {
25 public:
26
27 VarBase(const std::string& name)
28 : _name(name)
29 { }
30
31 const std::string& name() const
32 {
33 return _name;
34 }
35
41 virtual ~VarBase() = default;
42
52 virtual const ExprID& unique_id() const = 0;
53
61 virtual std::shared_ptr<VarBase> arg_copy() const = 0;
62
72 virtual Index size() const = 0;
73
74 protected:
75
76 friend class FunctionArgsList;
77
78 std::string _name;
79 };
80}
A class representing a unique identifier for expressions.
Definition codac2_ExprBase.h:33
virtual const ExprID & unique_id() const =0
Returns the unique identifier of the variable.
virtual Index size() const =0
Returns the mathematical size of the variable.
virtual ~VarBase()=default
Virtual destructor for the VarBase class.
virtual std::shared_ptr< VarBase > arg_copy() const =0
Creates a copy of the argument.