diff --git a/modules/softwareintegration/network/softwareconnection.cpp b/modules/softwareintegration/network/softwareconnection.cpp index 08d4df7119..1f03c71e6f 100644 --- a/modules/softwareintegration/network/softwareconnection.cpp +++ b/modules/softwareintegration/network/softwareconnection.cpp @@ -98,7 +98,7 @@ void SoftwareConnection::addPropertySubscription( } // Set new onChange handler - SceneGraphNodeInfo::OnChangeHandle onChangeHandle = property->onChange(newHandler); + connection::SceneGraphNodeInfo::OnChangeHandle onChangeHandle = property->onChange(newHandler); auto propertySubscriptions = _sceneGraphNodes.find(identifier); if (propertySubscriptions == _sceneGraphNodes.end()) { @@ -118,7 +118,7 @@ void SoftwareConnection::addPropertySubscription( } else { // Property subscription doesn't exist - SceneGraphNodeInfo::PropertySubscription newPropertySubscription{ onChangeHandle }; + connection::SceneGraphNodeInfo::PropertySubscription newPropertySubscription{ onChangeHandle }; propertySubscriptions->second.propertySubscriptions.emplace(propertyName, newPropertySubscription); } } diff --git a/modules/softwareintegration/network/softwareconnection.h b/modules/softwareintegration/network/softwareconnection.h index 65e58c04ec..109f98a0f7 100644 --- a/modules/softwareintegration/network/softwareconnection.h +++ b/modules/softwareintegration/network/softwareconnection.h @@ -53,6 +53,27 @@ namespace connection { std::shared_ptr connectionPtr ); + struct SceneGraphNodeInfo { + using OnChangeHandle = properties::Property::OnChangeHandle; + struct PropertySubscription { + OnChangeHandle onChangehandle; + bool shouldSendMessage{ false }; + }; + using PropertySubscriptions = std::unordered_map; + /* /\ + | + propertyName + */ + + using OutgoingMessages = std::unordered_map< + softwareintegration::simp::DataKey, + std::tuple, int32_t> + >; + + OutgoingMessages outgoingMessages{}; + PropertySubscriptions propertySubscriptions{}; + }; + } // namespace connection } // namespace softwareintegration::network @@ -61,8 +82,6 @@ using namespace softwareintegration::network; class SoftwareConnection { public: - struct SceneGraphNodeInfo; - explicit SoftwareConnection(std::unique_ptr socket); SoftwareConnection(SoftwareConnection&& p); ~SoftwareConnection(); @@ -139,7 +158,7 @@ private: std::unique_ptr _socket; - std::unordered_map _sceneGraphNodes; + std::unordered_map _sceneGraphNodes; std::mutex _outgoingMessagesMutex; std::atomic_bool _shouldStopOutgoingMessagesThread; std::unique_ptr _outgoingMessagesThread; @@ -155,26 +174,6 @@ private: bool _handshakeHasBeenMade = false; }; -struct SoftwareConnection::SceneGraphNodeInfo { - using OnChangeHandle = properties::Property::OnChangeHandle; - struct PropertySubscription { - OnChangeHandle onChangehandle; - bool shouldSendMessage{ false }; - }; - using PropertySubscriptions = std::unordered_map; - // /\ - // | - // propertyName - - using OutgoingMessages = std::unordered_map< - softwareintegration::simp::DataKey, - std::tuple, int32_t> - >; - - OutgoingMessages outgoingMessages{}; - PropertySubscriptions propertySubscriptions{}; -}; - } // namespace openspace #endif // __OPENSPACE_MODULE_SOFTWAREINTEGRATION___SOFTWAREINTEGRATIONMODULE___H__ diff --git a/modules/softwareintegration/simp/simp.inl b/modules/softwareintegration/simp/simp.inl index fab88f78f0..aa7d20fe9a 100644 --- a/modules/softwareintegration/simp/simp.inl +++ b/modules/softwareintegration/simp/simp.inl @@ -35,7 +35,7 @@ bool hostIsBigEndian() { // is placed at the byte with the lowest address // Example: 4 byte int with with value 1 is as bytes // is 0001 for big endian and 1000 for little endian - return *(char*)&i == 0; + return *(const char*)&i == 0; } template