OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetMetaInfo.h
Go to the documentation of this file.
1 /*
2  * Copyright 2022 HEAVY.AI, Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef QUERYENGINE_TARGETMETAINFO_H
18 #define QUERYENGINE_TARGETMETAINFO_H
19 
20 #include <string>
21 
22 #include "../Shared/sqltypes.h"
23 
24 /*
25  * @type TargetMetaInfo
26  * @brief Encapsulates the name and the type of a relational projection.
27  */
29  public:
30  TargetMetaInfo(const std::string& resname, const SQLTypeInfo& ti)
31  : resname_(resname), ti_(ti), physical_ti_(ti) {}
32  TargetMetaInfo(const std::string& resname,
33  const SQLTypeInfo& ti,
34  const SQLTypeInfo& physical_ti)
35  : resname_(resname), ti_(ti), physical_ti_(physical_ti) {}
36  const std::string& get_resname() const { return resname_; }
37  const SQLTypeInfo& get_type_info() const { return ti_; }
38  const SQLTypeInfo& get_physical_type_info() const { return physical_ti_; }
39 
40  std::string toString() const {
41  return "TargetMetaInfo(" + resname_ + ", " + ti_.to_string() + ", " +
42  physical_ti_.to_string() + ") ";
43  }
44 
45  private:
46  std::string resname_;
49 };
50 
51 inline std::ostream& operator<<(std::ostream& os, TargetMetaInfo const& tmi) {
52  return os << "TargetMetaInfo(resname_(" << tmi.get_resname() << ") ti_("
53  << tmi.get_type_info().to_string() << ") physical_ti_("
54  << tmi.get_physical_type_info().to_string() << "))";
55 }
56 
57 #endif // QUERYENGINE_TARGETMETAINFO_H
SQLTypeInfo physical_ti_
std::string resname_
std::ostream & operator<<(std::ostream &os, const SessionInfo &session_info)
Definition: SessionInfo.cpp:57
const SQLTypeInfo & get_type_info() const
TargetMetaInfo(const std::string &resname, const SQLTypeInfo &ti)
const SQLTypeInfo & get_physical_type_info() const
std::string to_string() const
Definition: sqltypes.h:528
SQLTypeInfo ti_
std::string toString() const
const std::string & get_resname() const
TargetMetaInfo(const std::string &resname, const SQLTypeInfo &ti, const SQLTypeInfo &physical_ti)