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

#include <StringDictionaryProxy.h>

Public Member Functions

 IdMap (uint32_t const tran_size, uint32_t const dict_size)
 
 IdMap (IdMap const &)=delete
 
 IdMap (IdMap &&)=default
 
bool empty () const
 
size_t getIndex (int32_t const id) const
 
std::vector< int32_t > const & getVectorMap () const
 
size_t size () const
 
size_t numTransients () const
 
size_t numNonTransients () const
 
int32_t * data ()
 
int32_t const * data () const
 
int32_t domainStart () const
 
int32_t domainEnd () const
 
void setRangeStart (const int32_t range_start)
 
void setRangeEnd (const int32_t range_end)
 
int32_t rangeStart () const
 
int32_t rangeEnd () const
 
size_t numUntranslatedStrings () const
 
void setNumUntranslatedStrings (const size_t num_untranslated_strings)
 
int32_t * storageData ()
 
int32_t & operator[] (int32_t const id)
 
int32_t operator[] (int32_t const id) const
 

Private Attributes

size_t const offset_
 
std::vector< int32_t > vector_map_
 
int64_t num_untranslated_strings_
 
int32_t range_start_ {0}
 
int32_t range_end_ {0}
 

Friends

std::ostream & operator<< (std::ostream &, IdMap const &)
 

Detailed Description

Definition at line 86 of file StringDictionaryProxy.h.

Constructor & Destructor Documentation

StringDictionaryProxy::IdMap::IdMap ( uint32_t const  tran_size,
uint32_t const  dict_size 
)
inline

Definition at line 95 of file StringDictionaryProxy.h.

96  : offset_(tran_size + 1)
std::vector< int32_t > vector_map_
static constexpr int32_t INVALID_STR_ID
StringDictionaryProxy::IdMap::IdMap ( IdMap const &  )
delete
StringDictionaryProxy::IdMap::IdMap ( IdMap &&  )
default

Member Function Documentation

int32_t* StringDictionaryProxy::IdMap::data ( )
inline

Definition at line 106 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked(), PerfectJoinHashTableBuilder::initOneToManyHashTableOnCpu(), and PerfectJoinHashTableBuilder::initOneToOneHashTableOnCpu().

106 { return vector_map_.data(); }
std::vector< int32_t > vector_map_

+ Here is the caller graph for this function:

int32_t const* StringDictionaryProxy::IdMap::data ( ) const
inline

Definition at line 107 of file StringDictionaryProxy.h.

107 { return vector_map_.data(); }
std::vector< int32_t > vector_map_
int32_t StringDictionaryProxy::IdMap::domainEnd ( ) const
inline

Definition at line 109 of file StringDictionaryProxy.h.

109 { return static_cast<int32_t>(numNonTransients()); }
int32_t StringDictionaryProxy::IdMap::domainStart ( ) const
inline

Definition at line 108 of file StringDictionaryProxy.h.

Referenced by PerfectJoinHashTableBuilder::initOneToManyHashTableOnCpu(), and PerfectJoinHashTableBuilder::initOneToOneHashTableOnCpu().

108 { return -static_cast<int32_t>(offset_); }

+ Here is the caller graph for this function:

bool StringDictionaryProxy::IdMap::empty ( ) const
inline

Definition at line 100 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

100 { return vector_map_.size() == 1; }
std::vector< int32_t > vector_map_

+ Here is the caller graph for this function:

size_t StringDictionaryProxy::IdMap::getIndex ( int32_t const  id) const
inline

Definition at line 101 of file StringDictionaryProxy.h.

101 { return offset_ + id; }
std::vector<int32_t> const& StringDictionaryProxy::IdMap::getVectorMap ( ) const
inline

Definition at line 102 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

102 { return vector_map_; }
std::vector< int32_t > vector_map_

+ Here is the caller graph for this function:

size_t StringDictionaryProxy::IdMap::numNonTransients ( ) const
inline

Definition at line 105 of file StringDictionaryProxy.h.

105 { return vector_map_.size() - offset_; }
std::vector< int32_t > vector_map_
size_t StringDictionaryProxy::IdMap::numTransients ( ) const
inline

