Kudu C++ client API
Loading...
Searching...
No Matches
shared_ptr.h File Reference

Smart pointer typedefs for externally-faced code. More...

#include <string>
#include <tr1/memory>

Go to the source code of this file.

Detailed Description

Smart pointer typedefs for externally-faced code.

Kudu uses c++11 features internally, but provides a client interface which does not require c++11. We use std::tr1::shared_ptr in our public interface to hold shared instances of KuduClient, KuduSession, and KuduTable.

However, if building with libc++ (e.g. if building on macOS), the TR1 APIs are not implemented. As a workaround, we use std::shared_ptr with libc++.

In order to allow applications to compile against Kudu with libstdc++ as well as with libc++, the kudu::client::sp namespace "alias" is provided, whose classes will resolve to the correct namespace in either case. Clients are encouraged to use this alias in order to ensure that applications compile universally.