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