1 #ifndef ANDROID_PDX_UDS_CLIENT_CHANNEL_FACTORY_H_
2 #define ANDROID_PDX_UDS_CLIENT_CHANNEL_FACTORY_H_
3 
4 #include <string>
5 
6 #include <pdx/client_channel_factory.h>
7 
8 namespace android {
9 namespace pdx {
10 namespace uds {
11 
12 class ClientChannelFactory : public pdx::ClientChannelFactory {
13  public:
14   static std::unique_ptr<pdx::ClientChannelFactory> Create(
15       const std::string& endpoint_path);
16   static std::unique_ptr<pdx::ClientChannelFactory> Create(LocalHandle socket);
17 
18   Status<std::unique_ptr<pdx::ClientChannel>> Connect(
19       int64_t timeout_ms) const override;
20 
21   static std::string GetRootEndpointPath();
22   static std::string GetEndpointPath(const std::string& endpoint_path);
23 
24  private:
25   explicit ClientChannelFactory(const std::string& endpoint_path);
26   explicit ClientChannelFactory(LocalHandle socket);
27 
28   mutable LocalHandle socket_;
29   std::string endpoint_path_;
30 };
31 
32 }  // namespace uds
33 }  // namespace pdx
34 }  // namespace android
35 
36 #endif  // ANDROID_PDX_UDS_CLIENT_CHANNEL_FACTORY_H_
37