OmniSciDB  c07336695a
StringDictionaryGenerations Class Reference

#include <StringDictionaryGenerations.h>

Public Member Functions

void setGeneration (const uint32_t id, const size_t generation)
 
ssize_t getGeneration (const uint32_t id) const
 
const std::unordered_map< uint32_t, size_t > & asMap () const
 
void clear ()
 

Private Attributes

std::unordered_map< uint32_t, size_t > id_to_generation_
 

Detailed Description

Definition at line 22 of file StringDictionaryGenerations.h.

Member Function Documentation

◆ asMap()

const std::unordered_map< uint32_t, size_t > & StringDictionaryGenerations::asMap ( ) const

Definition at line 39 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

39  {
40  return id_to_generation_;
41 }
std::unordered_map< uint32_t, size_t > id_to_generation_

◆ clear()

void StringDictionaryGenerations::clear ( )

Definition at line 43 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

Referenced by Executor::clearMetaInfoCache().

43  {
44  decltype(id_to_generation_)().swap(id_to_generation_);
45 }
std::unordered_map< uint32_t, size_t > id_to_generation_
+ Here is the caller graph for this function:

◆ getGeneration()

ssize_t StringDictionaryGenerations::getGeneration ( const uint32_t  id) const

Definition at line 24 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

Referenced by Executor::getStringDictionaryProxy().

24  {
25  const auto it = id_to_generation_.find(id);
26  if (it != id_to_generation_.end()) {
27  return it->second;
28  }
29  // This happens when the query didn't need to do any translation from string
30  // to id. Return an invalid generation and StringDictionaryProxy will assert
31  // the methods which require a generation (the ones which go from string to id)
32  // are called on it if it has an invalid generation, only the id from string
33  // direction is allowed in such cases. Once a query finishes its effective
34  // execution, the generations are cleared and the string to id direction
35  // isn't needed anymore, only the opposite for the returned result set.
36  return -1;
37 }
std::unordered_map< uint32_t, size_t > id_to_generation_
+ Here is the caller graph for this function:

◆ setGeneration()

void StringDictionaryGenerations::setGeneration ( const uint32_t  id,
const size_t  generation 
)

Definition at line 19 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

Referenced by RelAlgExecutor::computeStringDictionaryGenerations().

20  {
21  id_to_generation_.emplace(id, generation);
22 }
std::unordered_map< uint32_t, size_t > id_to_generation_
+ Here is the caller graph for this function:

Member Data Documentation

◆ id_to_generation_

std::unordered_map<uint32_t, size_t> StringDictionaryGenerations::id_to_generation_
private

Definition at line 33 of file StringDictionaryGenerations.h.

Referenced by asMap(), clear(), getGeneration(), and setGeneration().


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