librime: db_pool.h Source File

| librime 1.2 Rime Input Method Engine, the core library

db_pool.h
Go to the documentation of this file.
1#ifndef RIME_DB_POOL_H_
2#define RIME_DB_POOL_H_
3
4#include <rime/common.h>
5#include <rime/resource.h>
6
7namespace rime {
8
9class ResourceResolver;
10
11template <class T>
12 class DbPool {
13 public:
14 explicit DbPool(the<ResourceResolver> resource_resolver);
15
16 an<T> GetDb(const string& db_name);
17
18 protected:
19 the<ResourceResolver> resource_resolver_;
20 map<string, weak<T>> db_pool_;
21};
22
23} // namespace rime
24
25#endif // RIME_DB_POOL_H_
common.h
resource.h
rime
Definition algebra.cc:12
rime::an
std::shared_ptr< T > an
Definition common.h:60
rime::the
std::unique_ptr< T > the
Definition common.h:58
rime::DbPool::db_pool_
map< string, weak< T > > db_pool_
Definition db_pool.h:20
rime::DbPool::DbPool
DbPool(the< ResourceResolver > resource_resolver)
Definition db_pool_impl.h:10
rime::DbPool::GetDb
an< T > GetDb(const string &db_name)
Definition db_pool_impl.h:14
rime::DbPool::resource_resolver_
the< ResourceResolver > resource_resolver_
Definition db_pool.h:19
rime::ResourceResolver
Definition resource.h:22