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/RuntimeImpl.h>
20
#include <scopes/internal/ScopeLoader.h>
21
#include <scopes/internal/ScopeObject.h>
22
#include <unity/UnityExceptions.h>
27
using namespace unity::api::scopes;
28
using namespace unity::api::scopes::internal;
33
// TODO: the hard-wired strings here need to be read from config.
35
string scope_name = string("scope-A");
39
RuntimeImpl::UPtr rt = RuntimeImpl::create(scope_name);
40
ScopeLoader::SPtr loader = ScopeLoader::load(scope_name, "lib" + scope_name + ".so", rt->registry());
42
MiddlewareBase::SPtr mw = rt->factory()->create(scope_name, "Zmq", "Zmq.Config");
43
ScopeObject::SPtr scope(new ScopeObject(rt.get(), loader->scope_base()));
44
mw->add_scope_object(scope_name, scope);
45
mw->wait_for_shutdown();
47
catch (unity::Exception const& e)
49
cerr << e.to_string() << endl;