Handling for when userdata is not defined yet, but might be defined later
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-08-25 11:53:37 +02:00
parent 5b7da77027
commit 4c97a7c811
7 changed files with 82 additions and 24 deletions

View 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