OmniSciDB  c0231cc57d
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
WindowProjectNodeContext Class Reference

#include <WindowContext.h>

Public Member Functions

void addWindowFunctionContext (std::unique_ptr< WindowFunctionContext > window_function_context, const size_t target_index)
 
const WindowFunctionContextactivateWindowFunctionContext (Executor *executor, const size_t target_index) const
 

Static Public Member Functions

static void resetWindowFunctionContext (Executor *executor)
 
static WindowFunctionContextgetActiveWindowFunctionContext (Executor *executor)
 
static WindowProjectNodeContextcreate (Executor *executor)
 
static const
WindowProjectNodeContext
get (Executor *executor)
 
static void reset (Executor *executor)
 

Private Attributes

std::unordered_map< size_t,
std::unique_ptr
< WindowFunctionContext > > 
window_contexts_
 

Detailed Description

Definition at line 275 of file WindowContext.h.

Member Function Documentation

const WindowFunctionContext * WindowProjectNodeContext::activateWindowFunctionContext ( Executor executor,
const size_t  target_index 
) const

Definition at line 1610 of file WindowContext.cpp.

References CHECK.

Referenced by Executor::codegenWindowFunction().

1612  {
1613  const auto it = window_contexts_.find(target_index);
1614  CHECK(it != window_contexts_.end());
1615  executor->active_window_function_ = it->second.get();
1616  return executor->active_window_function_;
1617 }
std::unordered_map< size_t, std::unique_ptr< WindowFunctionContext > > window_contexts_
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function:

void WindowProjectNodeContext::addWindowFunctionContext ( std::unique_ptr< WindowFunctionContext window_function_context,
const size_t  target_index 
)

Definition at line 1602 of file WindowContext.cpp.

References CHECK.

1604  {
1605  const auto it_ok = window_contexts_.emplace(
1606  std::make_pair(target_index, std::move(window_function_context)));
1607  CHECK(it_ok.second);
1608 }
std::unordered_map< size_t, std::unique_ptr< WindowFunctionContext > > window_contexts_
#define CHECK(condition)
Definition: Logger.h:222
WindowProjectNodeContext * WindowProjectNodeContext::create ( Executor executor)
static

Definition at line 1628 of file WindowContext.cpp.

References get().

Referenced by RelAlgExecutor::computeWindow().

1628  {
1629  executor->window_project_node_context_owned_ =
1630  std::make_unique<WindowProjectNodeContext>();
1631  return executor->window_project_node_context_owned_.get();
1632 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const WindowProjectNodeContext * WindowProjectNodeContext::get ( Executor executor)
static

Definition at line 1634 of file WindowContext.cpp.

References get().

Referenced by Executor::codegenWindowFunction(), Executor::codegenWindowFunctionAggregate(), create(), and get().

1634  {
1635  return executor->window_project_node_context_owned_.get();
1636 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

WindowFunctionContext * WindowProjectNodeContext::getActiveWindowFunctionContext ( Executor executor)
static
void WindowProjectNodeContext::reset ( Executor executor)
static

Definition at line 1638 of file WindowContext.cpp.

Referenced by RelAlgExecutor::executeWorkUnit().

1638  {
1639  executor->window_project_node_context_owned_ = nullptr;
1640  executor->active_window_function_ = nullptr;
1641 }

+ Here is the caller graph for this function:

void WindowProjectNodeContext::resetWindowFunctionContext ( Executor executor)
static

Definition at line 1619 of file WindowContext.cpp.

Referenced by TargetExprCodegen::codegen().

1619  {
1620  executor->active_window_function_ = nullptr;
1621 }

+ Here is the caller graph for this function:

Member Data Documentation

std::unordered_map<size_t, std::unique_ptr<WindowFunctionContext> > WindowProjectNodeContext::window_contexts_
private

Definition at line 308 of file WindowContext.h.


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