Line data Source code
1 :
2 : /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3 : *
4 : * This file is part of Collage <https://github.com/Eyescale/Collage>
5 : *
6 : * This library is free software; you can redistribute it and/or modify it under
7 : * the terms of the GNU Lesser General Public License version 2.1 as published
8 : * by the Free Software Foundation.
9 : *
10 : * This library is distributed in the hope that it will be useful, but WITHOUT
11 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13 : * details.
14 : *
15 : * You should have received a copy of the GNU Lesser General Public License
16 : * along with this library; if not, write to the Free Software Foundation, Inc.,
17 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 : */
19 :
20 : #include "customOCommand.h"
21 : #include "nodeCommand.h"
22 :
23 : namespace co
24 : {
25 : namespace detail
26 : {
27 : class CustomOCommand
28 : {
29 : public:
30 2 : explicit CustomOCommand(const uint128_t& commandID_)
31 2 : : commandID(commandID_)
32 : {
33 2 : }
34 :
35 0 : CustomOCommand(const CustomOCommand& rhs)
36 0 : : commandID(rhs.commandID)
37 : {
38 0 : }
39 :
40 : const uint128_t commandID;
41 : };
42 : }
43 :
44 2 : CustomOCommand::CustomOCommand(const Connections& receivers,
45 2 : const uint128_t& commandID)
46 : : OCommand(receivers, CMD_NODE_COMMAND, COMMANDTYPE_NODE)
47 2 : , _impl(new detail::CustomOCommand(commandID))
48 : {
49 2 : _init();
50 2 : }
51 :
52 0 : CustomOCommand::CustomOCommand(LocalNodePtr localNode,
53 0 : const uint128_t& commandID)
54 0 : : OCommand(localNode.get(), localNode, CMD_NODE_COMMAND, COMMANDTYPE_NODE)
55 0 : , _impl(new detail::CustomOCommand(commandID))
56 : {
57 0 : _init();
58 0 : }
59 :
60 0 : CustomOCommand::CustomOCommand(const CustomOCommand& rhs)
61 : : OCommand(rhs)
62 0 : , _impl(new detail::CustomOCommand(*rhs._impl))
63 : {
64 0 : _init();
65 0 : }
66 :
67 2 : void CustomOCommand::_init()
68 : {
69 2 : *this << _impl->commandID;
70 2 : }
71 :
72 4 : CustomOCommand::~CustomOCommand()
73 : {
74 2 : delete _impl;
75 2 : }
76 63 : }
|