qi::Session¶
A session is what allows you to connect services together locally or over the network. They can be used as server or client and can register or obtain services (on all sides, even in multi-client). You can read the guides to register a service and get a service.
Summary¶
class qi::Session
Functions (class qi::Session)
-
qi::Session::listenStandalone
qi::Session::setClientAuthenticatorFactory
qi::Session::unregisterService
Signals (class qi::Session)
Global Classes
Reference¶
qi::Session Class Reference¶
Introduction¶
#include <qi/session.hpp>
- Inherits:
noncopyable
,boost::enable_shared_from_this< Session >
Enumerations¶
-
enum
ServiceLocality
¶ Name Value Brief ServiceLocality_All
0 ServiceLocality_Local
1 ServiceLocality_Remote
2
Public Signals¶
-
qi::Signal<unsigned int, std::string>
serviceRegistered
-
qi::Signal<unsigned int, std::string>
serviceUnregistered
-
qi::Signal
connected
-
qi::Signal<std::string>
disconnected
Public Functions¶
-
(bool enforceAuthentication)Session
-
()~Session
-
qi::FutureSync<void>
(const char* serviceDirectoryURL)connect
-
qi::FutureSync<void>
(const std::string& serviceDirectoryURL)connect
-
qi::FutureSync<void>
(const qi::Url& serviceDirectoryURL)connect
-
bool
() constisConnected
-
qi::Url
() consturl
-
qi::FutureSync<std::vector<ServiceInfo>>
(ServiceLocality locality)services
-
qi::FutureSync<qi::AnyObject>
(const std::string& aservice)service
-
qi::FutureSync<qi::AnyObject>
(const std::string& service, const std::string& protocol)service
-
qi::FutureSync<void>
(const qi::Url& address)listen
-
std::vector<qi::Url>
() constendpoints
-
bool
(const std::string& key, const std::string& crt)setIdentity
-
qi::FutureSync<void>
()close
-
qi::FutureSync<void>
(const qi::Url& address)listenStandalone
-
qi::FutureSync<unsigned int>
(const std::string& name, AnyObject object)registerService
-
qi::FutureSync<void>
(unsigned int serviceId)unregisterService
-
void
(AuthProviderFactoryPtr)setAuthProviderFactory
-
void
(ClientAuthenticatorFactoryPtr)setClientAuthenticatorFactory
-
void
(const std::string& moduleName, const std::string& renameModule, const AnyReferenceVector& args)loadService
-
qi::FutureSync<void>
(const std::string& service)waitForService
Detailed Description¶
A Session allows you to interconnect services on the same machine or over the network.
Signals Documentation¶
-
qi::Signal<unsigned int, std::string>
qi::Session::
serviceRegistered
¶
-
qi::Signal<unsigned int, std::string>
qi::Session::
serviceUnregistered
¶
-
qi::Signal
qi::Session::
connected
¶
-
qi::Signal<std::string>
qi::Session::
disconnected
¶
Function Documentation¶
-
qi::Session::
~Session
()¶
-
qi::FutureSync<void>
qi::Session::
connect
(const char* serviceDirectoryURL)¶
-
qi::FutureSync<void>
qi::Session::
connect
(const std::string& serviceDirectoryURL)¶
-
qi::FutureSync<void>
qi::Session::
connect
(const qi::Url& serviceDirectoryURL)¶
-
qi::FutureSync<std::vector<ServiceInfo>>
qi::Session::
services
(ServiceLocality locality = ServiceLocality_All)¶
-
qi::FutureSync<qi::AnyObject>
qi::Session::
service
(const std::string& aservice)¶
-
qi::FutureSync<qi::AnyObject>
qi::Session::
service
(const std::string& service, const std::string& protocol)¶
-
qi::FutureSync<void>
qi::Session::
listen
(const qi::Url& address)¶
-
std::vector<qi::Url>
qi::Session::
endpoints
()const
¶
-
bool
qi::Session::
setIdentity
(const std::string& key, const std::string& crt)¶
-
qi::FutureSync<void>
qi::Session::
close
()¶
-
qi::FutureSync<void>
qi::Session::
listenStandalone
(const qi::Url& address)¶
-
qi::FutureSync<unsigned int>
qi::Session::
registerService
(const std::string& name, AnyObject object)¶
-
qi::FutureSync<void>
qi::Session::
unregisterService
(unsigned int serviceId)¶
-
void
qi::Session::
loadService
(const std::string& moduleName, const std::string& renameModule = "", const AnyReferenceVector& args = AnyReferenceVector()¶ Load a module and register the specified object on the session
Tries to call the factory with (this, args...) if possible, otherwise it calls it with (args...) only.
-
qi::FutureSync<void>
qi::Session::
waitForService
(const std::string& service)¶ Waits for a service to become available. The future is set immediately if the service is already available.