OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RelLogicalValues Class Reference

#include <RelAlgDagBuilder.h>

+ Inheritance diagram for RelLogicalValues:
+ Collaboration diagram for RelLogicalValues:

Public Types

using RowValues = std::vector< std::unique_ptr< const RexScalar >>
 

Public Member Functions

 RelLogicalValues (const std::vector< TargetMetaInfo > &tuple_type, std::vector< RowValues > &values)
 
 RelLogicalValues (RelLogicalValues const &)
 
const std::vector< TargetMetaInfogetTupleType () const
 
std::string toString () const override
 
const RexScalargetValueAt (const size_t row_idx, const size_t col_idx) const
 
size_t getRowsSize () const
 
size_t getNumRows () const
 
size_t size () const override
 
bool hasRows () const
 
std::shared_ptr< RelAlgNodedeepCopy () const override
 
- Public Member Functions inherited from RelAlgNode
 RelAlgNode (RelAlgInputs inputs={})
 
virtual ~RelAlgNode ()
 
void resetQueryExecutionState ()
 
void setContextData (const void *context_data) const
 
void setOutputMetainfo (const std::vector< TargetMetaInfo > &targets_metainfo) const
 
const std::vector
< TargetMetaInfo > & 
getOutputMetainfo () const
 
unsigned getId () const
 
bool hasContextData () const
 
const void * getContextData () const
 
const size_t inputCount () const
 
const RelAlgNodegetInput (const size_t idx) const
 
std::shared_ptr< const RelAlgNodegetAndOwnInput (const size_t idx) const
 
void addManagedInput (std::shared_ptr< const RelAlgNode > input)
 
bool hasInput (const RelAlgNode *needle) const
 
virtual void replaceInput (std::shared_ptr< const RelAlgNode > old_input, std::shared_ptr< const RelAlgNode > input)
 
bool isNop () const
 
void markAsNop ()
 
void clearContextData () const
 

Private Attributes

const std::vector< TargetMetaInfotuple_type_
 
const std::vector< RowValuesvalues_
 

Additional Inherited Members

- Static Public Member Functions inherited from RelAlgNode
static void resetRelAlgFirstId () noexcept
 
- Protected Attributes inherited from RelAlgNode
RelAlgInputs inputs_
 
const unsigned id_
 

Detailed Description

Definition at line 1686 of file RelAlgDagBuilder.h.

Member Typedef Documentation

using RelLogicalValues::RowValues = std::vector<std::unique_ptr<const RexScalar>>

Definition at line 1688 of file RelAlgDagBuilder.h.

Constructor & Destructor Documentation

RelLogicalValues::RelLogicalValues ( const std::vector< TargetMetaInfo > &  tuple_type,
std::vector< RowValues > &  values 
)
inline

Definition at line 1690 of file RelAlgDagBuilder.h.

1692  : tuple_type_(tuple_type), values_(std::move(values)) {}
const std::vector< TargetMetaInfo > tuple_type_
const std::vector< RowValues > values_
RelLogicalValues::RelLogicalValues ( RelLogicalValues const &  rhs)

Definition at line 354 of file RelAlgDagBuilder.cpp.

355  : RelAlgNode(rhs)
356  , tuple_type_(rhs.tuple_type_)
357  , values_(RexDeepCopyVisitor::copy(rhs.values_)) {}
RelAlgNode(RelAlgInputs inputs={})
const std::vector< TargetMetaInfo > tuple_type_
const std::vector< RowValues > values_
static std::vector< RowValues > copy(std::vector< RowValues > const &rhs)
Definition: RexVisitor.h:209

Member Function Documentation

std::shared_ptr<RelAlgNode> RelLogicalValues::deepCopy ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1729 of file RelAlgDagBuilder.h.

1729  {
1730  return std::make_shared<RelLogicalValues>(*this);
1731  }
size_t RelLogicalValues::getNumRows ( ) const
inline

Definition at line 1723 of file RelAlgDagBuilder.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build(), RelAlgExecutor::executeLogicalValues(), and RelRexDagVisitor::visit().

1723 { return values_.size(); }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

size_t RelLogicalValues::getRowsSize ( ) const
inline

Definition at line 1715 of file RelAlgDagBuilder.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build(), and RelRexDagVisitor::visit().

1715  {
1716  if (values_.empty()) {
1717  return 0;
1718  } else {
1719  return values_.front().size();
1720  }
1721  }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

const std::vector<TargetMetaInfo> RelLogicalValues::getTupleType ( ) const
inline

Definition at line 1696 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by RelAlgExecutor::executeLogicalValues().

1696 { return tuple_type_; }
const std::vector< TargetMetaInfo > tuple_type_

+ Here is the caller graph for this function:

const RexScalar* RelLogicalValues::getValueAt ( const size_t  row_idx,
const size_t  col_idx 
) const
inline

Definition at line 1708 of file RelAlgDagBuilder.h.

References CHECK_LT, and values_.

Referenced by ResultSetLogicalValuesBuilder::build(), and RelRexDagVisitor::visit().

1708  {
1709  CHECK_LT(row_idx, values_.size());
1710  const auto& row = values_[row_idx];
1711  CHECK_LT(col_idx, row.size());
1712  return row[col_idx].get();
1713  }
const std::vector< RowValues > values_
#define CHECK_LT(x, y)
Definition: Logger.h:207

+ Here is the caller graph for this function:

bool RelLogicalValues::hasRows ( ) const
inline

Definition at line 1727 of file RelAlgDagBuilder.h.

References values_.

Referenced by ResultSetLogicalValuesBuilder::build().

1727 { return !values_.empty(); }
const std::vector< RowValues > values_

+ Here is the caller graph for this function:

size_t RelLogicalValues::size ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1725 of file RelAlgDagBuilder.h.

References tuple_type_.

Referenced by ResultSetLogicalValuesBuilder::build().

1725 { return tuple_type_.size(); }
const std::vector< TargetMetaInfo > tuple_type_

+ Here is the caller graph for this function:

std::string RelLogicalValues::toString ( ) const
inlineoverridevirtual

Implements RelAlgNode.

Definition at line 1698 of file RelAlgDagBuilder.h.

References tuple_type_.

1698  {
1699  std::string ret = ::typeName(this) + "(";
1700  for (const auto& target_meta_info : tuple_type_) {
1701  ret += " (" + target_meta_info.get_resname() + " " +
1702  target_meta_info.get_type_info().get_type_name() + ")";
1703  }
1704  ret += ")";
1705  return ret;
1706  }
const std::vector< TargetMetaInfo > tuple_type_

Member Data Documentation

const std::vector<TargetMetaInfo> RelLogicalValues::tuple_type_
private

Definition at line 1734 of file RelAlgDagBuilder.h.

Referenced by getTupleType(), size(), and toString().

const std::vector<RowValues> RelLogicalValues::values_
private

Definition at line 1735 of file RelAlgDagBuilder.h.

Referenced by getNumRows(), getRowsSize(), getValueAt(), and hasRows().


The documentation for this class was generated from the following files: