Line data Source code
1 :
2 : /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3 : * 2014, Stefan.Eilemann@epfl.ch
4 : *
5 : * This file is part of Collage <https://github.com/Eyescale/Collage>
6 : *
7 : * This library is free software; you can redistribute it and/or modify it under
8 : * the terms of the GNU Lesser General Public License version 2.1 as published
9 : * by the Free Software Foundation.
10 : *
11 : * This library is distributed in the hope that it will be useful, but WITHOUT
12 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14 : * details.
15 : *
16 : * You should have received a copy of the GNU Lesser General Public License
17 : * along with this library; if not, write to the Free Software Foundation, Inc.,
18 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : */
20 :
21 : #include "masterCMCommand.h"
22 :
23 :
24 : namespace co
25 : {
26 :
27 : namespace detail
28 : {
29 :
30 : class MasterCMCommand
31 : {
32 : public:
33 45 : MasterCMCommand() : useCache( false ) {}
34 :
35 0 : MasterCMCommand( const MasterCMCommand& ) : useCache( false ) {}
36 :
37 : uint128_t requestedVersion;
38 : uint128_t minCachedVersion;
39 : uint128_t maxCachedVersion;
40 : uint128_t objectID;
41 : uint64_t maxVersion;
42 : uint32_t requestID;
43 : uint32_t instanceID;
44 : uint32_t masterInstanceID;
45 : bool useCache;
46 : };
47 :
48 : }
49 :
50 45 : MasterCMCommand::MasterCMCommand( const ICommand& command )
51 : : ICommand( command )
52 45 : , _impl( new detail::MasterCMCommand )
53 : {
54 45 : _init();
55 45 : }
56 :
57 0 : MasterCMCommand::MasterCMCommand( const MasterCMCommand& rhs )
58 : : ICommand( rhs )
59 0 : , _impl( new detail::MasterCMCommand( *rhs._impl ))
60 : {
61 0 : _init();
62 0 : }
63 :
64 45 : void MasterCMCommand::_init()
65 : {
66 45 : if( isValid( ))
67 45 : *this >> _impl->requestedVersion >> _impl->minCachedVersion
68 90 : >> _impl->maxCachedVersion >> _impl->objectID >> _impl->maxVersion
69 90 : >> _impl->requestID >> _impl->instanceID
70 90 : >> _impl->masterInstanceID >> _impl->useCache;
71 45 : }
72 :
73 90 : MasterCMCommand::~MasterCMCommand()
74 : {
75 45 : delete _impl;
76 45 : }
77 :
78 78 : const uint128_t& MasterCMCommand::getRequestedVersion() const
79 : {
80 78 : return _impl->requestedVersion;
81 : }
82 :
83 29 : const uint128_t& MasterCMCommand::getMinCachedVersion() const
84 : {
85 29 : return _impl->minCachedVersion;
86 : }
87 :
88 33 : const uint128_t& MasterCMCommand::getMaxCachedVersion() const
89 : {
90 33 : return _impl->maxCachedVersion;
91 : }
92 :
93 131 : const uint128_t& MasterCMCommand::getObjectID() const
94 : {
95 131 : return _impl->objectID;
96 : }
97 :
98 33 : uint64_t MasterCMCommand::getMaxVersion() const
99 : {
100 33 : return _impl->maxVersion;
101 : }
102 :
103 90 : uint32_t MasterCMCommand::getRequestID() const
104 : {
105 90 : return _impl->requestID;
106 : }
107 :
108 123 : uint32_t MasterCMCommand::getInstanceID() const
109 : {
110 123 : return _impl->instanceID;
111 : }
112 :
113 4 : uint32_t MasterCMCommand::getMasterInstanceID() const
114 : {
115 4 : return _impl->masterInstanceID;
116 : }
117 :
118 86 : bool MasterCMCommand::useCache() const
119 : {
120 86 : return _impl->useCache;
121 : }
122 :
123 60 : }
|