Collage  1.1.2
High-performance C++ library for developing object-oriented distributed applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
types.h
1 
2 /* Copyright (c) 2006-2014, Stefan Eilemann <eile@equalizergraphics.com>
3  * 2011-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_TYPES_H
22 #define CO_TYPES_H
23 
24 #include <co/defines.h>
25 #include <lunchbox/refPtr.h>
26 #include <lunchbox/types.h>
27 
28 #include <deque>
29 #include <vector>
30 
31 namespace co
32 {
33 
34 #define CO_SEPARATOR '#'
35 
36 #define CO_INSTANCE_MAX LB_MAX_UINT32
37 #define CO_INSTANCE_NONE 0xfffffffdu
38 #define CO_INSTANCE_INVALID 0xfffffffeu
39 #define CO_INSTANCE_ALL 0xffffffffu
40 
41 class Barrier;
42 class Buffer;
43 class CommandQueue;
44 class Connection;
45 class ConnectionDescription;
46 class ConnectionListener;
47 class CustomICommand;
48 class CustomOCommand;
49 class DataIStream;
50 class DataOStream;
51 class Global;
52 class ICommand;
53 class LocalNode;
54 class Node;
55 class OCommand;
56 class Object;
57 class ObjectICommand;
58 class ObjectDataICommand;
59 class ObjectDataIStream;
60 class ObjectDataOCommand;
61 class ObjectFactory;
62 class ObjectHandler;
63 class ObjectOCommand;
64 class QueueItem;
65 class QueueMaster;
66 class QueueSlave;
67 class Serializable;
68 class Zeroconf;
69 template< class Q > class WorkerThread;
70 struct ObjectVersion;
71 
72 
73 using lunchbox::Array;
74 using lunchbox::Strings;
75 using lunchbox::StringsCIter;
76 using lunchbox::a_ssize_t;
77 using lunchbox::f_bool_t;
78 using lunchbox::uint128_t;
79 #ifdef LUNCHBOX_USE_V1_API
80 using lunchbox::UUID;
81 #endif
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;
159 }
160 #endif // CO_TYPES_H
std::vector< ConnectionPtr > Connections
A vector of ConnectionPtr'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:69
lunchbox::RefPtr< const Node > ConstNodePtr
A reference pointer for const Node pointers.
Definition: types.h:88
ConnectionDescriptions::iterator ConnectionDescriptionsIter
An iterator for a vector of ConnectionDescriptionPtr'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'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's.
Definition: types.h:132
Connections::iterator ConnectionsIter
An iterator for a vector of ConnectionPtr'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's.
Definition: types.h:104
ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter
A const iterator for a vector of ConnectionDescriptionPtr'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'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.