Collage  1.2.1
High-performance C++ library for developing object-oriented distributed applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros 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 #include <pression/types.h>
28 
29 #include <deque>
30 #include <vector>
31 
32 namespace co
33 {
34 
35 #define CO_SEPARATOR '#'
36 
37 #define CO_INSTANCE_MAX LB_MAX_UINT32
38 #define CO_INSTANCE_NONE 0xfffffffdu
39 #define CO_INSTANCE_INVALID 0xfffffffeu
40 #define CO_INSTANCE_ALL 0xffffffffu
41 
42 class Barrier;
43 class Buffer;
44 class CommandQueue;
45 class Connection;
46 class ConnectionDescription;
47 class ConnectionListener;
48 class CustomICommand;
49 class CustomOCommand;
50 class DataIStream;
51 class DataOStream;
52 class Global;
53 class ICommand;
54 class LocalNode;
55 class Node;
56 class OCommand;
57 class Object;
58 class ObjectICommand;
59 class ObjectDataICommand;
60 class ObjectDataIStream;
61 class ObjectDataOCommand;
62 class ObjectFactory;
63 class ObjectHandler;
64 class ObjectOCommand;
65 class QueueItem;
66 class QueueMaster;
67 class QueueSlave;
68 class Serializable;
69 class Zeroconf;
70 template< class Q > class WorkerThread;
71 struct ObjectVersion;
72 
73 
74 using lunchbox::Array;
75 using lunchbox::Strings;
76 using lunchbox::StringsCIter;
77 using lunchbox::a_ssize_t;
78 using lunchbox::f_bool_t;
79 using lunchbox::uint128_t;
80 #ifdef LUNCHBOX_USE_V1_API
81 using lunchbox::UUID;
82 #endif
83 
84 typedef uint128_t NodeID;
85 
87 typedef lunchbox::RefPtr< Node > NodePtr;
89 typedef lunchbox::RefPtr< const Node > ConstNodePtr;
91 typedef lunchbox::RefPtr< LocalNode > LocalNodePtr;
93 typedef lunchbox::RefPtr< const LocalNode > ConstLocalNodePtr;
95 typedef lunchbox::RefPtr< Connection > ConnectionPtr;
97 typedef lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr;
99 typedef lunchbox::RefPtr< const ConnectionDescription >
102 typedef std::vector< ConnectionListener* > ConnectionListeners;
103 
105 typedef std::vector< NodePtr > Nodes;
107 typedef Nodes::iterator NodesIter;
109 typedef Nodes::const_iterator NodesCIter;
110 
112 typedef std::vector< NodeID > NodeIDs;
113 
115 typedef std::vector< Object* > Objects;
117 typedef Objects::iterator ObjectsIter;
119 typedef Objects::const_iterator ObjectsCIter;
120 
121 typedef std::vector< Barrier* > Barriers;
122 typedef Barriers::iterator BarriersIter;
123 typedef Barriers::const_iterator BarriersCIter;
124 
126 typedef std::vector< ConnectionPtr > Connections;
128 typedef Connections::const_iterator ConnectionsCIter;
130 typedef Connections::iterator ConnectionsIter;
131 
133 typedef std::vector< ConnectionDescriptionPtr > ConnectionDescriptions;
135 typedef ConnectionDescriptions::iterator ConnectionDescriptionsIter;
137 typedef ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter;
138 
140 typedef std::vector< ICommand > ICommands;
142 typedef ICommands::iterator ICommandsIter;
144 typedef ICommands::const_iterator ICommandsCIter;
145 
147 class BufferListener;
148 class MasterCMCommand;
149 class SendToken;
150 
151 typedef lunchbox::RefPtr< Buffer > BufferPtr;
152 typedef lunchbox::RefPtr< const Buffer > ConstBufferPtr;
153 
154 typedef std::vector< ObjectVersion > ObjectVersions;
155 typedef ObjectVersions::const_iterator ObjectVersionsCIter;
156 typedef std::deque< ObjectDataIStream* > ObjectDataIStreamDeque;
157 typedef std::vector< ObjectDataIStream* > ObjectDataIStreams;
160 }
161 #endif // CO_TYPES_H
std::vector< ConnectionPtr > Connections
A vector of ConnectionPtr's.
Definition: types.h:126
lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr
A reference pointer for ConnectionDescription pointers.
Definition: types.h:97
Nodes::const_iterator NodesCIter
A const iterator for a vector of nodes.
Definition: types.h:109
uint128_t NodeID
A unique identifier for nodes.
Definition: types.h:84
ICommands::const_iterator ICommandsCIter
A const iterator for a vector of input commands.
Definition: types.h:144
std::vector< ICommand > ICommands
A vector of input commands.
Definition: types.h:140
lunchbox::RefPtr< LocalNode > LocalNodePtr
A reference pointer for LocalNode pointers.
Definition: types.h:91
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:142
std::vector< Barrier * > Barriers
A vector of barriers.
Definition: types.h:121
std::vector< ConnectionListener * > ConnectionListeners
A vector of ConnectionListener.
Definition: types.h:102
Objects::iterator ObjectsIter
A iterator for a vector of objects.
Definition: types.h:117
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:87
lunchbox::RefPtr< const LocalNode > ConstLocalNodePtr
A reference pointer for const LocalNode pointers.
Definition: types.h:93
A worker thread processing items out of a CommandQueue.
Definition: types.h:70
lunchbox::RefPtr< const Node > ConstNodePtr
A reference pointer for const Node pointers.
Definition: types.h:89
Includes compile-time defines of Collage.
ConnectionDescriptions::iterator ConnectionDescriptionsIter
An iterator for a vector of ConnectionDescriptionPtr's.
Definition: types.h:135
std::vector< Object * > Objects
A vector of objects.
Definition: types.h:115
std::vector< NodeID > NodeIDs
A vector of NodeID's.
Definition: types.h:112
Objects::const_iterator ObjectsCIter
A const iterator for a vector of objects.
Definition: types.h:119
std::vector< ConnectionDescriptionPtr > ConnectionDescriptions
A vector of ConnectionDescriptionPtr's.
Definition: types.h:133
Connections::iterator ConnectionsIter
An iterator for a vector of ConnectionPtr's.
Definition: types.h:130
Barriers::iterator BarriersIter
Barriers iterator.
Definition: types.h:122
Nodes::iterator NodesIter
An iterator for a vector of nodes.
Definition: types.h:107
std::vector< NodePtr > Nodes
A vector of NodePtr's.
Definition: types.h:105
ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter
A const iterator for a vector of ConnectionDescriptionPtr's.
Definition: types.h:137
Barriers::const_iterator BarriersCIter
Barriers const iterator.
Definition: types.h:123
Connections::const_iterator ConnectionsCIter
A const iterator for a vector of ConnectionPtr's.
Definition: types.h:128
lunchbox::RefPtr< const ConnectionDescription > ConstConnectionDescriptionPtr
A reference pointer for const ConnectionDescription pointers.
Definition: types.h:100
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.
Definition: types.h:95
A listener interface to buffer state changes.