Line data Source code
1 :
2 : /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3 : *
4 : * This library is free software; you can redistribute it and/or modify it under
5 : * the terms of the GNU Lesser General Public License version 2.1 as published
6 : * by the Free Software Foundation.
7 : *
8 : * This library is distributed in the hope that it will be useful, but WITHOUT
9 : * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
10 : * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
11 : * details.
12 : *
13 : * You should have received a copy of the GNU Lesser General Public License
14 : * along with this library; if not, write to the Free Software Foundation, Inc.,
15 : * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
16 : */
17 :
18 : #include "eventICommand.h"
19 :
20 : #include "event.h"
21 :
22 : namespace eq
23 : {
24 :
25 : namespace detail
26 : {
27 : class EventICommand
28 : {
29 : public:
30 4748 : EventICommand() {}
31 :
32 : uint32_t eventType;
33 : };
34 : }
35 :
36 4667 : EventICommand::EventICommand( const co::ICommand& command )
37 : : co::ObjectICommand( command )
38 4667 : , _impl( new detail::EventICommand )
39 : {
40 4667 : _init();
41 4667 : }
42 :
43 81 : EventICommand::EventICommand( const EventICommand& rhs )
44 : : co::ObjectICommand( rhs )
45 81 : , _impl( new detail::EventICommand )
46 : {
47 81 : _init();
48 81 : }
49 :
50 9496 : EventICommand::~EventICommand()
51 : {
52 4748 : delete _impl;
53 4748 : }
54 :
55 4748 : void EventICommand::_init()
56 : {
57 4748 : if( isValid( ))
58 145 : *this >> _impl->eventType;
59 4748 : }
60 :
61 23 : uint32_t EventICommand::getEventType() const
62 : {
63 23 : return _impl->eventType;
64 : }
65 :
66 0 : std::ostream& operator << ( std::ostream& os, const EventICommand& event )
67 : {
68 0 : os << "Event command, event type " << Event::Type( event.getEventType( ));
69 0 : return os;
70 : }
71 :
72 36 : }
|