Mercurial > irccd
comparison tests/src/libirccd-daemon/dynlib-plugin/sample_plugin.cpp @ 818:49fa22f0b4b9
windows: support for VS2017
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 23 Nov 2018 21:50:20 +0100 |
parents | |
children | 06cc2f95f479 |
comparison
equal
deleted
inserted
replaced
817:ebe561276c33 | 818:49fa22f0b4b9 |
---|---|
1 /* | |
2 * sample_plugin.cpp -- basic exported plugin test | |
3 * | |
4 * Copyright (c) 2013-2018 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #include <irccd/daemon/dynlib_plugin.hpp> | |
20 | |
21 #include <irccd/test/mock_plugin.hpp> | |
22 | |
23 using irccd::test::mock_plugin; | |
24 | |
25 namespace irccd { | |
26 | |
27 class sample_plugin : public mock_plugin { | |
28 public: | |
29 sample_plugin() | |
30 : mock_plugin("test") | |
31 { | |
32 } | |
33 | |
34 static auto abi() -> version | |
35 { | |
36 return version(); | |
37 } | |
38 | |
39 static auto init(std::string) -> std::unique_ptr<plugin> | |
40 { | |
41 return std::make_unique<sample_plugin>(); | |
42 } | |
43 }; | |
44 | |
45 BOOST_DLL_ALIAS(sample_plugin::abi, irccd_abi_sample_plugin) | |
46 BOOST_DLL_ALIAS(sample_plugin::init, irccd_init_sample_plugin) | |
47 | |
48 } // !irccd |