taco-db  0.1.0
Function.h
Go to the documentation of this file.
1 
7 #ifndef CATALOG_SYSTABLES_Function_H
8 #define CATALOG_SYSTABLES_Function_H
9 
10 namespace taco {
11 
17 public:
18 
22  constexpr Oid
23  funcid() const {
24  return m_funcid;
25  }
26 
30  constexpr int16_t
31  funcnargs() const {
32  return m_funcnargs;
33  }
34 
38  constexpr Oid
39  funcrettypid() const {
40  return m_funcrettypid;
41  }
42 
46  constexpr const std::string&
47  funcname() const {
48  return m_funcname;
49  }
50 
51 
52 
53 private:
55  Oid funcid,
56  int16_t funcnargs,
58  std::string funcname
59 
60  ):
61  m_funcid((funcid)),
64  m_funcname(std::move(funcname))
65 {}
66 
68  int16_t m_funcnargs;
70  std::string m_funcname;
71 
78  std::vector<Datum> GetDatumVector() const;
79 
85  static SysTable_Function *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_Function_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_Function is an in-memory cached record in the system catalog SysTable_Function.
Definition: Function.h:16
SysTable_Function(Oid funcid, int16_t funcnargs, Oid funcrettypid, std::string funcname)
Definition: Function.h:54
Oid m_funcrettypid
Definition: Function.h:69
SysTable_Function(const SysTable_Function &)=default
Oid m_funcid
Definition: Function.h:67
static SysTable_Function * Create(const std::vector< Datum > &)
Creates a new SysTable_Function with a data vector read from some record payload.
Definition: Function.cpp:17
static constexpr FieldId funcnargs_colid()
Definition: Function.h:104
constexpr int16_t funcnargs() const
Returns the number of arguments.
Definition: Function.h:31
constexpr Oid funcid() const
Returns the function ID.
Definition: Function.h:23
int16_t m_funcnargs
Definition: Function.h:68
std::string m_funcname
Definition: Function.h:70
std::vector< Datum > GetDatumVector() const
Returns all the fields as a datum vector.
Definition: Function.cpp:33
static constexpr FieldId funcid_colid()
Definition: Function.h:99
constexpr Oid funcrettypid() const
Returns the return type id.
Definition: Function.h:39
static constexpr FieldId funcname_colid()
Definition: Function.h:114
SysTable_Function & operator=(const SysTable_Function &)=default
static constexpr FieldId funcrettypid_colid()
Definition: Function.h:109
constexpr const std::string & funcname() const
Returns the function name.
Definition: Function.h:47
Definition: Record.h:148
Definition: datum.h:28
uint32_t Oid
Definition: tdb_base.h:210
int16_t FieldId
Definition: tdb_base.h:212