OmniSciDB  04ee39c94c
WindowProjectNodeContext Class Reference

#include <WindowContext.h>

+ Collaboration diagram for WindowProjectNodeContext:

Public Member Functions

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

Static Public Member Functions

static void resetWindowFunctionContext ()
 
static WindowFunctionContextgetActiveWindowFunctionContext ()
 
static WindowProjectNodeContextcreate ()
 
static const WindowProjectNodeContextget ()
 
static void reset ()
 

Private Attributes

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

Static Private Attributes

static std::unique_ptr< WindowProjectNodeContexts_instance_
 
static WindowFunctionContexts_active_window_function_ {nullptr}
 

Detailed Description

Definition at line 173 of file WindowContext.h.

Member Function Documentation

◆ activateWindowFunctionContext()

const WindowFunctionContext * WindowProjectNodeContext::activateWindowFunctionContext ( const size_t  target_index) const

Definition at line 803 of file WindowContext.cpp.

References CHECK.

Referenced by Executor::codegenWindowFunction().

804  {
805  const auto it = window_contexts_.find(target_index);
806  CHECK(it != window_contexts_.end());
807  s_active_window_function_ = it->second.get();
809 }
static WindowFunctionContext * s_active_window_function_
std::unordered_map< size_t, std::unique_ptr< WindowFunctionContext > > window_contexts_
#define CHECK(condition)
Definition: Logger.h:187
+ Here is the caller graph for this function:

◆ addWindowFunctionContext()

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

Definition at line 795 of file WindowContext.cpp.

References CHECK.

797  {
798  const auto it_ok = window_contexts_.emplace(
799  std::make_pair(target_index, std::move(window_function_context)));
800  CHECK(it_ok.second);
801 }
std::unordered_map< size_t, std::unique_ptr< WindowFunctionContext > > window_contexts_
#define CHECK(condition)
Definition: Logger.h:187

◆ create()

WindowProjectNodeContext * WindowProjectNodeContext::create ( )
static

Definition at line 819 of file WindowContext.cpp.

References get().

Referenced by RelAlgExecutor::computeWindow().

819  {
820  s_instance_ = std::make_unique<WindowProjectNodeContext>();
821  return s_instance_.get();
822 }
static std::unique_ptr< WindowProjectNodeContext > s_instance_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

const WindowProjectNodeContext * WindowProjectNodeContext::get ( )
static

Definition at line 824 of file WindowContext.cpp.

References get().

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

824  {
825  return s_instance_.get();
826 }
static std::unique_ptr< WindowProjectNodeContext > s_instance_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveWindowFunctionContext()

WindowFunctionContext * WindowProjectNodeContext::getActiveWindowFunctionContext ( )
static

◆ reset()

void WindowProjectNodeContext::reset ( )
static

Definition at line 828 of file WindowContext.cpp.

References s_active_window_function_, and s_instance_.

Referenced by RelAlgExecutor::executeRelAlgStep().

828  {
829  s_instance_ = nullptr;
830  s_active_window_function_ = nullptr;
831 }
static WindowFunctionContext * s_active_window_function_
static std::unique_ptr< WindowProjectNodeContext > s_instance_
+ Here is the caller graph for this function:

◆ resetWindowFunctionContext()

void WindowProjectNodeContext::resetWindowFunctionContext ( )
static

Definition at line 811 of file WindowContext.cpp.

Referenced by TargetExprCodegen::codegen().

811  {
812  s_active_window_function_ = nullptr;
813 }
static WindowFunctionContext * s_active_window_function_
+ Here is the caller graph for this function:

Member Data Documentation

◆ s_active_window_function_

WindowFunctionContext * WindowProjectNodeContext::s_active_window_function_ {nullptr}
staticprivate

Definition at line 210 of file WindowContext.h.

Referenced by reset().

◆ s_instance_

std::unique_ptr< WindowProjectNodeContext > WindowProjectNodeContext::s_instance_
staticprivate

Definition at line 208 of file WindowContext.h.

Referenced by reset().

◆ window_contexts_

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

Definition at line 205 of file WindowContext.h.


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