OmniSciDB  72c90bc290
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
StringNetworkCallback Class Reference
+ Inheritance diagram for StringNetworkCallback:
+ Collaboration diagram for StringNetworkCallback:

Public Member Functions

 StringNetworkCallback (StringDictionaryProxy *sdp, StringDictionaryProxy::IdMap &id_map)
void operator() (std::string const &str, int32_t const old_id) override
void operator() (std::string_view const, int32_t const string_id) override
- Public Member Functions inherited from StringDictionary::StringCallback
virtual ~StringCallback ()=default

Private Types

using Lambda = std::function< int32_t(std::string const &)>

Private Attributes

Lambda const string_to_id_

Detailed Description

Definition at line 654 of file StringDictionaryProxy.cpp.

Member Typedef Documentation

using StringNetworkCallback::Lambda = std::function<int32_t(std::string const&)>

Definition at line 657 of file StringDictionaryProxy.cpp.

Constructor & Destructor Documentation

StringNetworkCallback::StringNetworkCallback ( StringDictionaryProxy sdp,
StringDictionaryProxy::IdMap id_map 

Definition at line 661 of file StringDictionaryProxy.cpp.

662  : sdp_(sdp)
663  , id_map_(id_map)
664  , string_to_id_(sdp->string_dict_->makeLambdaStringToId()) {}
StringDictionaryProxy::IdMap & id_map_
std::shared_ptr< StringDictionary > string_dict_
StringDictionaryProxy * sdp_

Member Function Documentation

void StringNetworkCallback::operator() ( std::string const &  str,
int32_t const  old_id 

Implements StringDictionary::StringCallback.

Definition at line 665 of file StringDictionaryProxy.cpp.

References StringDictionaryProxy::getOrAddTransientUnlocked(), id_map_, StringDictionary::INVALID_STR_ID, sdp_, and string_to_id_.

665  {
666  int32_t const new_id = string_to_id_(str);
667  id_map_[old_id] = new_id == StringDictionary::INVALID_STR_ID
669  : new_id;
670  }
StringDictionaryProxy::IdMap & id_map_
static constexpr int32_t INVALID_STR_ID
StringDictionaryProxy * sdp_
int32_t getOrAddTransientUnlocked(String const &)

+ Here is the call graph for this function:

void StringNetworkCallback::operator() ( std::string_view  const,
int32_t const  string_id 

Implements StringDictionary::StringCallback.

Definition at line 671 of file StringDictionaryProxy.cpp.


671  {
672  UNREACHABLE() << "StringNetworkCallback requires a std::string.";
673  }
Definition: Logger.h:338

Member Data Documentation

StringDictionaryProxy::IdMap& StringNetworkCallback::id_map_

Definition at line 656 of file StringDictionaryProxy.cpp.

Referenced by operator()().

StringDictionaryProxy* StringNetworkCallback::sdp_

Definition at line 655 of file StringDictionaryProxy.cpp.

Referenced by operator()().

Lambda const StringNetworkCallback::string_to_id_

Definition at line 658 of file StringDictionaryProxy.cpp.

Referenced by operator()().

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