X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=client%2Fvasum-client-impl.hpp;h=0ec3634125a20f36017e5e08866745194e4a146e;hb=189ae89e124478a4aaface3c2a593cee2603ebf2;hp=5a1d2fd6a8a5875f467e034acc3d68acee68fda9;hpb=28a791d3a60e8885e34ddd19d9ef1c5dd65355fa;p=platform%2Fcore%2Fsecurity%2Fvasum.git diff --git a/client/vasum-client-impl.hpp b/client/vasum-client-impl.hpp index 5a1d2fd..0ec3634 100644 --- a/client/vasum-client-impl.hpp +++ b/client/vasum-client-impl.hpp @@ -29,6 +29,11 @@ #include "vasum-client.h" #include "host-ipc-connection.hpp" +#include +#include + +#include +#include #include #include @@ -63,21 +68,44 @@ public: ~Client() noexcept; /** - * Create client with system dbus address. + * Connect client with system ipc address. * * @return status of this function call */ - VsmStatus createSystem() noexcept; - - ipc::epoll::EventPoll& getEventPoll() noexcept; + VsmStatus connectSystem() noexcept; /** - * Create client. + * Connect client. * - * @param address Dbus socket address + * @param address ipc socket address * @return status of this function call */ - VsmStatus create(const std::string& address) noexcept; + VsmStatus connect(const std::string& address) noexcept; + + /** + * Disconnect client + */ + VsmStatus disconnect() noexcept; + + /** + * @see ::vsm_get_poll_fd + */ + VsmStatus vsm_get_poll_fd(int* fd) noexcept; + + /** + * @see ::vsm_enter_eventloop + */ + VsmStatus vsm_enter_eventloop(int flags, int timeout) noexcept; + + /** + * @see ::vsm_set_dispatcher_type + */ + VsmStatus vsm_set_dispatcher_type(VsmDispacherType dispacher) noexcept; + + /** + * @see ::vsm_get_dispatcher_type + */ + VsmStatus vsm_get_dispatcher_type(VsmDispacherType* dispacher) noexcept; /** * @see ::vsm_get_status_message @@ -344,11 +372,15 @@ private: VsmStatus mVsmStatus; std::string mMsg; }; - Status mStatus; + mutable std::mutex mStatusMutex; + std::unique_ptr mInternalDispatcher; + std::unique_ptr mEventPoll; HostConnection mHostClient; + bool isInternalDispatcherEnabled() const; + ipc::epoll::EventPoll& getEventPoll() const; VsmStatus coverException(const std::function& worker) noexcept; VsmStatus vsm_netdev_get_ip_addr(const char* zone, const char* netdevId,