00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __RIOTYPES_H_
00023 #define __RIOTYPES_H_
00024
00025 #include "RioInterfaceTypes.h"
00026
00027 #ifndef WINDOWS
00028
00029 #include <pthread.h>
00030 #include <string.h>
00031 #include <stdlib.h>
00032 #include <limits.h>
00033 #endif
00034
00035
00036 #ifdef WINDOWS
00037
00038 typedef HANDLE RioThreadId;
00039 #else
00040
00041 typedef pthread_t RioThreadId;
00042 #endif
00043
00044
00045 class RioSessionId
00046 {
00047 public:
00048 int Version;
00049 int Index;
00050
00051 RioSessionId()
00052 {
00053 Version = 0;
00054 Index = 0;
00055 }
00056 };
00057
00058
00059 class RioStreamId
00060 {
00061 public:
00062 int Version;
00063 int Index;
00064
00065 RioStreamId()
00066 {
00067 Version = 0;
00068 Index = 0;
00069 }
00070 };
00071
00072
00073 class RequestId
00074 {
00075 public:
00076 int Version;
00077 int Index;
00078
00079 RequestId()
00080 {
00081 Version = 0;
00082 Index = 0;
00083 }
00084 };
00085
00086
00087 class ObjectHandle
00088 {
00089 public:
00090 int Version;
00091 int Index;
00092
00093 ObjectHandle()
00094 {
00095 Version = 1;
00096
00097 Index = 0;
00098 }
00099 };
00100
00101
00102
00103
00104 const int InvalidObjectHandleVersion = -1;
00105 const int InvalidObjectHandleIndex = -1;
00106
00107
00108
00109 const int InvalidObjectSize = -1;
00110
00111 const RioBlock InvalidObjectBlock=0xFFFFFFFF;
00112
00113
00114 #define STORAGESERVERUDPPORT 33333 // Porta UDP usada pelo Storage Server
00115 #define RIOSERVERUDPPORT 33334 // Porta UDP usada pelo Storage Server
00116
00117
00118
00119 #define DEFAULTVIDEORATE 1741
00120
00121
00122 typedef unsigned int IPNetworkAddress;
00123 typedef unsigned short NetworkPort;
00124
00125 class CommunicationAddress
00126 {
00127 public:
00128 IPNetworkAddress IPaddress;
00129 NetworkPort Port;
00130
00131 CommunicationAddress()
00132 {
00133 IPaddress = 0;
00134 Port = 0;
00135 }
00136 };
00137
00138
00139 typedef unsigned int MessageOperation;
00140 const MessageOperation SocketInvalidOperation = 0;
00141 const MessageOperation SocketConnectionRequest = 1;
00142 const MessageOperation SocketConnectionAccept = 2;
00143 const MessageOperation SocketConnectionReject = 3;
00144 const MessageOperation SocketData = 4;
00145 const MessageOperation SocketDataAck = 5;
00146 const MessageOperation SocketDataError = 6;
00147
00148
00149 typedef int MessageStatus;
00150
00151
00152 typedef unsigned int MessageSize;
00153
00154
00155 class MessageHeader
00156 {
00157 public:
00158 MessageOperation Operation;
00159 RioStreamId Stream;
00160 RequestId Request;
00161 MessageStatus Status;
00162 MessageSize NumberBytes;
00163
00164 MessageHeader()
00165 {
00166 memset( &Operation , 0, sizeof(Operation) );
00167 memset( &Stream , 0, sizeof(Stream) );
00168 memset( &Request , 0, sizeof(Request) );
00169 memset( &Status , 0, sizeof(Status) );
00170 memset( &NumberBytes, 0, sizeof(NumberBytes) );
00171 }
00172 };
00173
00174
00175 typedef enum
00176 {
00177 WRITE = 1,
00178 READ = 2
00179 } RequestOperation;
00180
00181
00182 #endif //__RIOTYPES_H_