Definition at line 104 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

104 { return offset_ - 1; }

+ Here is the caller graph for this function:

size_t StringDictionaryProxy::IdMap::numUntranslatedStrings ( ) const
inline

Definition at line 121 of file StringDictionaryProxy.h.

References CHECK_GE.

121  {
123  return static_cast<size_t>(num_untranslated_strings_);
124  }
#define CHECK_GE(x, y)
Definition: Logger.h:235
int32_t& StringDictionaryProxy::IdMap::operator[] ( int32_t const  id)
inline

Definition at line 129 of file StringDictionaryProxy.h.

129 { return vector_map_[getIndex(id)]; }
std::vector< int32_t > vector_map_
size_t getIndex(int32_t const id) const
int32_t StringDictionaryProxy::IdMap::operator[] ( int32_t const  id) const
inline

Definition at line 130 of file StringDictionaryProxy.h.

130 { return vector_map_[getIndex(id)]; }
std::vector< int32_t > vector_map_
size_t getIndex(int32_t const id) const
int32_t StringDictionaryProxy::IdMap::rangeEnd ( ) const
inline

Definition at line 113 of file StringDictionaryProxy.h.

int32_t StringDictionaryProxy::IdMap::rangeStart ( ) const
inline

Definition at line 112 of file StringDictionaryProxy.h.

void StringDictionaryProxy::IdMap::setNumUntranslatedStrings ( const size_t  num_untranslated_strings)
inline

Definition at line 125 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

125  {
126  num_untranslated_strings_ = static_cast<int64_t>(num_untranslated_strings);
127  }

+ Here is the caller graph for this function:

void StringDictionaryProxy::IdMap::setRangeEnd ( const int32_t  range_end)
inline

Definition at line 111 of file StringDictionaryProxy.h.

References nvtx_helpers::range_end().

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

111 { range_end_ = range_end; }
void range_end(nvtxRangeId_t)
Definition: nvtx_helpers.h:253

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void StringDictionaryProxy::IdMap::setRangeStart ( const int32_t  range_start)
inline

Definition at line 110 of file StringDictionaryProxy.h.

References nvtx_helpers::range_start().

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

nvtxRangeId_t range_start(const char *)
Definition: nvtx_helpers.h:247

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

size_t StringDictionaryProxy::IdMap::size ( ) const
inline

Definition at line 103 of file StringDictionaryProxy.h.

Referenced by HashJoin::translateInnerToOuterStrDictProxies().

103 { return vector_map_.size(); }
std::vector< int32_t > vector_map_

+ Here is the caller graph for this function:

int32_t* StringDictionaryProxy::IdMap::storageData ( )
inline

Definition at line 128 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

128 { return vector_map_.data() + offset_; }
std::vector< int32_t > vector_map_

+ Here is the caller graph for this function:

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
StringDictionaryProxy::IdMap const &  id_map 
)
friend

Definition at line 636 of file StringDictionaryProxy.cpp.

636  {
637  return os << "IdMap(offset_(" << id_map.offset_ << ") vector_map_"
638  << shared::printContainer(id_map.vector_map_) << ')';
639 }
PrintContainer< CONTAINER > printContainer(CONTAINER &container)
Definition: misc.h:107

Member Data Documentation

int64_t StringDictionaryProxy::IdMap::num_untranslated_strings_
private

Definition at line 89 of file StringDictionaryProxy.h.

size_t const StringDictionaryProxy::IdMap::offset_
private

Definition at line 87 of file StringDictionaryProxy.h.

Referenced by operator<<().

int32_t StringDictionaryProxy::IdMap::range_end_ {0}
private

Definition at line 91 of file StringDictionaryProxy.h.

int32_t StringDictionaryProxy::IdMap::range_start_ {0}
private

Definition at line 90 of file StringDictionaryProxy.h.

std::vector<int32_t> StringDictionaryProxy::IdMap::vector_map_
private

Definition at line 88 of file StringDictionaryProxy.h.

Referenced by operator<<().


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