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 #include <Inventor/sys/port.h>
00024 #include <RemoteViz/Rendering/LibHelper.h>
00025
00026 #include <string>
00027 #include <memory>
00028
00036 namespace RemoteViz
00037 {
00038 namespace Rendering
00039 {
00040
00041 class RenderArea;
00042
00043 class ServiceImpl;
00044
00045 class Client;
00046
00047 class ServiceSettings;
00048
00049 class ServiceListener;
00050
00051 class RenderAreaHardware;
00085 class RENDERSERVICE_API Service
00086 {
00087
00089 friend class RenderAreaImpl;
00090 friend class ConnectionImpl;
00091 friend class ClientImpl;
00092 friend class RenderAreaDeleter;
00093 friend class MonitoringImpl;
00094 friend class ServiceDeleter;
00097 public:
00098
00105 static Service* instance();
00110 void dispatch() const;
00121 bool open(std::shared_ptr<const ServiceSettings> settings);
00128 bool close();
00134 bool isRunning() const;
00149 void createRenderArea(const std::string& id, unsigned int width, unsigned int height, std::shared_ptr<const RenderAreaHardware> renderAreaHardware);
00157 std::shared_ptr<RenderArea> getRenderArea(const std::string& id) const;
00165 std::shared_ptr<RenderArea> getRenderArea(unsigned int index) const;
00171 unsigned int getNumRenderAreas() const;
00177 std::shared_ptr<const ServiceSettings> getSettings() const;
00183 void addListener(std::shared_ptr<ServiceListener> listener);
00189 void removeListener(std::shared_ptr<ServiceListener> listener);
00193 void removeAllListeners();
00199 unsigned int getNumListeners() const;
00207 std::shared_ptr<Client> getClient(const std::string& id) const;
00215 std::shared_ptr<Client> getClient(unsigned int index) const;
00221 unsigned int getNumClients() const;
00222
00223 private:
00225 std::shared_ptr<ServiceImpl> getImpl() const;
00228 private:
00230 std::shared_ptr<ServiceImpl> pImpl;
00231
00233 Service();
00234
00236 Service(const Service&) = delete;
00237 Service& operator= (const Service&) = delete;
00238
00239 };
00240 }
00241 }
00242