X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/d25555ce9c6e09344356868780e678c75bbbd164..005739f70a1d33ff4babbb3e6152fc6063aa480b:/projects/stargazer/corps_impl.h diff --git a/projects/stargazer/corps_impl.h b/projects/stargazer/corps_impl.h index ad705c54..a685ad46 100644 --- a/projects/stargazer/corps_impl.h +++ b/projects/stargazer/corps_impl.h @@ -15,18 +15,12 @@ */ /* - * Author : Maxim Mamontov + * Author : Maksym Mamontov */ #ifndef CORPORATIONS_IMPL_H #define CORPORATIONS_IMPL_H -#include - -#include -#include -#include - #include "stg/corporations.h" #include "stg/corp_conf.h" #include "stg/locker.h" @@ -34,11 +28,17 @@ #include "stg/noncopyable.h" #include "stg/logger.h" +#include +#include +#include + +#include + class ADMIN; class CORPORATIONS_IMPL : private NONCOPYABLE, public CORPORATIONS { public: - CORPORATIONS_IMPL(STORE * st); + explicit CORPORATIONS_IMPL(STORE * st); virtual ~CORPORATIONS_IMPL() {} int Add(const CORP_CONF & corp, const ADMIN * admin); @@ -48,23 +48,28 @@ public: bool Exists(const std::string & name) const; const std::string & GetStrError() const { return strError; } + size_t Count() const { return data.size(); } + int OpenSearch() const; int SearchNext(int, CORP_CONF * corp) const; int CloseSearch(int) const; private: - typedef list::iterator crp_iter; - typedef list::const_iterator const_crp_iter; + CORPORATIONS_IMPL(const CORPORATIONS_IMPL & rvalue); + CORPORATIONS_IMPL & operator=(const CORPORATIONS_IMPL & rvalue); + + typedef std::list::iterator crp_iter; + typedef std::list::const_iterator const_crp_iter; bool Read(); std::list data; - STORE * store; - STG_LOGGER & WriteServLog; + STORE * store; + STG_LOGGER & WriteServLog; mutable std::map searchDescriptors; - mutable unsigned int handle; + mutable unsigned int handle; mutable pthread_mutex_t mutex; - std::string strError; + std::string strError; }; #endif