2
* Copyright 2011, Blender Foundation.
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software Foundation,
16
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23
#ifndef _COM_OutputSocket_h
24
#define _COM_OutputSocket_h
27
#include "COM_Socket.h"
28
#include "COM_ChannelInfo.h"
31
class SocketConnection;
34
class WriteBufferOperation;
36
//#define COM_ST_INPUT 0
37
//#define COM_ST_OUTPUT 1
40
* @brief OutputSocket are sockets that can send data/input
43
class OutputSocket : public Socket {
45
vector<SocketConnection *> m_connections;
47
void removeFirstConnection();
49
OutputSocket(DataType datatype);
50
OutputSocket(DataType datatype, int inputSocketDataTypeDeterminatorIndex);
51
OutputSocket(OutputSocket *from);
52
void addConnection(SocketConnection *connection);
53
void removeConnection(SocketConnection *connection);
54
SocketConnection *getConnection(unsigned int index) { return this->m_connections[index]; }
55
const int isConnected() const;
56
int isOutputSocket() const;
59
* @brief determine the resolution of this socket
60
* @param resolution the result of this operation
61
* @param preferredResolution the preferable resolution as no resolution could be determined
63
void determineResolution(unsigned int resolution[2], unsigned int preferredResolution[2]);
66
* @brief determine the actual data type and channel info.
68
void relinkConnections(OutputSocket *relinkToSocket) { this->relinkConnections(relinkToSocket, false); }
69
void relinkConnections(OutputSocket *relinkToSocket, bool single);
70
const int getNumberOfConnections() { return this->m_connections.size(); }
72
void clearConnections();
75
* @brief find a connected write buffer operation to this OutputSocket
76
* @return WriteBufferOperation or NULL
78
WriteBufferOperation *findAttachedWriteBufferOperation() const;
79
ChannelInfo *getChannelInfo(const int channelnumber);