OmniSciDB  a987f07e93
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringDictionaryProxy::TranslationMap< T > Class Template Reference

#include <StringDictionaryProxy.h>

+ Collaboration diagram for StringDictionaryProxy::TranslationMap< T >:

Public Member Functions

 TranslationMap (uint32_t const tran_size, uint32_t const dict_size)
 
 TranslationMap (uint32_t const tran_size, uint32_t const dict_size, const T &init_val)
 
 TranslationMap (TranslationMap const &)=delete
 
 TranslationMap (TranslationMap &&)=default
 
bool empty () const
 
size_t getIndex (int32_t const id) const
 
std::vector< T > const & getVectorMap () const
 
size_t size () const
 
size_t numTransients () const
 
size_t numNonTransients () const
 
T * data ()
 
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)
 
rangeStart () const
 
rangeEnd () const
 
size_t numUntranslatedStrings () const
 
void setNumUntranslatedStrings (const size_t num_untranslated_strings)
 
T * storageData ()
 
T & operator[] (int32_t const id)
 
operator[] (int32_t const id) const
 

Private Attributes

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

Friends

std::ostream & operator<< (std::ostream &os, TranslationMap< T > const &sdp_map)
 

Detailed Description

template<typename T>
class StringDictionaryProxy::TranslationMap< T >

Definition at line 89 of file StringDictionaryProxy.h.

Constructor & Destructor Documentation

template<typename T>
StringDictionaryProxy::TranslationMap< T >::TranslationMap ( uint32_t const  tran_size,
uint32_t const  dict_size 
)
inline

Definition at line 98 of file StringDictionaryProxy.h.

99  : offset_(tran_size + 1), vector_map_(offset_ + dict_size) {}
template<typename T>
StringDictionaryProxy::TranslationMap< T >::TranslationMap ( uint32_t const  tran_size,
uint32_t const  dict_size,
const T &  init_val 
)
inline

Definition at line 100 of file StringDictionaryProxy.h.

101  : offset_(tran_size + 1), vector_map_(offset_ + dict_size, init_val) {}
template<typename T>
StringDictionaryProxy::TranslationMap< T >::TranslationMap ( TranslationMap< T > const &  )
delete
template<typename T>
StringDictionaryProxy::TranslationMap< T >::TranslationMap ( TranslationMap< T > &&  )
default

Member Function Documentation

template<typename T>
T* StringDictionaryProxy::TranslationMap< T >::data ( )
inline

Definition at line 110 of file StringDictionaryProxy.h.

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

110 { return vector_map_.data(); }

+ Here is the caller graph for this function:

template<typename T>
T const* StringDictionaryProxy::TranslationMap< T >::data ( ) const
inline

Definition at line 111 of file StringDictionaryProxy.h.

111 { return vector_map_.data(); }
template<typename T>
int32_t StringDictionaryProxy::TranslationMap< T >::domainEnd ( ) const
inline

Definition at line 113 of file StringDictionaryProxy.h.

113 { return static_cast<int32_t>(numNonTransients()); }
template<typename T>
int32_t StringDictionaryProxy::TranslationMap< T >::domainStart ( ) const
inline

Definition at line 112 of file StringDictionaryProxy.h.

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

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

+ Here is the caller graph for this function:

template<typename T>
bool StringDictionaryProxy::TranslationMap< T >::empty ( ) const
inline

Definition at line 104 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked(), and StringDictionaryTranslationMgr::isMapValid().

104 { return vector_map_.size() == 1; }

+ Here is the caller graph for this function:

template<typename T>
size_t StringDictionaryProxy::TranslationMap< T >::getIndex ( int32_t const  id) const
inline

Definition at line 105 of file StringDictionaryProxy.h.

105 { return offset_ + id; }
template<typename T>
std::vector<T> const& StringDictionaryProxy::TranslationMap< T >::getVectorMap ( ) const
inline

Definition at line 106 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked(), and StringDictionaryTranslationMgr::mapSize().

106 { return vector_map_; }

+ Here is the caller graph for this function:

template<typename T>
size_t StringDictionaryProxy::TranslationMap< T >::numNonTransients ( ) const
inline

