-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #726 from CesiumGS/update-cesium-native
Update cesium native to 0.38.0
- Loading branch information
Showing
13 changed files
with
203 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule cesium-native
updated
255 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/core/include/cesium/omniverse/CesiumIonSessionManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#pragma once | ||
|
||
#include <memory> | ||
#include <string> | ||
#include <unordered_map> | ||
|
||
namespace cesium::omniverse { | ||
|
||
class CesiumIonSession; | ||
class Context; | ||
|
||
class CesiumIonSessionManager { | ||
public: | ||
CesiumIonSessionManager(Context* pContext); | ||
~CesiumIonSessionManager() = default; | ||
CesiumIonSessionManager(const CesiumIonSessionManager&) = delete; | ||
CesiumIonSessionManager& operator=(const CesiumIonSessionManager&) = delete; | ||
CesiumIonSessionManager(CesiumIonSessionManager&&) noexcept = delete; | ||
CesiumIonSessionManager& operator=(CesiumIonSessionManager&&) noexcept = delete; | ||
|
||
std::shared_ptr<CesiumIonSession> | ||
getOrCreateSession(const std::string& ionServerUrl, const std::string& ionServerApiUrl, int64_t applicationId); | ||
|
||
private: | ||
std::unordered_map<std::string, std::shared_ptr<CesiumIonSession>> _sessions; | ||
Context* _pContext; | ||
}; | ||
|
||
} // namespace cesium::omniverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#include "cesium/omniverse/CesiumIonSessionManager.h" | ||
|
||
#include "cesium/omniverse/CesiumIonSession.h" | ||
#include "cesium/omniverse/Context.h" | ||
|
||
namespace cesium::omniverse { | ||
|
||
CesiumIonSessionManager::CesiumIonSessionManager(Context* pContext) | ||
: _pContext(pContext) {} | ||
|
||
std::shared_ptr<CesiumIonSession> CesiumIonSessionManager::getOrCreateSession( | ||
const std::string& ionServerUrl, | ||
const std::string& ionServerApiUrl, | ||
int64_t applicationId) { | ||
const auto key = ionServerUrl + ionServerApiUrl + std::to_string(applicationId); | ||
const auto foundIter = _sessions.find(key); | ||
if (foundIter != _sessions.end()) { | ||
return foundIter->second; | ||
} | ||
|
||
auto pSession = std::make_shared<CesiumIonSession>( | ||
_pContext->getAsyncSystem(), _pContext->getAssetAccessor(), ionServerUrl, ionServerApiUrl, applicationId); | ||
|
||
_sessions.emplace(key, pSession); | ||
|
||
return pSession; | ||
} | ||
|
||
} // namespace cesium::omniverse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.