virtual ~USERS() {}
virtual int FindByName(const std::string & login, USER_PTR * user) = 0;
virtual int FindByName(const std::string & login, CONST_USER_PTR * user) const = 0;
+ virtual bool Exists(const std::string & login) const = 0;
virtual bool TariffInUse(const std::string & tariffName) const = 0;
return 0;
}
//-----------------------------------------------------------------------------
+bool USERS_IMPL::Exists(const std::string & login) const
+{
+STG_LOCKER lock(&mutex);
+const std::map<std::string, user_iter>::const_iterator iter(loginIndex.find(login));
+return iter != loginIndex.end();
+}
+//-----------------------------------------------------------------------------
bool USERS_IMPL::TariffInUse(const std::string & tariffName) const
{
STG_LOCKER lock(&mutex);
int FindByName(const std::string & login, USER_PTR * user);
int FindByName(const std::string & login, CONST_USER_PTR * user) const;
+ bool Exists(const std::string & login) const;
+
bool TariffInUse(const std::string & tariffName) const;
void AddNotifierUserAdd(NOTIFIER_BASE<USER_PTR> *);