taco-db  0.1.0
Cast.h
Go to the documentation of this file.
1 
7 #ifndef CATALOG_SYSTABLES_Cast_H
8 #define CATALOG_SYSTABLES_Cast_H
9 
10 namespace taco {
11 
17 public:
18 
22  constexpr Oid
23  castfuncid() const {
24  return m_castfuncid;
25  }
26 
30  constexpr Oid
31  castoprtypid() const {
32  return m_castoprtypid;
33  }
34 
38  constexpr Oid
39  castrettypid() const {
40  return m_castrettypid;
41  }
42 
46  constexpr bool
47  castisimplicit() const {
48  return m_castisimplicit;
49  }
50 
51 
52 
53 private:
58  bool castisimplicit
59 
60  ):
65 {}
66 
71 
78  std::vector<Datum> GetDatumVector() const;
79 
85  static SysTable_Cast *Create(const std::vector<Datum>&);
86 
87  SysTable_Cast(const SysTable_Cast&) = default;
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_Cast_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_Cast is an in-memory cached record in the system catalog SysTable_Cast.
Definition: Cast.h:16
Oid m_castrettypid
Definition: Cast.h:69
static SysTable_Cast * Create(const std::vector< Datum > &)
Creates a new SysTable_Cast with a data vector read from some record payload.
Definition: Cast.cpp:17
SysTable_Cast & operator=(const SysTable_Cast &)=default
constexpr Oid castrettypid() const
Returns the type id of the return value.
Definition: Cast.h:39
constexpr Oid castfuncid() const
Returns the function id of the cast.
Definition: Cast.h:23
constexpr bool castisimplicit() const
Returns whether this cast can be implicit.
Definition: Cast.h:47
std::vector< Datum > GetDatumVector() const
Returns all the fields as a datum vector.
Definition: Cast.cpp:33
SysTable_Cast(const SysTable_Cast &)=default
static constexpr FieldId castrettypid_colid()
Definition: Cast.h:109
SysTable_Cast(Oid castfuncid, Oid castoprtypid, Oid castrettypid, bool castisimplicit)
Definition: Cast.h:54
static constexpr FieldId castisimplicit_colid()
Definition: Cast.h:114
Oid m_castfuncid
Definition: Cast.h:67
bool m_castisimplicit
Definition: Cast.h:70
constexpr Oid castoprtypid() const
Returns the type id of the operand.
Definition: Cast.h:31
Oid m_castoprtypid
Definition: Cast.h:68
static constexpr FieldId castfuncid_colid()
Definition: Cast.h:99
static constexpr FieldId castoprtypid_colid()
Definition: Cast.h:104
Definition: datum.h:28
uint32_t Oid
Definition: tdb_base.h:210
int16_t FieldId
Definition: tdb_base.h:212