taco-db  0.1.0
Operator.h
Go to the documentation of this file.
1 
7 #ifndef CATALOG_SYSTABLES_Operator_H
8 #define CATALOG_SYSTABLES_Operator_H
9 
10 namespace taco {
11 
17 public:
18 
22  constexpr uint8_t
23  optype() const {
24  return m_optype;
25  }
26 
30  constexpr Oid
31  opfuncid() const {
32  return m_opfuncid;
33  }
34 
38  constexpr Oid
39  oparg0typid() const {
40  return m_oparg0typid;
41  }
42 
46  constexpr Oid
47  oparg1typid() const {
48  return m_oparg1typid;
49  }
50 
51 
52 
53 private:
55  uint8_t optype,
56  Oid opfuncid,
59 
60  ):
61  m_optype((optype)),
65 {}
66 
67  uint8_t m_optype;
71 
78  std::vector<Datum> GetDatumVector() const;
79 
85  static SysTable_Operator *Create(const std::vector<Datum>&);
86 
89 
90  friend class BootstrapCatCache;
91  friend class CatCacheInternalAccess;
92 
93 public:
94  // The following are constants of the field ids in the systables.
95  // These are mostly used by the catalog cache impl. to prevent accidental
96  // misspelling of column names.
97 
98  inline static constexpr FieldId
100  return 0;
101  }
102 
103  inline static constexpr FieldId
105  return 1;
106  }
107 
108  inline static constexpr FieldId
110  return 2;
111  }
112 
113  inline static constexpr FieldId
115  return 3;
116  }
117 
118 
119 };
120 
121 } // namespace taco
122 
123 #endif // CATALOG_SYSTABLES_Operator_H
124 
BootstrapCatCache stores hard-coded data needed to bootstrap the entire database catalog.
Definition: BootstrapCatCache.h:21
Some internal functions of catalog cache implementations.
Definition: CatCacheBase.h:38
SysTable_Operator is an in-memory cached record in the system catalog SysTable_Operator.
Definition: Operator.h:16
constexpr uint8_t optype() const
Returns the type of the operator, see expr/optypes.h.
Definition: Operator.h:23
SysTable_Operator(const SysTable_Operator &)=default
static SysTable_Operator * Create(const std::vector< Datum > &)
Creates a new SysTable_Operator with a data vector read from some record payload.
Definition: Operator.cpp:17
constexpr Oid opfuncid() const
Returns the function ID.
Definition: Operator.h:31
constexpr Oid oparg1typid() const
Returns the type id of the operand 1.
Definition: Operator.h:47
std::vector< Datum > GetDatumVector() const
Returns all the fields as a datum vector.
Definition: Operator.cpp:33
static constexpr FieldId oparg1typid_colid()
Definition: Operator.h:114
static constexpr FieldId oparg0typid_colid()
Definition: Operator.h:109
static constexpr FieldId opfuncid_colid()
Definition: Operator.h:104
static constexpr FieldId optype_colid()
Definition: Operator.h:99
Oid m_oparg0typid
Definition: Operator.h:69
uint8_t m_optype
Definition: Operator.h:67
Oid m_oparg1typid
Definition: Operator.h:70
SysTable_Operator & operator=(const SysTable_Operator &)=default
SysTable_Operator(uint8_t optype, Oid opfuncid, Oid oparg0typid, Oid oparg1typid)
Definition: Operator.h:54
constexpr Oid oparg0typid() const
Returns the type id of the operand 0.
Definition: Operator.h:39
Oid m_opfuncid
Definition: Operator.h:68
Definition: datum.h:28
uint32_t Oid
Definition: tdb_base.h:210
int16_t FieldId
Definition: tdb_base.h:212