OmniSciDB  a5dc49c757
 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

StringDictionaryProxysdp_
 
StringDictionaryProxy::IdMapid_map_
 
Lambda const string_to_id_
 

Detailed Description

Definition at line 645 of file StringDictionaryProxy.cpp.

Member Typedef Documentation

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

Definition at line 648 of file StringDictionaryProxy.cpp.

Constructor & Destructor Documentation

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

Definition at line 652 of file StringDictionaryProxy.cpp.

653  : sdp_(sdp)
654  , id_map_(id_map)
655  , 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 
)
inlineoverridevirtual

Implements StringDictionary::StringCallback.

Definition at line 656 of file StringDictionaryProxy.cpp.

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

656  {
657  int32_t const new_id = string_to_id_(str);
658  id_map_[old_id] = new_id == StringDictionary::INVALID_STR_ID
660  : new_id;
661  }
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 
)
inlineoverridevirtual

Implements StringDictionary::StringCallback.

Definition at line 662 of file StringDictionaryProxy.cpp.

References UNREACHABLE.

662  {
663  UNREACHABLE() << "StringNetworkCallback requires a std::string.";
664  }
#define UNREACHABLE()
Definition: Logger.h:338

Member Data Documentation

StringDictionaryProxy::IdMap& StringNetworkCallback::id_map_
private

Definition at line 647 of file StringDictionaryProxy.cpp.

Referenced by operator()().

StringDictionaryProxy* StringNetworkCallback::sdp_
private

Definition at line 646 of file StringDictionaryProxy.cpp.

Referenced by operator()().

Lambda const StringNetworkCallback::string_to_id_
private

Definition at line 649 of file StringDictionaryProxy.cpp.

Referenced by operator()().


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