Collage  1.0.1
Object-Oriented C++ Network Library
objectICommand.h
1 
2 /* Copyright (c) 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
3  * 2012-2013, 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 #ifndef CO_OBJECTICOMMAND_H
22 #define CO_OBJECTICOMMAND_H
23 
24 #include <co/iCommand.h> // base class
25 
26 namespace co
27 {
28 enum ObjectCommands
29 {
30  CMD_OBJECT_INSTANCE,
31  CMD_OBJECT_DELTA,
32  CMD_OBJECT_SLAVE_DELTA,
33  CMD_OBJECT_MAX_VERSION
34  // check that not more then CMD_OBJECT_CUSTOM have been defined!
35 };
36 
37 namespace detail { class ObjectICommand; }
38 
40 class ObjectICommand : public ICommand
41 {
42 public:
44  CO_API ObjectICommand( LocalNodePtr local, NodePtr remote,
45  ConstBufferPtr buffer, const bool swap );
46 
48  CO_API ObjectICommand( const ICommand& command );
49 
51  CO_API ObjectICommand( const ObjectICommand& rhs );
52 
54  CO_API virtual ~ObjectICommand();
55 
57  const UUID& getObjectID() const;
58 
60  uint32_t getInstanceID() const;
61 
62 private:
63  ObjectICommand();
64  ObjectICommand& operator = ( const ObjectICommand& );
65  detail::ObjectICommand* const _impl;
66 
67  void _init();
68 };
69 
71 CO_API std::ostream& operator << ( std::ostream& os, const ObjectICommand& );
72 }
73 
74 #endif //CO_OBJECTICOMMAND_H
A class managing received commands.
Definition: iCommand.h:43
lunchbox::RefPtr< LocalNode > LocalNodePtr
A reference pointer for LocalNode pointers.
Definition: types.h:84
static void swap(T &v)
Byte-swap a plain data item.
Definition: dataIStream.h:94
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:80
virtual CO_API ~ObjectICommand()
Destruct an object command.
An input command specialization for objects.