Make BaseLibraries use shared_ptr.
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:
@@ -16,19 +16,25 @@
|
||||
export uint8_t simpleName##_DeleteWithHash(fullname* p, uint32_t hashedKey) { Try(p->Delete(hashedKey);) } \
|
||||
\
|
||||
export bool simpleName##_TryGet(fullname* p, const char* name, const returnType*& out) { \
|
||||
return p->TryGet(Arbutils::CaseInsensitiveConstString::GetHash(name), out); \
|
||||
std::shared_ptr<const returnType> o; \
|
||||
auto v = p->TryGet(Arbutils::CaseInsensitiveConstString::GetHash(name), o); \
|
||||
out = o.operator->(); \
|
||||
return v; \
|
||||
} \
|
||||
\
|
||||
export bool simpleName##_TryGetWithHash(fullname* p, uint32_t hashedKey, const returnType*& out) { \
|
||||
return p->TryGet(hashedKey, out); \
|
||||
std::shared_ptr<const returnType> o; \
|
||||
auto v = p->TryGet(hashedKey, o); \
|
||||
out = o.operator->(); \
|
||||
return v; \
|
||||
} \
|
||||
\
|
||||
export uint8_t simpleName##_Get(fullname* p, const char* name, const returnType*& out) { \
|
||||
Try(out = p->Get(Arbutils::CaseInsensitiveConstString::GetHash(name));) \
|
||||
Try(out = p->Get(Arbutils::CaseInsensitiveConstString::GetHash(name)).operator->();) \
|
||||
} \
|
||||
\
|
||||
export uint8_t simpleName##_GetWithHash(fullname* p, uint32_t hashedKey, const returnType*& out) { \
|
||||
Try(out = p->Get(hashedKey);) \
|
||||
Try(out = p->Get(hashedKey).operator->();) \
|
||||
} \
|
||||
\
|
||||
export size_t simpleName##_GetCount(fullname* p) { return p->GetCount(); }
|
||||
|
||||
Reference in New Issue
Block a user