36 return std::make_shared<SIPAccount>(
id,
true);
39 return std::make_shared<JamiAccount>(
id);
43std::shared_ptr<Account>
52 if (
it == generators_.cend())
55 std::shared_ptr<Account>
account =
it->second(
id);
57 std::lock_guard lock(mutex_);
59 if (
m == accountMaps_.end())
69 return generators_.find(name) != generators_.cend();
76 std::lock_guard lock(mutex_);
77 const auto&
id =
account.getAccountID();
80 if (
m != accountMaps_.end()) {
89 std::lock_guard lock(mutex_);
101 std::lock_guard
lk(mutex_);
103 for (
const auto&
item : accountMaps_) {
104 const auto& map =
item.second;
105 if (map.find(
id) != map.cend())
116 std::lock_guard
lk(mutex_);
117 accountMaps_.clear();
121std::vector<std::shared_ptr<Account>>
124 std::lock_guard lock(mutex_);
125 std::vector<std::shared_ptr<Account>> v;
127 for (
const auto&
itemmap : accountMaps_) {
128 const auto& map =
itemmap.second;
129 v.reserve(v.size() + map.size());
130 for (
const auto&
item : map)
131 v.push_back(
item.second);
138std::shared_ptr<Account>
141 std::lock_guard lock(mutex_);
143 for (
const auto&
item : accountMaps_) {
144 const auto& map =
item.second;
145 const auto&
iter = map.find(
id);
146 if (
iter != map.cend())
157 std::lock_guard lock(mutex_);
159 for (
const auto&
item : accountMaps_) {
160 const auto& map =
item.second;
172 std::lock_guard lock(mutex_);
173 std::size_t count = 0;
175 for (
const auto&
it : accountMaps_)
176 count +=
it.second.size();
std::shared_ptr< T > getAccount(std::string_view id) const
std::vector< std::shared_ptr< T > > getAllAccounts() const
bool isSupportedType(std::string_view accountType) const
static const std::string_view DEFAULT_ACCOUNT_TYPE
std::size_t accountCount() const
bool hasAccount(std::string_view id) const
void removeAccount(Account &account)
std::shared_ptr< Account > createAccount(std::string_view accountType, const std::string &id)
static constexpr auto ACCOUNT_TYPE
static constexpr auto ACCOUNT_TYPE
#define JAMI_ERROR(formatstr,...)
#define JAMI_DEBUG(formatstr,...)
void emitSignal(Args... args)
std::map< std::string, std::shared_ptr< T >, std::less<> > AccountMap
A SIP Account specify SIP specific functions and object = SIPCall/SIPVoIPLink)