00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #pragma once
00022
00023 #if defined( _WIN32 ) || defined( __WIN32__ )
00024 #if !defined( RemoteVizServices_EXPORTS )
00025 #if _DEBUG
00026 #pragma comment(lib,"RemoteVizServicesD")
00027 #else
00028 #pragma comment(lib,"RemoteVizServices")
00029 #endif
00030 #endif
00031 #endif
00032
00033 #include <Inventor/sys/port.h>
00034
00035 #include <string>
00036 #include <memory>
00037
00045 namespace RemoteViz
00046 {
00047 namespace Rendering
00048 {
00049
00050 class RenderArea;
00051
00052 class ServiceImpl;
00053
00054 class Client;
00055
00056 class ServiceSettings;
00057
00058 class ServiceListener;
00059
00060 class RenderAreaHardware;
00076 class RENDERSERVICE_API Service
00077 {
00078
00080 friend class RenderAreaImpl;
00081 friend class ConnectionImpl;
00082 friend class ClientImpl;
00083 friend class ServiceDeleter;
00084 friend class RenderAreaDeleter;
00085 friend class LicenseHelper;
00088 public:
00089
00096 static Service* instance();
00101 void dispatch() const;
00114 bool open(ServiceSettings* instanceSettings);
00121 bool close();
00127 bool isRunning() const;
00141 void createRenderArea(const std::string& id, unsigned int width, unsigned int height, RenderAreaHardware* renderAreaHardware);
00149 RenderArea* getRenderArea(const std::string& id) const;
00157 RenderArea* getRenderArea(unsigned int index) const;
00163 unsigned int getNumRenderAreas() const;
00169 ServiceSettings* getSettings() const;
00175 void addListener(std::shared_ptr<ServiceListener> listener);
00181 void removeListener(std::shared_ptr<ServiceListener> listener);
00185 void removeAllListeners();
00191 unsigned int getNumListeners() const;
00199 Client* getClient(const std::string& id) const;
00207 Client* getClient(unsigned int index) const;
00213 unsigned int getNumClients() const;
00214
00215 private:
00217 std::shared_ptr<ServiceImpl> getImpl() const;
00220 private:
00222 std::shared_ptr<ServiceImpl> pImpl;
00223
00225 Service();
00226
00228 Service(const Service&) = delete;
00229 Service& operator= (const Service&) = delete;
00230
00231 };
00232 }
00233 }
00234