Definition at line 109 of file StringDictionaryProxy.h.

template<typename T>
size_t StringDictionaryProxy::TranslationMap< T >::numTransients ( ) const
inline

Definition at line 108 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

108 { return offset_ - 1; }

+ Here is the caller graph for this function:

template<typename T>
size_t StringDictionaryProxy::TranslationMap< T >::numUntranslatedStrings ( ) const
inline

Definition at line 125 of file StringDictionaryProxy.h.

125  {
127  return static_cast<size_t>(num_untranslated_strings_);
128  }
#define CHECK_GE(x, y)
Definition: Logger.h:302
template<typename T>
T& StringDictionaryProxy::TranslationMap< T >::operator[] ( int32_t const  id)
inline

Definition at line 133 of file StringDictionaryProxy.h.

133 { return vector_map_[getIndex(id)]; }
size_t getIndex(int32_t const id) const
template<typename T>
T StringDictionaryProxy::TranslationMap< T >::operator[] ( int32_t const  id) const
inline

Definition at line 134 of file StringDictionaryProxy.h.

134 { return vector_map_[getIndex(id)]; }
size_t getIndex(int32_t const id) const
template<typename T>
T StringDictionaryProxy::TranslationMap< T >::rangeEnd ( ) const
inline

Definition at line 117 of file StringDictionaryProxy.h.

template<typename T>
T StringDictionaryProxy::TranslationMap< T >::rangeStart ( ) const
inline
template<typename T>
void StringDictionaryProxy::TranslationMap< T >::setNumUntranslatedStrings ( const size_t  num_untranslated_strings)
inline

Definition at line 129 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

129  {
130  num_untranslated_strings_ = static_cast<int64_t>(num_untranslated_strings);
131  }

+ Here is the caller graph for this function:

template<typename T>
void StringDictionaryProxy::TranslationMap< T >::setRangeEnd ( const int32_t  range_end)
inline

Definition at line 115 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

+ Here is the caller graph for this function:

template<typename T>
void StringDictionaryProxy::TranslationMap< T >::setRangeStart ( const int32_t  range_start)
inline

Definition at line 114 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

+ Here is the caller graph for this function:

template<typename T>
size_t StringDictionaryProxy::TranslationMap< T >::size ( ) const
inline

Definition at line 107 of file StringDictionaryProxy.h.

Referenced by HashJoin::translateInnerToOuterStrDictProxies().

107 { return vector_map_.size(); }

+ Here is the caller graph for this function:

template<typename T>
T* StringDictionaryProxy::TranslationMap< T >::storageData ( )
inline

Definition at line 132 of file StringDictionaryProxy.h.

Referenced by StringDictionaryProxy::buildIntersectionTranslationMapToOtherProxyUnlocked().

+ Here is the caller graph for this function:

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  os,
TranslationMap< T > const &  sdp_map 
)
friend

Definition at line 135 of file StringDictionaryProxy.h.

135  {
136  return os << "IdMap(offset_(" << sdp_map.offset_ << ") vector_map_"
137  << shared::printContainer(sdp_map.vector_map_) << ')';
138  }
PrintContainer< CONTAINER > printContainer(CONTAINER &container)
Definition: misc.h:107

Member Data Documentation

template<typename T>
int64_t StringDictionaryProxy::TranslationMap< T >::num_untranslated_strings_
private

Definition at line 92 of file StringDictionaryProxy.h.

template<typename T>
size_t const StringDictionaryProxy::TranslationMap< T >::offset_
private

Definition at line 90 of file StringDictionaryProxy.h.

template<typename T>
T StringDictionaryProxy::TranslationMap< T >::range_end_ {0}
private

Definition at line 94 of file StringDictionaryProxy.h.

template<typename T>
T StringDictionaryProxy::TranslationMap< T >::range_start_ {0}
private

Definition at line 93 of file StringDictionaryProxy.h.

template<typename T>
std::vector<T> StringDictionaryProxy::TranslationMap< T >::vector_map_
private

Definition at line 91 of file StringDictionaryProxy.h.


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