aboutsummaryrefslogtreecommitdiff
path: root/brep/shared-database
blob: 36fa0a2259ff550c550d2a6152256122d0c82261 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// file      : brep/shared-database -*- C++ -*-
// copyright : Copyright (c) 2014-2015 Code Synthesis Ltd
// license   : MIT; see accompanying LICENSE file

#ifndef BREP_SHARED_DATABASE
#define BREP_SHARED_DATABASE

#include <string>
#include <memory> // shared_ptr

#include <odb/forward.hxx> // database

namespace brep
{
  // Returns pointer to the shared database instance, creating one on the
  // first call. On subsequent calls ensures passed host and port equals
  // to ones of the existing database instance throwing runtime_error
  // otherwise. Is not thread-safe.
  //
  std::shared_ptr<odb::core::database>
  shared_database (const std::string& host, unsigned int port);
}

#endif // BREP_SHARED_DATABASE