- Timestamp:
- Aug 29, 2015, 5:35:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/network/synchronisable/Serialise.h
r9667 r10555 78 78 } 79 79 80 // These functions implement loading / saving / etc. for S martPtr<T>80 // These functions implement loading / saving / etc. for StrongPtr<T> 81 81 82 82 /** @brief returns the size of the objectID needed to synchronise the pointer */ 83 template <class T> inline uint32_t returnSize( const S martPtr<T>& )83 template <class T> inline uint32_t returnSize( const StrongPtr<T>& ) 84 84 { 85 85 return sizeof(uint32_t); … … 87 87 88 88 /** @brief reads the objectID of a pointer out of the bytestream and increases the mem pointer */ 89 template <class T> inline void loadAndIncrease( const S martPtr<T>& variable, uint8_t*& mem )89 template <class T> inline void loadAndIncrease( const StrongPtr<T>& variable, uint8_t*& mem ) 90 90 { 91 91 // *const_cast<typename Loki::TypeTraits<T*>::UnqualifiedType*>(&variable) = dynamic_cast<T*>(variable->getSynchronisable( *(uint32_t*)(mem) )); 92 *const_cast<typename Loki::TypeTraits<S martPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));92 *const_cast<typename Loki::TypeTraits<StrongPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem))); 93 93 mem += returnSize( variable ); 94 94 } 95 95 96 96 /** @brief saves the objectID of a pointer into the bytestream and increases the mem pointer */ 97 template <class T> inline void saveAndIncrease( const S martPtr<T>& variable, uint8_t*& mem )97 template <class T> inline void saveAndIncrease( const StrongPtr<T>& variable, uint8_t*& mem ) 98 98 { 99 99 if ( variable.get() ) … … 105 105 106 106 /** @brief checks whether the objectID of the variable is the same as in the bytestream */ 107 template <class T> inline bool checkEquality( const S martPtr<T>& variable, uint8_t* mem )107 template <class T> inline bool checkEquality( const StrongPtr<T>& variable, uint8_t* mem ) 108 108 { 109 109 if ( variable.get() ) … … 125 125 { 126 126 // *const_cast<typename Loki::TypeTraits<T*>::UnqualifiedType*>(&variable) = dynamic_cast<T*>(variable->getSynchronisable( *(uint32_t*)(mem) )); 127 *const_cast<typename Loki::TypeTraits<S martPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem)));127 *const_cast<typename Loki::TypeTraits<StrongPtr<T> >::UnqualifiedType*>(&variable) = orxonox_cast<T*>(T::getSynchronisable(*(uint32_t*)(mem))); 128 128 mem += returnSize( variable ); 129 129 }
Note: See TracChangeset
for help on using the changeset viewer.