OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StringDictionaryGenerations Class Reference

#include <StringDictionaryGenerations.h>

Public Member Functions

void setGeneration (const uint32_t id, const uint64_t generation)
 
void updateGeneration (const uint32_t id, const uint64_t generation)
 
int64_t getGeneration (const uint32_t id) const
 
const std::unordered_map
< uint32_t, uint64_t > & 
asMap () const
 
void clear ()
 

Private Attributes

std::unordered_map< uint32_t,
uint64_t > 
id_to_generation_
 

Detailed Description

Definition at line 22 of file StringDictionaryGenerations.h.

Member Function Documentation

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

Definition at line 47 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

47  {
48  return id_to_generation_;
49 }
std::unordered_map< uint32_t, uint64_t > id_to_generation_
void StringDictionaryGenerations::clear ( )

Definition at line 51 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

51  {
52  decltype(id_to_generation_)().swap(id_to_generation_);
53 }
std::unordered_map< uint32_t, uint64_t > id_to_generation_
int64_t StringDictionaryGenerations::getGeneration ( const uint32_t  id) const

Definition at line 32 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

32  {
33  const auto it = id_to_generation_.find(id);
34  if (it != id_to_generation_.end()) {
35  return it->second;
36  }
37  // This happens when the query didn't need to do any translation from string
38  // to id. Return an invalid generation and StringDictionaryProxy will assert
39  // the methods which require a generation (the ones which go from string to id)
40  // are called on it if it has an invalid generation, only the id from string
41  // direction is allowed in such cases. Once a query finishes its effective
42  // execution, the generations are cleared and the string to id direction
43  // isn't needed anymore, only the opposite for the returned result set.
44  return -1;
45 }
std::unordered_map< uint32_t, uint64_t > id_to_generation_
void StringDictionaryGenerations::setGeneration ( const uint32_t  id,
const uint64_t  generation 
)

Definition at line 21 of file StringDictionaryGenerations.cpp.

References id_to_generation_.

Referenced by Executor::computeStringDictionaryGenerations(), and ThriftSerializers::string_dictionary_generations_from_thrift().

22  {
23  id_to_generation_.emplace(id, generation);
24 }
std::unordered_map< uint32_t, uint64_t > id_to_generation_

+ Here is the caller graph for this function:

void StringDictionaryGenerations::updateGeneration ( const uint32_t  id,
const uint64_t  generation 
)

Definition at line 26 of file StringDictionaryGenerations.cpp.

References CHECK, and id_to_generation_.

27  {
28  CHECK(id_to_generation_.count(id));
29  id_to_generation_[id] = generation;
30 }
std::unordered_map< uint32_t, uint64_t > id_to_generation_
#define CHECK(condition)
Definition: Logger.h:197

Member Data Documentation

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

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