Collage  1.7.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 #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>
73 struct ObjectVersion;
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;
156 
157 typedef std::unique_ptr<pression::data::Compressor> CompressorPtr;
158 using pression::data::CompressorInfo;
160 }
161 #endif // CO_TYPES_H
std::vector< ConnectionDescriptionPtr > ConnectionDescriptions
A vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:131
std::vector< ConnectionListener * > ConnectionListeners
A vector of ConnectionListener.
Definition: types.h:100
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
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:46
ICommands::iterator ICommandsIter
A iterator for a vector of input commands.
Definition: types.h:140
Objects::iterator ObjectsIter
A iterator for a vector of objects.
Definition: types.h:115
A worker thread processing items out of a CommandQueue.
Definition: types.h:72
Object-oriented network library.
Definition: barrier.h:27
Includes compile-time defines of Collage.
ConnectionDescriptions::iterator ConnectionDescriptionsIter
An iterator for a vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:133
lunchbox::RefPtr< const LocalNode > ConstLocalNodePtr
A reference pointer for const LocalNode pointers.
Definition: types.h:91
std::vector< NodePtr > Nodes
A vector of NodePtr&#39;s.
Definition: types.h:103
lunchbox::RefPtr< const ConnectionDescription > ConstConnectionDescriptionPtr
A reference pointer for const ConnectionDescription pointers.
Definition: types.h:98
std::vector< NodeID > NodeIDs
A vector of NodeID&#39;s.
Definition: types.h:110
std::vector< Barrier * > Barriers
A vector of barriers.
Definition: types.h:119
Objects::const_iterator ObjectsCIter
A const iterator for a vector of objects.
Definition: types.h:117
std::vector< Object * > Objects
A vector of objects.
Definition: types.h:113
Connections::iterator ConnectionsIter
An iterator for a vector of ConnectionPtr&#39;s.
Definition: types.h:128
lunchbox::RefPtr< const Node > ConstNodePtr
A reference pointer for const Node pointers.
Definition: types.h:87
lunchbox::RefPtr< ConnectionDescription > ConnectionDescriptionPtr
A reference pointer for ConnectionDescription pointers.
Definition: types.h:95
lunchbox::RefPtr< Connection > ConnectionPtr
A reference pointer for Connection pointers.
Definition: types.h:93
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< ConnectionPtr > Connections
A vector of ConnectionPtr&#39;s.
Definition: types.h:124
ConnectionDescriptions::const_iterator ConnectionDescriptionsCIter
A const iterator for a vector of ConnectionDescriptionPtr&#39;s.
Definition: types.h:135
Barriers::const_iterator BarriersCIter
Barriers const iterator.
Definition: types.h:121
lunchbox::RefPtr< Node > NodePtr
A reference pointer for Node pointers.
Definition: types.h:85
std::vector< ICommand > ICommands
A vector of input commands.
Definition: types.h:138
Connections::const_iterator ConnectionsCIter
A const iterator for a vector of ConnectionPtr&#39;s.
Definition: types.h:126
A listener interface to buffer state changes.