|
@ -13,30 +13,31 @@ namespace pEp |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<> |
|
|
template<> |
|
|
pEp_identity* identity_list::* const ListWrapper<identity_list*, const char*>::Value = &identity_list::ident; |
|
|
::pEp_identity* identity_list::* const ListWrapper<::identity_list*, ::pEp_identity*>::Value |
|
|
|
|
|
= &identity_list::ident; |
|
|
|
|
|
|
|
|
template<> |
|
|
template<> |
|
|
int identity_list::size() const |
|
|
int IdentityList::size() const |
|
|
{ |
|
|
{ |
|
|
return identity_list_length(value); |
|
|
return identity_list_length(value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// faster than .size()==0 because it's not necessary to iterate throgh the whole list
|
|
|
// faster than .size()==0 because it's not necessary to iterate throgh the whole list
|
|
|
template<> |
|
|
template<> |
|
|
bool identity_list::empty() const |
|
|
bool IdentityList::empty() const |
|
|
{ |
|
|
{ |
|
|
return !(value && value->ident); |
|
|
return !(value && value->ident); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<> |
|
|
template<> |
|
|
void identity_list::clear() |
|
|
void IdentityList::clear() |
|
|
{ |
|
|
{ |
|
|
free_identity_list(value); |
|
|
free_identity_list(value); |
|
|
value = nullptr; |
|
|
value = nullptr; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
template<> |
|
|
template<> |
|
|
void identity_list::push_back(pEp_identity*&& id) |
|
|
void IdentityList::push_back(pEp_identity*&& id) |
|
|
{ |
|
|
{ |
|
|
auto last = identity_list_add(value, id); |
|
|
auto last = identity_list_add(value, id); |
|
|
if(value==nullptr) |
|
|
if(value==nullptr) |
|
@ -46,7 +47,7 @@ namespace pEp |
|
|
|
|
|
|
|
|
template<> |
|
|
template<> |
|
|
ListWrapper<::identity_list*, pEp_identity*>::ListWrapper(const std::initializer_list<Wrapper<pEp_identity*>>& il) |
|
|
ListWrapper<::identity_list*, pEp_identity*>::ListWrapper(const std::initializer_list<Wrapper<pEp_identity*>>& il) |
|
|
: identity_list{} |
|
|
: Base{} |
|
|
{ |
|
|
{ |
|
|
::identity_list* last = nullptr; |
|
|
::identity_list* last = nullptr; |
|
|
for(const Wrapper<pEp_identity*>& id : il) |
|
|
for(const Wrapper<pEp_identity*>& id : il) |
|
|