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 
87  SysTable_Function(const SysTable_Function&) = 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_Function_H
124 
taco::SysTable_Function
SysTable_Function is an in-memory cached record in the system catalog SysTable_Function.
Definition: Function.h:16
taco::SysTable_Function::SysTable_Function
SysTable_Function(Oid funcid, int16_t funcnargs, Oid funcrettypid, std::string funcname)
Definition: Function.h:54
taco::SysTable_Function::funcrettypid_colid
static constexpr FieldId funcrettypid_colid()
Definition: Function.h:109
taco::SysTable_Function::funcname_colid
static constexpr FieldId funcname_colid()
Definition: Function.h:114
taco::SysTable_Function::Create
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
taco::SysTable_Function::m_funcrettypid
Oid m_funcrettypid
Definition: Function.h:69
taco
Definition: datum.h:28
taco::SysTable_Function::funcid_colid
static constexpr FieldId funcid_colid()
Definition: Function.h:99
taco::FieldId
int16_t FieldId
Definition: tdb_base.h:213
taco::CatCacheInternalAccess
Some internal functions of catalog cache implementations.
Definition: CatCacheBase.h:38
taco::SysTable_Function::m_funcnargs
int16_t m_funcnargs
Definition: Function.h:68
taco::SysTable_Function::funcnargs
constexpr int16_t funcnargs() const
Returns the number of arguments.
Definition: Function.h:31
taco::SysTable_Function::GetDatumVector
std::vector< Datum > GetDatumVector() const
Returns all the fields as a datum vector.
Definition: Function.cpp:33
taco::SysTable_Function::funcid
constexpr Oid funcid() const
Returns the function ID.
Definition: Function.h:23
taco::SysTable_Function::funcname
constexpr const std::string & funcname() const
Returns the function name.
Definition: Function.h:47
taco::BootstrapCatCache
BootstrapCatCache stores hard-coded data needed to bootstrap the entire database catalog.
Definition: BootstrapCatCache.h:21
taco::SysTable_Function::m_funcid
Oid m_funcid
Definition: Function.h:67
taco::Oid
uint32_t Oid
Definition: tdb_base.h:211
std
Definition: Record.h:148
taco::SysTable_Function::funcrettypid
constexpr Oid funcrettypid() const
Returns the return type id.
Definition: Function.h:39
taco::SysTable_Function::funcnargs_colid
static constexpr FieldId funcnargs_colid()
Definition: Function.h:104
taco::SysTable_Function::m_funcname
std::string m_funcname
Definition: Function.h:70
taco::SysTable_Function::operator=
SysTable_Function & operator=(const SysTable_Function &)=default