2
* Copyright (C) 2013 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by: Michi Henning <michi.henning@canonical.com>
19
#include <scopes/internal/zmq_middleware/ZmqConfig.h>
35
const char* ZmqConfig::ZMQ_CONFIG_GROUP = "Zmq";
39
const string public_dir_str = "EndpointDir.Public";
40
const string private_dir_str = "EndpointDir.Private";
43
ZmqConfig::ZmqConfig(string const& configfile) :
44
ConfigBase(configfile)
46
public_dir_ = get_string(ZMQ_CONFIG_GROUP, public_dir_str);
48
// Private directory is not needed by all processes. It is retrieved
49
// on demand during adapter creation.
52
ZmqConfig::~ZmqConfig() noexcept
56
string ZmqConfig::public_dir() const
61
string ZmqConfig::private_dir() const
63
lock_guard<mutex> lock(mutex_);
64
if (private_dir_.empty()) // Initialize first time only
66
private_dir_ = get_string(ZMQ_CONFIG_GROUP, private_dir_str);
71
} // namespace internal