GlobeEngine
MessageQueue.h
Go to the documentation of this file.
1 
9 #ifndef GlobeEngine_MessageQueue_h
10 #define GlobeEngine_MessageQueue_h
11 
12 #include "OpenGL_Includes.h"
13 #include "Cache.h"
14 #include "Tile.h"
15 #include "Image.h"
16 
17 #include <iostream>
18 #include <vector>
19 #include <sstream>
20 #include <string>
21 #include <QRunnable>
22 #include <QMutex>
23 
24 namespace geSpatial {
25 
27  {
28  // set up a Cache with the tile Type
30 
31  public:
32  MessageQueue();
33  ~MessageQueue();
34 
35  void clear();
36  void create();
37  void create(unsigned int _capacity);
38  //void requestTFSKey(std::shared_ptr<geSpatial::SpatialKey> _key, std::string _repositoryUR, std::string _fileExtensionL);
39 
40  //void requestKey(std::shared_ptr<geSpatial::SpatialKey> _key, int _fileType, std::string _repositoryURL, std::string _fileExtension);
41 // void requestKey(std::shared_ptr<geSpatial::SpatialKey> _key, tileService::TileMapServiceInfo _tmsInfo);
42 
43  //void requestAsyncKey(std::shared_ptr<geSpatial::SpatialKey> _key, int _fileType, std::string _repositoryURL, std::string _fileExtension, std::shared_ptr<ge::Texture2Df> _tex);
44  void waitForDone();
45  //void setKeyToLoaded(std::shared_ptr<geSpatial::SpatialKey> _key);
46  void startTileLoadingJob(int _fileType, std::string _repositoryURL, std::string _fileExtension);
47  //void startAsyncTileLoadingJob(int _fileType, std::string _repositoryURL, std::string _fileExtension, std::shared_ptr<ge::Texture2Df> _tex);
48  void startFeatureLoadingJob(std::string _repositoryURL)
49  ;
50  void clearCache();
51  void setCacheCapacity(unsigned int _capacity);
52  const std::vector< std::shared_ptr<geSpatial::Tile> >& getAllLoadedTiles();
53  int getLoadedTileCount();
54 
55  protected:
56  std::shared_ptr<geSpatial::CullableSpatialKey> setNextKeyToOpenRequest();
57  // dynamic key vectors
58  std::vector< std::shared_ptr<geSpatial::CullableSpatialKey> > requestedKeys;
59  std::vector< std::shared_ptr<geSpatial::CullableSpatialKey> > openRequestKeys;
60  std::vector< std::shared_ptr<geSpatial::CullableSpatialKey> > loadedKeys;
61 
62  std::shared_ptr<TileCache> tileFetchcache;
64  };
65 }
66 #endif
Definition: MessageQueue.h:26
std::vector< std::shared_ptr< geSpatial::CullableSpatialKey > > requestedKeys
Definition: MessageQueue.h:58
std::shared_ptr< TileCache > tileFetchcache
Definition: MessageQueue.h:62
void clearCache()
Definition: MessageQueue.cpp:62
int getLoadedTileCount()
Definition: MessageQueue.cpp:78
const std::vector< std::shared_ptr< geSpatial::Tile > > & getAllLoadedTiles()
Definition: MessageQueue.cpp:73
void create()
Definition: MessageQueue.cpp:24
void setCacheCapacity(unsigned int _capacity)
Definition: MessageQueue.cpp:68
void startTileLoadingJob(int _fileType, std::string _repositoryURL, std::string _fileExtension)
Definition: Cache.h:19
~MessageQueue()
Definition: MessageQueue.cpp:16
MessageQueue()
Definition: MessageQueue.cpp:12
void startFeatureLoadingJob(std::string _repositoryURL)
std::shared_ptr< geSpatial::CullableSpatialKey > setNextKeyToOpenRequest()
Definition: MessageQueue.cpp:48
QMutex loadedKeysMutex
Definition: MessageQueue.h:63
std::vector< std::shared_ptr< geSpatial::CullableSpatialKey > > loadedKeys
Definition: MessageQueue.h:60
std::vector< std::shared_ptr< geSpatial::CullableSpatialKey > > openRequestKeys
Definition: MessageQueue.h:59
void waitForDone()
Definition: MessageQueue.cpp:56
Definition: Cache.h:17
void clear()
Definition: MessageQueue.cpp:20