Robot Raconteur Core C++ Library
Service.h
Go to the documentation of this file.
1 
24 #pragma once
25 
31 #include <istream>
32 #include <boost/atomic.hpp>
33 
34 #pragma warning(push)
35 #pragma warning(disable : 4996)
36 #include <boost/signals2.hpp>
37 
38 namespace RobotRaconteur
39 {
40 
41 class ROBOTRACONTEUR_CORE_API ServerEndpoint;
42 class ROBOTRACONTEUR_CORE_API AuthenticatedUser;
43 class ROBOTRACONTEUR_CORE_API ServerContext;
44 class ROBOTRACONTEUR_CORE_API ServerContext_ObjectLock;
45 class ROBOTRACONTEUR_CORE_API ServerContext_MonitorObjectSkel;
46 
47 class ROBOTRACONTEUR_CORE_API GeneratorServerBase;
48 
49 class ROBOTRACONTEUR_CORE_API IRobotRaconteurMonitorObject;
50 
63 class ROBOTRACONTEUR_CORE_API IRRServiceObject
64 {
65  public:
75  virtual void RRServiceObjectInit(RR_WEAK_PTR<ServerContext> context, const std::string& service_path) = 0;
76  virtual ~IRRServiceObject() {}
77 };
78 
79 class ROBOTRACONTEUR_CORE_API ServiceSkel : public RR_ENABLE_SHARED_FROM_THIS<ServiceSkel>, private boost::noncopyable
80 {
81 
82  public:
83  ServiceSkel();
84  virtual ~ServiceSkel() {}
85 
86  virtual void Init(boost::string_ref s, const RR_SHARED_PTR<RRObject>& o, const RR_SHARED_PTR<ServerContext>& c);
87 
88  virtual void InitCallbackServers(const RR_SHARED_PTR<RRObject>& o);
89 
90  std::string GetServicePath() const;
91 
92  protected:
93  std::string m_ServicePath;
94 
95  public:
96  RR_SHARED_PTR<ServerContext> GetContext();
97 
98  protected:
99  RR_WEAK_PTR<ServerContext> m_context;
100 
101  RR_SHARED_PTR<RRObject> uncastobj;
102 
103  std::vector<boost::tuple<RobotRaconteurVersion, std::string> > object_type_ver;
104 
105  boost::unordered_map<int32_t, RR_SHARED_PTR<GeneratorServerBase> > generators;
106  boost::mutex generators_lock;
107 
108  int32_t get_new_generator_index();
109 
110  public:
111  RR_SHARED_PTR<RRObject> GetUncastObject() const;
112 
113  virtual RR_INTRUSIVE_PTR<MessageEntry> CallGetProperty(const RR_INTRUSIVE_PTR<MessageEntry>& m) = 0;
114 
115  virtual RR_INTRUSIVE_PTR<MessageEntry> CallSetProperty(const RR_INTRUSIVE_PTR<MessageEntry>& m) = 0;
116 
117  virtual RR_INTRUSIVE_PTR<MessageEntry> CallFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m) = 0;
118 
119  protected:
120  static void EndAsyncCallGetProperty(RR_WEAK_PTR<ServiceSkel> skel, const RR_INTRUSIVE_PTR<MessageElement>& value,
121  const RR_SHARED_PTR<RobotRaconteurException>& err,
122  const RR_INTRUSIVE_PTR<MessageEntry>& m,
123  const RR_SHARED_PTR<ServerEndpoint>& ep);
124 
125  static void EndAsyncCallSetProperty(RR_WEAK_PTR<ServiceSkel> skel,
126  const RR_SHARED_PTR<RobotRaconteurException>& err,
127  const RR_INTRUSIVE_PTR<MessageEntry>& m,
128  const RR_SHARED_PTR<ServerEndpoint>& ep);
129 
130  static void EndAsyncCallFunction(RR_WEAK_PTR<ServiceSkel> skel, const RR_INTRUSIVE_PTR<MessageElement>& ret,
131  const RR_SHARED_PTR<RobotRaconteurException>& err,
132  const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_SHARED_PTR<ServerEndpoint>& ep);
133 
134  public:
135  virtual RR_SHARED_PTR<RRObject> GetSubObj(boost::string_ref name, boost::string_ref ind) = 0;
136 
137  RR_SHARED_PTR<RRObject> GetSubObj(boost::string_ref name);
138 
139  virtual void RegisterEvents(const RR_SHARED_PTR<RRObject>& obj1);
140 
141  virtual void UnregisterEvents(const RR_SHARED_PTR<RRObject>& obj1);
142 
143  virtual void InitPipeServers(const RR_SHARED_PTR<RRObject>& obj1);
144 
145  virtual void InitWireServers(const RR_SHARED_PTR<RRObject>& obj1);
146 
147  void ObjRefChanged(boost::string_ref name);
148 
149  void SendEvent(const RR_INTRUSIVE_PTR<MessageEntry>& m);
150 
151  void ReleaseObject();
152 
153  virtual void ReleaseCastObject() = 0;
154 
155  void AsyncSendPipeMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e, bool unreliable,
156  RR_MOVE_ARG(boost::function<void(const RR_SHARED_PTR<RobotRaconteurException>&)>)
157  handler);
158 
159  void SendWireMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
160 
161  virtual void DispatchPipeMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
162 
163  virtual void DispatchWireMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
164 
165  virtual RR_INTRUSIVE_PTR<MessageEntry> CallPipeFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
166 
167  virtual RR_INTRUSIVE_PTR<MessageEntry> CallWireFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
168 
169  virtual RR_SHARED_PTR<void> GetCallbackFunction(uint32_t endpoint, boost::string_ref membername);
170 
171  virtual RR_INTRUSIVE_PTR<MessageEntry> CallMemoryFunction(const RR_INTRUSIVE_PTR<MessageEntry>& m,
172  const RR_SHARED_PTR<Endpoint>& e);
173 
174  RR_WEAK_PTR<ServerContext_ObjectLock> objectlock;
175  boost::mutex objectlock_lock;
176 
177  RR_SHARED_PTR<ServerContext_MonitorObjectSkel> monitorlock;
178 
179  RR_UNORDERED_MAP<uint32_t, RR_SHARED_PTR<ServerContext_MonitorObjectSkel> > monitorlocks;
180  boost::mutex monitorlocks_lock;
181 
182  bool IsLocked();
183 
184  virtual bool IsRequestNoLock(const RR_INTRUSIVE_PTR<MessageEntry>& m);
185 
186  bool IsMonitorLocked();
187 
188  virtual std::string GetObjectType() = 0;
189 
190  virtual std::string GetObjectType(const RobotRaconteurVersion& client_version);
191 
192  RR_SHARED_PTR<RobotRaconteurNode> RRGetNode();
193  RR_WEAK_PTR<RobotRaconteurNode> RRGetNodeWeak();
194 
195  virtual void CallGeneratorNext(const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_SHARED_PTR<Endpoint>& e);
196 
197  void SendGeneratorResponse(int32_t index, const RR_INTRUSIVE_PTR<MessageEntry>& m,
198  const RR_SHARED_PTR<ServerEndpoint>& ep);
199 
200  void CleanupGenerators();
201 
202  protected:
203  RR_WEAK_PTR<RobotRaconteurNode> node;
204 };
205 
206 class ROBOTRACONTEUR_CORE_API UserAuthenticator;
207 
250 class ROBOTRACONTEUR_CORE_API ServerContext : public RR_ENABLE_SHARED_FROM_THIS<ServerContext>, boost::noncopyable
251 {
252  public:
260  std::map<std::string, RR_INTRUSIVE_PTR<RRValue> > GetAttributes();
261 
271  void SetAttributes(const std::map<std::string, RR_INTRUSIVE_PTR<RRValue> >& attr);
272 
273  private:
274  std::map<std::string, RR_INTRUSIVE_PTR<RRValue> > m_Attributes;
275  boost::mutex m_Attributes_lock;
276 
277  public:
278  RR_SHARED_PTR<ServiceFactory> GetServiceDef() const;
279 
280  RR_SHARED_PTR<ServiceFactory> GetRootObjectServiceDef(const RobotRaconteurVersion& client_version);
281 
282  virtual ~ServerContext() {}
283 
284  protected:
285  RR_SHARED_PTR<ServiceFactory> m_ServiceDef;
286 
287  public:
293  std::vector<std::string> GetExtraImports();
294 
308  void AddExtraImport(boost::string_ref import_);
309 
319  bool RemoveExtraImport(boost::string_ref import_);
320 
321  protected:
322  std::vector<std::string> extra_imports;
323  boost::mutex extra_imports_lock;
324 
325  public:
334  std::string GetServiceName() const;
335 
336  protected:
337  std::string m_ServiceName;
338 
339  RR_UNORDERED_MAP<MessageStringPtr, RR_SHARED_PTR<ServiceSkel> > skels;
340  boost::mutex skels_lock;
341 
342  RR_UNORDERED_MAP<uint32_t, RR_SHARED_PTR<ServerEndpoint> > client_endpoints;
343  boost::mutex client_endpoints_lock;
344 
345  public:
346  std::string GetRootObjectType(const RobotRaconteurVersion& client_version);
347 
348  protected:
349  std::string m_RootObjectType;
350 
351  RR_WEAK_PTR<RobotRaconteurNode> node;
352 
353  /*public Message SendRequest(Message m)
354  {
355  return null;
356  }*/
357 
358  public:
376  ServerContext(const RR_SHARED_PTR<ServiceFactory>& f, const RR_SHARED_PTR<RobotRaconteurNode>& node);
377 
378  RR_SHARED_PTR<RobotRaconteurNode> GetNode();
379 
380  virtual void SendEvent(const RR_INTRUSIVE_PTR<MessageEntry>& m);
381 #undef SendMessage
382  virtual void SendMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_SHARED_PTR<Endpoint>& e);
383 
384  virtual void SendMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
385 
386  virtual void AsyncSendMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e,
387  const boost::function<void(const RR_SHARED_PTR<RobotRaconteurException>&)>& callback);
388 
389  virtual void AsyncSendMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_SHARED_PTR<Endpoint>& e,
390  const boost::function<void(const RR_SHARED_PTR<RobotRaconteurException>&)>& callback);
391 
392  virtual void AsyncSendUnreliableMessage(
393  const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_SHARED_PTR<ServerEndpoint>& e,
394  const boost::function<void(const RR_SHARED_PTR<RobotRaconteurException>&)>& callback);
395 
396  virtual void AsyncSendPipeMessage(
397  const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e, bool unreliable,
398  const boost::function<void(const RR_SHARED_PTR<RobotRaconteurException>&)>& callback);
399 
400  virtual void SendWireMessage(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t e);
401 
402  private:
403  // boost::mutex rec_sync;
404 
405  bool base_object_set;
406 
407  protected:
418  void SetSecurityPolicy(const RR_SHARED_PTR<ServiceSecurityPolicy>& policy);
419 
420  public:
421  virtual void SetBaseObject(
422  boost::string_ref name, const RR_SHARED_PTR<RRObject>& o,
423  const RR_SHARED_PTR<ServiceSecurityPolicy>& policy = RR_SHARED_PTR<ServiceSecurityPolicy>());
424 
425  virtual RR_SHARED_PTR<ServiceSkel> GetObjectSkel(MessageStringRef servicepath);
426 
427  virtual void ReplaceObject(boost::string_ref path);
428 
429  virtual std::string GetObjectType(MessageStringRef servicepath, const RobotRaconteurVersion& client_version);
430 
440  static RR_SHARED_PTR<ServerContext> GetCurrentServerContext();
441 
442  private:
443  static boost::thread_specific_ptr<RR_SHARED_PTR<ServerContext> > m_CurrentServerContext;
444 
445  public:
456  static std::string GetCurrentServicePath();
457 
458  private:
459  static boost::thread_specific_ptr<std::string> m_CurrentServicePath;
460 
461  public:
462  virtual RR_INTRUSIVE_PTR<MessageEntry> ProcessMessageEntry(const RR_INTRUSIVE_PTR<MessageEntry>& m,
463  const RR_SHARED_PTR<ServerEndpoint>& c);
464 
465  virtual void Close();
466 
467  virtual void MessageReceived(const RR_INTRUSIVE_PTR<Message>& m, const RR_SHARED_PTR<ServerEndpoint>& e);
468 
469  virtual void AddClient(const RR_SHARED_PTR<ServerEndpoint>& cendpoint);
470 
471  virtual void RemoveClient(const RR_SHARED_PTR<ServerEndpoint>& cendpoint);
472 
480  virtual void KickUser(boost::string_ref username);
481 
482  private:
483  RR_SHARED_PTR<UserAuthenticator> user_authenticator;
484  std::map<std::string, std::string> security_policies;
485 
486  bool m_RequireValidUser;
487  bool AllowObjectLock;
488 
489  virtual RR_INTRUSIVE_PTR<MessageEntry> ClientSessionOp(const RR_INTRUSIVE_PTR<MessageEntry>& m,
490  const RR_SHARED_PTR<ServerEndpoint>& e);
491 
492  public:
502  virtual bool RequireValidUser();
503 
504  virtual RR_SHARED_PTR<AuthenticatedUser> AuthenticateUser(
505  boost::string_ref username, std::map<std::string, RR_INTRUSIVE_PTR<RRValue> >& credentials,
506  const RR_SHARED_PTR<ServerEndpoint>& ep);
507 
508  private:
509  boost::mutex ClientLockOp_lockobj;
510 
511  virtual void ClientLockOp(const RR_INTRUSIVE_PTR<MessageEntry>& m, const RR_INTRUSIVE_PTR<MessageEntry>& ret);
512 
513  public:
523  void RequestObjectLock(boost::string_ref servicepath, boost::string_ref username);
524 
537  void RequestClientObjectLock(boost::string_ref servicepath, boost::string_ref username, uint32_t endpoint);
538 
554  void ReleaseObjectLock(boost::string_ref servicepath, boost::string_ref username, bool override_);
555 
562  std::string GetObjectLockUsername(boost::string_ref servicepath);
563 
564  protected:
565  void check_lock(const RR_SHARED_PTR<ServiceSkel>& skel, const RR_INTRUSIVE_PTR<MessageEntry>& m);
566 
567  void check_monitor_lock(const RR_SHARED_PTR<ServiceSkel>& skel);
568 
569  RR_UNORDERED_MAP<std::string, RR_SHARED_PTR<ServerContext_ObjectLock> > active_object_locks;
570 
571  public:
572  virtual void PeriodicCleanupTask();
573 
574  protected:
575  RR_INTRUSIVE_PTR<MessageEntry> CheckServiceCapability(const RR_INTRUSIVE_PTR<MessageEntry>& m,
576  const RR_SHARED_PTR<ServerEndpoint>& c);
577 
578  public:
579  boost::signals2::signal<void(const RR_SHARED_PTR<ServerContext>&, ServerServiceListenerEventType,
580  const RR_SHARED_PTR<void>&)>
581  ServerServiceListener;
582 
583  protected:
584  void ReleaseServicePath1(const std::string& path);
585 
586  public:
603  void ReleaseServicePath(boost::string_ref path);
604 
621  void ReleaseServicePath(boost::string_ref path, const std::vector<uint32_t>& endpoints);
622 
623  void AsyncProcessCallbackRequest(
624  const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t endpoint,
625  RR_MOVE_ARG(
626  boost::function<void(const RR_INTRUSIVE_PTR<MessageEntry>&, const RR_SHARED_PTR<RobotRaconteurException>&)>)
627  handler,
628  int32_t timeout = RR_TIMEOUT_INFINITE);
629 
630  private:
631  void AsyncProcessCallbackRequest_err(const RR_SHARED_PTR<RobotRaconteurException>& error, uint32_t endpoint,
632  uint32_t requestid);
633 
634  void AsyncProcessCallbackRequest_timeout(const TimerEvent&, uint32_t endpoint, uint32_t requestid);
635 
636  uint32_t request_number;
637 
638  struct outstanding_request
639  {
640  RR_INTRUSIVE_PTR<MessageEntry> ret;
641  RR_SHARED_PTR<AutoResetEvent> evt;
642  boost::function<void(const RR_INTRUSIVE_PTR<MessageEntry>& ret,
643  const RR_SHARED_PTR<RobotRaconteurException>& error)>
644  handler;
645  RR_SHARED_PTR<Timer> timer;
646  };
647 
648  boost::mutex outstanding_requests_lock;
649  RR_UNORDERED_MAP<uint32_t, RR_SHARED_PTR<outstanding_request> > outstanding_requests;
650 
651  public:
652  RR_INTRUSIVE_PTR<MessageEntry> ProcessCallbackRequest(const RR_INTRUSIVE_PTR<MessageEntry>& m, uint32_t endpointid);
653 
662 
673  void SetMonitorThreadPoolCount(int32_t count);
674 
682  RR_SHARED_PTR<ThreadPool> GetMonitorThreadPool();
683 
684  protected:
685  RR_SHARED_PTR<ThreadPool> monitor_thread_pool;
686  boost::mutex monitor_thread_pool_lock;
687 
688  public:
698  std::vector<std::string> GetCandidateConnectionURLs();
699 
707  void PrintCandidateConnectionURLs(std::ostream& out = std::cout);
708 
716  void LogCandidateConnectionURLs(RobotRaconteur_LogLevel level = RobotRaconteur_LogLevel_Info);
717 };
718 
732 class ROBOTRACONTEUR_CORE_API ServerEndpoint : public Endpoint, public RR_ENABLE_SHARED_FROM_THIS<ServerEndpoint>
733 {
734  public:
735  RR_SHARED_PTR<ServerContext> service;
736 
737  private:
738  static boost::thread_specific_ptr<RR_SHARED_PTR<ServerEndpoint> > m_CurrentEndpoint;
739 
740  public:
752  static RR_SHARED_PTR<ServerEndpoint> GetCurrentEndpoint();
753 
754  private:
755  static boost::thread_specific_ptr<RR_SHARED_PTR<AuthenticatedUser> > m_CurrentAuthenticatedUser;
756 
757  public:
773  static RR_SHARED_PTR<AuthenticatedUser> GetCurrentAuthenticatedUser();
774 
775  private:
776  RR_SHARED_PTR<AuthenticatedUser> endpoint_authenticated_user;
777 
778  public:
779  const std::string GetAuthenticatedUsername() const;
780 
781  RR_OVIRTUAL void MessageReceived(const RR_INTRUSIVE_PTR<Message>& m) RR_OVERRIDE;
782 
783  void AuthenticateUser(boost::string_ref username, std::map<std::string, RR_INTRUSIVE_PTR<RRValue> >& credentials);
784 
785  void LogoutUser();
786 
787  RR_OVIRTUAL void PeriodicCleanupTask() RR_OVERRIDE;
788 
789  RR_OVIRTUAL void SetTransportConnection(const RR_SHARED_PTR<ITransportConnection>& c) RR_OVERRIDE;
790 
791  private:
792  RobotRaconteurVersion client_version;
793  boost::mutex this_lock;
794 
795  public:
796  RobotRaconteurVersion GetClientVersion();
797  void SetClientVersion(const RobotRaconteurVersion& version);
798 
799  ServerEndpoint(const RR_SHARED_PTR<RobotRaconteurNode>& node) : Endpoint(node) {}
800 };
801 
811 class ROBOTRACONTEUR_CORE_API IRobotRaconteurMonitorObject
812 {
813  public:
819  virtual void RobotRaconteurMonitorEnter() = 0;
820 
828  virtual void RobotRaconteurMonitorEnter(int32_t timeout) = 0;
829 
834  virtual void RobotRaconteurMonitorExit() = 0;
835 
836  virtual ~IRobotRaconteurMonitorObject() {}
837 };
838 
846 class ROBOTRACONTEUR_CORE_API RRObject_default_impl : public virtual RRObject
847 {
848  protected:
849  boost::mutex this_lock;
850 };
851 
852 #ifndef ROBOTRACONTEUR_NO_CXX11_TEMPLATE_ALIASES
853 using ServiceSkelPtr = RR_SHARED_PTR<ServiceSkel>;
855 using ServerContextPtr = RR_SHARED_PTR<ServerContext>;
857 using ServerEndpointPtr = RR_SHARED_PTR<ServerEndpoint>;
858 #endif
859 
860 } // namespace RobotRaconteur
861 
862 #pragma warning(pop)
RobotRaconteur_LogLevel
Log level enum.
Definition: RobotRaconteurConstants.h:608
ServerServiceListenerEventType
Enum of service listener events.
Definition: RobotRaconteurConstants.h:518
#define RR_TIMEOUT_INFINITE
Disable timeout for asynchronous operations.
Definition: RobotRaconteurConstants.h:566
boost::shared_ptr< ServerContext > ServerContextPtr
Convenience alias for ServerContext shared_ptr.
Definition: Service.h:855
boost::shared_ptr< ServerEndpoint > ServerEndpointPtr
Convenience alias for ServerEndpoint shared_ptr.
Definition: Service.h:857
Interface for service objects to receive service notifications.
Definition: Service.h:64
virtual void RRServiceObjectInit(RR_WEAK_PTR< ServerContext > context, const std::string &service_path)=0
Function called after service object has been initialized.
Service object monitor lock notification.
Definition: Service.h:812
virtual void RobotRaconteurMonitorExit()=0
Release the thread-exclusive monitor lock.
virtual void RobotRaconteurMonitorEnter(int32_t timeout)=0
Request a thread-exclusive lock with timeout.
virtual void RobotRaconteurMonitorEnter()=0
Request a thread-exclusive lock without timeout.
Base class for default service object implementations.
Definition: Service.h:847
Base class for all Robot Raconteur objects.
Definition: DataTypes.h:227
The central node implementation.
Definition: RobotRaconteurNode.h:132
Robot Raconteur Version storage class.
Definition: ServiceDefinition.h:94
Context for services registered in a node for use by clients.
Definition: Service.h:251
std::map< std::string, boost::intrusive_ptr< RRValue > > GetAttributes()
Get the service attributes.
void RequestClientObjectLock(boost::string_ref servicepath, boost::string_ref username, uint32_t endpoint)
Request a client lock on servicepath for a specific client connection.
virtual bool RequireValidUser()
Return if a valid user is required.
std::vector< std::string > GetExtraImports()
Get the current vector of extra service definition imports.
void ReleaseObjectLock(boost::string_ref servicepath, boost::string_ref username, bool override_)
Release a client lock on servicepath.
int32_t GetMonitorThreadPoolCount()
Get the number of threads used by the monitor thread pool.
void SetAttributes(const std::map< std::string, boost::intrusive_ptr< RRValue > > &attr)
Set the service attributes.
void RequestObjectLock(boost::string_ref servicepath, boost::string_ref username)
Request an object lock on servicepath for user username.
ServerContext(const boost::shared_ptr< ServiceFactory > &f, const boost::shared_ptr< RobotRaconteurNode > &node)
Construct a new ServerContext instance.
void LogCandidateConnectionURLs(RobotRaconteur_LogLevel level=RobotRaconteur_LogLevel_Info)
Log the candidate connection URLs for this service.
boost::shared_ptr< ThreadPool > GetMonitorThreadPool()
Get the monitor lock thread pool.
void SetSecurityPolicy(const boost::shared_ptr< ServiceSecurityPolicy > &policy)
Set the security policy of the service.
void ReleaseServicePath(boost::string_ref path, const std::vector< uint32_t > &endpoints)
Release the specified service path and all sub objects.
std::string GetObjectLockUsername(boost::string_ref servicepath)
Get the name of the user that has locked the specified service path.
void SetMonitorThreadPoolCount(int32_t count)
Set the monitor lock thread pool count.
void ReleaseServicePath(boost::string_ref path)
Release the specified service path and all sub objects.
std::string GetServiceName() const
Get the name of the service.
static boost::shared_ptr< ServerContext > GetCurrentServerContext()
Get the current ServerContext.
static std::string GetCurrentServicePath()
Get the current object service path.
void AddExtraImport(boost::string_ref import_)
Add an extra service definition import.
void PrintCandidateConnectionURLs(std::ostream &out=std::cout)
Print the candidate connection URLs for this service.
virtual void KickUser(boost::string_ref username)
Kicks a user with the specified username.
std::vector< std::string > GetCandidateConnectionURLs()
Get the candidate connection URLs for this service.
bool RemoveExtraImport(boost::string_ref import_)
Removes an extra import service definition registered with AddExtraImport()
Server endpoint representing a client connection.
Definition: Service.h:733
static boost::shared_ptr< ServerEndpoint > GetCurrentEndpoint()
Returns the current server endpoint.
static boost::shared_ptr< AuthenticatedUser > GetCurrentAuthenticatedUser()
Returns the current authenticated user.
Timer event structure.
Definition: Timer.h:46