#ifndef CORPORATIONS_IMPL_H
#define CORPORATIONS_IMPL_H
-#include <pthread.h>
-
-#include <list>
-#include <map>
-#include <string>
-
#include "stg/corporations.h"
#include "stg/corp_conf.h"
#include "stg/locker.h"
#include "stg/noncopyable.h"
#include "stg/logger.h"
+#include <list>
+#include <map>
+#include <string>
+
+#include <pthread.h>
+
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);
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<CORP_CONF>::iterator crp_iter;
- typedef list<CORP_CONF>::const_iterator const_crp_iter;
+ CORPORATIONS_IMPL(const CORPORATIONS_IMPL & rvalue);
+ CORPORATIONS_IMPL & operator=(const CORPORATIONS_IMPL & rvalue);
+
+ typedef std::list<CORP_CONF>::iterator crp_iter;
+ typedef std::list<CORP_CONF>::const_iterator const_crp_iter;
bool Read();
std::list<CORP_CONF> data;
- STORE * store;
- STG_LOGGER & WriteServLog;
+ STORE * store;
+ STG_LOGGER & WriteServLog;
mutable std::map<int, const_crp_iter> searchDescriptors;
- mutable unsigned int handle;
+ mutable unsigned int handle;
mutable pthread_mutex_t mutex;
- std::string strError;
+ std::string strError;
};
#endif