Handling for when userdata is not defined yet, but might be defined later
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
22
src/UserData/RetrievedUserData.hpp
Normal file
22
src/UserData/RetrievedUserData.hpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#ifndef PORYGONLANG_RETRIEVEDUSERDATA_HPP
|
||||
#define PORYGONLANG_RETRIEVEDUSERDATA_HPP
|
||||
|
||||
#include "UserData.hpp"
|
||||
|
||||
namespace Porygon::UserData{
|
||||
class RetrievedUserData{
|
||||
UserData* _ud;
|
||||
uint32_t _key;
|
||||
public:
|
||||
explicit RetrievedUserData(UserData* ud) : _ud(ud), _key(0){}
|
||||
explicit RetrievedUserData(uint32_t id) : _ud(nullptr), _key(id){}
|
||||
|
||||
UserData * Get();
|
||||
|
||||
inline uint32_t GetKey() const{
|
||||
return _key;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#endif //PORYGONLANG_RETRIEVEDUSERDATA_HPP
|
||||
Reference in New Issue
Block a user