34 [](
const std::string&
id) {
return std::make_shared<SIPAccount>(
id,
true); });
36 [](
const std::string&
id) {
return std::make_shared<JamiAccount>(
id); });
39std::shared_ptr<Account>
48 if (
it == generators_.cend())
51 std::shared_ptr<Account>
account =
it->second(
id);
53 std::lock_guard lock(mutex_);
55 if (
m == accountMaps_.end())
65 return generators_.find(name) != generators_.cend();
72 std::lock_guard lock(mutex_);
73 const auto&
id =
account.getAccountID();
76 if (
m != accountMaps_.end()) {
85 std::lock_guard lock(mutex_);
97 std::lock_guard
lk(mutex_);
99 for (
const auto&
item : accountMaps_) {
100 const auto& map =
item.second;
101 if (map.find(
id) != map.cend())
112 std::lock_guard
lk(mutex_);
113 accountMaps_.clear();
117std::vector<std::shared_ptr<Account>>
120 std::lock_guard lock(mutex_);
121 std::vector<std::shared_ptr<Account>> v;
123 for (
const auto&
itemmap : accountMaps_) {
124 const auto& map =
itemmap.second;
125 v.reserve(v.size() + map.size());
126 for (
const auto&
item : map)
127 v.push_back(
item.second);
134std::shared_ptr<Account>
137 std::lock_guard lock(mutex_);
139 for (
const auto&
item : accountMaps_) {
140 const auto& map =
item.second;
141 const auto&
iter = map.find(
id);
142 if (
iter != map.cend())
153 std::lock_guard lock(mutex_);
155 for (
const auto&
item : accountMaps_) {
156 const auto& map =
item.second;
168 std::lock_guard lock(mutex_);
169 std::size_t count = 0;
171 for (
const auto&
it : accountMaps_)
172 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)