Collage  1.6.0
High-performance C++ library for developing object-oriented distributed applications.
types.h
1 
2 /* Copyright (c) 2006-2016, Stefan Eilemann <eile@equalizergraphics.com>
3  * 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_TYPES_H
22 #define CO_TYPES_H
23 
24 #include <co/defines.h>
25 #include <lunchbox/refPtr.h>
26 #include <lunchbox/types.h>
27 #include <pression/data/types.h>
28 #include <servus/types.h>
29 
30 #include <deque>
31 #include <memory>
32 #include <vector>
33 
34 namespace co
35 {
36 
37 #define CO_SEPARATOR '#'
38 
39 #define CO_INSTANCE_MAX LB_MAX_UINT32
40 #define CO_INSTANCE_NONE 0xfffffffdu
41 #define CO_INSTANCE_INVALID 0xfffffffeu
42 #define CO_INSTANCE_ALL 0xffffffffu
43 
44 class Barrier;
45 class Buffer;
46 class CommandQueue;
47 class Connection;
48 class ConnectionDescription;
49 class ConnectionListener;
50 class CustomICommand;
51 class CustomOCommand;
52 class DataIStream;
53 class DataOStream;
54 class Global;
55 class ICommand;
56 class LocalNode;
57 class Node;
58 class OCommand;
59 class Object;
60 class ObjectICommand;
61 class ObjectDataICommand;
62 class ObjectDataIStream;
63 class ObjectDataOCommand;
64 class ObjectFactory;
65 class ObjectHandler;
66 class ObjectOCommand;
67 class QueueItem;
68 class QueueMaster;
69 class QueueSlave;
70 class Serializable;
71 class Zeroconf;
72 template< class Q > class WorkerThread;
73 struct ObjectVersion;
74 
75 
76 using lunchbox::Array;
77 using lunchbox::Strings;
78 using lunchbox::StringsCIter;
79 using lunchbox::a_ssize_t;
80 using lunchbox::f_bool_t;
81 using servus::uint128_t;
82 
83 typedef uint128_t NodeID;
84 
86 typedef lunchbox::RefPtr< Node > NodePtr;
88 typedef lunchbox::RefPtr< const Node > ConstNodePtr;
90 typedef lunchbox::RefPtr< LocalNode > LocalNodePtr;
92 typedef lunchbox::RefPtr< const LocalNode > ConstLocalNodePtr;
94 typedef lunchbox::RefPtr< Connection > ConnectionPtr;
96 typedef lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr;
98 typedef lunchbox::RefPtr< const ConnectionDescription >
101 typedef std::vector< ConnectionListener* > ConnectionListeners;
102 
104 typedef std::vector< NodePtr > Nodes;
106 typedef Nodes::iterator NodesIter;
108 typedef Nodes::const_iterator NodesCIter;
109 
111 typedef std::vector< NodeID > NodeIDs;
112 
114 typedef std::vector< Object* > Objects;
116 typedef Objects::iterator ObjectsIter;
118 typedef Objects::const_iterator ObjectsCIter;
119 
120 typedef std::vector< Barrier* > Barriers;
121 typedef Barriers::iterator BarriersIter;
122 typedef Barriers::const_iterator BarriersCIter;
123 
125 typedef std::vector< ConnectionPtr > Connections;
127 typedef Connections::const_iterator ConnectionsCIter;
129 typedef Connections::iterator ConnectionsIter;
130 
132 typedef std::vector< ConnectionDescriptionPtr > ConnectionDescriptions;
134 typedef ConnectionDescriptions::iterator ConnectionDescriptionsIter;
136 typedef ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter;
137 
139 typedef std::vector< ICommand > ICommands;
141 typedef ICommands::iterator ICommandsIter;
143 typedef ICommands::const_iterator ICommandsCIter;
144 
146 class BufferListener;
147 class MasterCMCommand;
148 class SendToken;
149 
150 typedef lunchbox::RefPtr< Buffer > BufferPtr;
151 typedef lunchbox::RefPtr< const Buffer > ConstBufferPtr;
152 
153 typedef std::vector< ObjectVersion > ObjectVersions;
154 typedef ObjectVersions::const_iterator ObjectVersionsCIter;
155 typedef std::deque< ObjectDataIStream* > ObjectDataIStreamDeque;
156 typedef std::vector< ObjectDataIStream* > ObjectDataIStreams;
157 
158 typedef std::unique_ptr< pression::data::Compressor > CompressorPtr;
159 using pression::data::CompressorInfo;
162 }
163 #endif // CO_TYPES_H
std::vector< ConnectionPtr > Connections
A vector of ConnectionPtr&#39;s.
Definition: types.h:125
lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr
A reference pointer for ConnectionDescription pointers.
Definition: types.h:96
Nodes::const_iterator NodesCIter
A const iterator for a vector of nodes.
Definition: types.h:108
uint128_t NodeID
A unique identifier for nodes.
Definition: types.h:83
ICommands::const_iterator ICommandsCIter
A const iterator for a vector of input commands.
Definition: types.h:143
std::vector< ICommand > ICommands
A vector of input commands.
Definition: types.h:139
lunchbox::RefPtr< LocalNode > LocalNodePtr
A reference pointer for LocalNode pointers.
Definition: types.h:90
A helper struct bundling an object identifier and version.
Definition: objectVersion.h:47
ICommands::iterator ICommandsIter
A iterator for a vector of input commands.
Definition: types.h:141
std::vector< Barrier * > Barriers
A vector of barriers.
Definition: types.h:120
std::vector< ConnectionListener * > ConnectionListeners
A vector of ConnectionListener.
Definition: types.h:101
Objects::iterator ObjectsIter
A iterator for a vector of objects.
Definition: types.h:116
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:86
lunchbox::RefPtr< const LocalNode > ConstLocalNodePtr
A reference pointer for const LocalNode pointers.
Definition: types.h:92
A worker thread processing items out of a CommandQueue.
Definition: types.h:72
Object-oriented network library.
Definition: barrier.h:27
lunchbox::RefPtr< const Node > ConstNodePtr
A reference pointer for const Node pointers.
Definition: types.h:88
Includes compile-time defines of Collage.
ConnectionDescriptions::iterator ConnectionDescriptionsIter
An iterator for a vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:134
std::vector< Object * > Objects
A vector of objects.
Definition: types.h:114
std::vector< NodeID > NodeIDs
A vector of NodeID&#39;s.
Definition: types.h:111
Objects::const_iterator ObjectsCIter
A const iterator for a vector of objects.
Definition: types.h:118
std::vector< ConnectionDescriptionPtr > ConnectionDescriptions
A vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:132
Connections::iterator ConnectionsIter
An iterator for a vector of ConnectionPtr&#39;s.
Definition: types.h:129
Barriers::iterator BarriersIter
Barriers iterator.
Definition: types.h:121
Nodes::iterator NodesIter
An iterator for a vector of nodes.
Definition: types.h:106
std::vector< NodePtr > Nodes
A vector of NodePtr&#39;s.
Definition: types.h:104
ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter
A const iterator for a vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:136
Barriers::const_iterator BarriersCIter
Barriers const iterator.
Definition: types.h:122
Connections::const_iterator ConnectionsCIter
A const iterator for a vector of ConnectionPtr&#39;s.
Definition: types.h:127
lunchbox::RefPtr< const ConnectionDescription > ConstConnectionDescriptionPtr
A reference pointer for const ConnectionDescription pointers.
Definition: types.h:99
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.
Definition: types.h:94
A listener interface to buffer state changes.