'HazelCast Wrapper Issue - C++

Using c++, Im trying to create a wrapper on hazelcast client with methods : set, get and delete. Here Im unable to instantiate a hazelcast client in each method. Whenever Im trying to use hazelcast client in each method, the program is terminating with the error - terminate called after throwing an instance of 'std::bad_function_call'.

Could anyone please help me on this issue ?

We tried to create a wrapper on hazelcast c++ client and created methods for set, get and delete. For example :

void wrapperClass::storeInMap(std::string mapKey, std::string key, std::string value)
  
{  

       auto hz = hazelcast::new_client().get();
  
       auto testMap = hz.get_map(mapKey).get();
  
       testMap-\>put\<std::string, std::string\>(key,value).get();

}

I tried calling this method multiple times to store different maps in hazelcast cache and faced the above-mentioned error.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source