Collage  1.0.1
Object-Oriented C++ Network Library
commands.h
1 
2 /* Copyright (c) 2005-2013, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2012, Daniel Nachbaur <danielnachbaur@gmail.com>
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_COMMANDS_H
22 #define CO_COMMANDS_H
23 
24 #include <lunchbox/bitOperation.h> // byteswap inline impl
25 
26 namespace co
27 {
29  {
32  COMMANDTYPE_CUSTOM = 1<<7, // !< Application-specific command
33  COMMANDTYPE_INVALID = 0xFFFFFFFFu
34  };
35 
36  enum Commands
37  {
39  CMD_NODE_MAXIMUM = 0xFFFFFFu,
41  CMD_INVALID = 0xFFFFFFFFu
42  };
43 
45  static const size_t COMMAND_MINSIZE = 256;
46 
48  static const size_t COMMAND_ALLOCSIZE = 4096; // Bigger than minSize!
49 }
50 
51 namespace lunchbox
52 {
53 template<> inline void byteswap( co::CommandType& value )
54  { byteswap( reinterpret_cast< uint32_t& >( value )); }
55 }
56 
57 #endif // CO_COMMANDS_H
Commands for Node subclasses start here.
Definition: commands.h:38
An Object command.
Definition: commands.h:31
Highest allowed node command (2^24-1)
Definition: commands.h:39
A Node/LocalNode command.
Definition: commands.h:30
CommandType
Definition: commands.h:28
Commands
Definition: commands.h:36
Commands for Object subclasses start here.
Definition: commands.h:40