Stellarium  0.90.0
List of all members | Public Member Functions | Static Protected Attributes
AbstractAPIService Class Reference

Abstract base class for all RemoteControlServiceInterface implementations which are provided by the Remote Control Plug-in plugin directly. More...

#include <AbstractAPIService.hpp>

+ Inheritance diagram for AbstractAPIService:
+ Collaboration diagram for AbstractAPIService:

Public Member Functions

 AbstractAPIService (QObject *parent=Q_NULLPTR)
 Only calls QObject constructor. More...
 
virtual bool isThreadSafe () const Q_DECL_OVERRIDE
 Return true if the service's get() and post() methods can safely be run in the HTTP handler thread, instead of having to queue it into the Stellarium main thread. More...
 
virtual void update (double deltaTime) Q_DECL_OVERRIDE
 Called in the main thread each frame. More...
 
virtual void get (const QByteArray &operation, const APIParameters &parameters, APIServiceResponse &response) Q_DECL_OVERRIDE
 Provides a default implementation which returns an error message. More...
 
virtual void post (const QByteArray &operation, const APIParameters &parameters, const QByteArray &data, APIServiceResponse &response) Q_DECL_OVERRIDE
 Provides a default implementation which returns an error message. More...
 
- Public Member Functions inherited from RemoteControlServiceInterface
virtual QLatin1String getPath () const =0
 Returns the desired path mapping If there is a conflict, only the first object is mapped. More...
 

Static Protected Attributes

static const Qt::ConnectionType SERVICE_DEFAULT_INVOKETYPE
 This defines the connection type QMetaObject::invokeMethod has to use inside a service: either Qt::DirectConnection for main thread handling, or Qt::BlockingQueuedConnection for HTTP thread handling. More...
 

Detailed Description

Abstract base class for all RemoteControlServiceInterface implementations which are provided by the Remote Control Plug-in plugin directly.

Definition at line 29 of file AbstractAPIService.hpp.

Constructor & Destructor Documentation

AbstractAPIService::AbstractAPIService ( QObject *  parent = Q_NULLPTR)
inline

Only calls QObject constructor.

Definition at line 36 of file AbstractAPIService.hpp.

Member Function Documentation

virtual void AbstractAPIService::get ( const QByteArray &  operation,
const APIParameters parameters,
APIServiceResponse response 
)
virtual

Provides a default implementation which returns an error message.

Implements RemoteControlServiceInterface.

Reimplemented in MainService, LocationSearchService, ObjectService, SimbadService, LocationService, StelActionService, ViewService, StelPropertyService, and ScriptService.

virtual bool AbstractAPIService::isThreadSafe ( ) const
virtual

Return true if the service's get() and post() methods can safely be run in the HTTP handler thread, instead of having to queue it into the Stellarium main thread.

This can result in better performance if done correctly. Unless you are sure, return false here.

Implements RemoteControlServiceInterface.

Reimplemented in LocationSearchService, and SimbadService.

virtual void AbstractAPIService::post ( const QByteArray &  operation,
const APIParameters parameters,
const QByteArray &  data,
APIServiceResponse response 
)
virtual

Provides a default implementation which returns an error message.

Implements RemoteControlServiceInterface.

Reimplemented in MainService, LocationService, StelActionService, StelPropertyService, and ScriptService.

virtual void AbstractAPIService::update ( double  deltaTime)
virtual

Called in the main thread each frame.

Default implementation does nothing. Can be used for ongoing actions, for example movement control.

Implements RemoteControlServiceInterface.

Reimplemented in MainService.

Member Data Documentation

const Qt::ConnectionType AbstractAPIService::SERVICE_DEFAULT_INVOKETYPE
staticprotected

This defines the connection type QMetaObject::invokeMethod has to use inside a service: either Qt::DirectConnection for main thread handling, or Qt::BlockingQueuedConnection for HTTP thread handling.

Definition at line 53 of file AbstractAPIService.hpp.


The documentation for this class was generated from the following file: