FmsAdaptor.h

Go to the documentation of this file.
00001 /*----------------------------------------------------------------------------+
00002  |       ___     _       _                                                    |
00003  |      /   |   | |     | |                                                   |
00004  |     / /| | __| | ___ | |__   ___                                           |
00005  |    / /_| |/ _  |/ _ \|  _ \ / _ \                                          |
00006  |   / ___  | (_| | (_) | |_) |  __/                                          |
00007  |  /_/   |_|\__,_|\___/|____/ \___|                                          |
00008  |                                                                            |
00009  |                                                                            |
00010  |  ADOBE CONFIDENTIAL                                                        |
00011  |  __________________                                                        |
00012  |                                                                            |
00013  |  Copyright (c) 2003 - 2007, Adobe Systems Incorporated.                    |
00014  |  All rights reserved.                                                      |
00015  |                                                                            |
00016  |  NOTICE:  All information contained herein is, and remains the property    |
00017  |  of Adobe Systems Incorporated and its suppliers, if any. The intellectual |
00018  |  and technical concepts contained herein are proprietary to Adobe Systems  |
00019  |  Incorporated and its suppliers and may be covered by U.S. and Foreign     |
00020  |  Patents, patents in process, and are protected by trade secret or         |
00021  |  copyright law. Dissemination of this information or reproduction of this  |
00022  |  material is strictly forbidden unless prior written permission is         |
00023  |  obtained from Adobe Systems Incorporated.                                 |
00024  |                                                                            |
00025  |          Adobe Systems Incorporated       415.832.2000                     |
00026  |          601 Townsend Street              415.832.2020 fax                 |
00027  |          San Francisco, CA 94103                                           |
00028  |                                                                            |
00029  +----------------------------------------------------------------------------*/
00030
00031 #pragma once
00032 
00060 #if !defined( FMS_ADAPTOR_H )
00061 #define FMS_ADAPTOR_H
00062 
00063 #if defined( WIN32 )
00064 
00065         #if defined(FC_DLL_EXPORT)
00066                 #define FCExport        __declspec(dllexport)
00067         #elif defined(FC_LINK_STATIC)
00068                 #define FCExport
00069         #else
00070                 #define FCExport        __declspec(dllimport)
00071         #endif
00072 
00073         #pragma warning(disable : 4251)
00074         #pragma warning(disable : 4275)
00075 
00076         #ifndef INT64
00077                 #define INT64   __int64
00078         #endif
00079 
00080 #else
00081 
00082         #define FCExport
00083 
00084         #ifndef INT64
00085                 #define INT64   long long
00086         #endif
00087 
00088 #endif
00089 
00090 #ifndef TCTypes_H
00091         typedef unsigned char  U8;
00092         typedef unsigned short U16;
00093         typedef unsigned long  U32;
00094
00095         typedef char  I8;
00096         typedef short I16;
00097         typedef long  I32;
00098         typedef INT64 I64;
00099 #endif
00100 
00101 #define MKWORD(a, b)       ((U16)(((U8)((U32)(a) & 0xff)) | ((U16)((U8)((U32)(b) & 0xff))) << 8))
00102 #define MKLONG(a, b)       ((long)(((U16)((U32)(a) & 0xffff)) | ((U32)((U16)((U32)(b) & 0xffff))) << 16))
00103 #define LWORD(l)           ((U16)((U32)(l) & 0xffff))
00104 #define HWORD(l)           ((U16)((U32)(l) >> 16))
00105 #define LBYTE(w)           ((U8)((U32)(w) & 0xff))
00106 #define HBYTE(w)           ((U8)((U32)(w) >> 8))
00107 
00111 #define TYPE_NORMAL                             0x1             
00112 #define TYPE_GROUP                              0x2             
00113 #define TYPE_GROUP_ELEMENT              0x4             
00114 #define TYPE_SERVICE                    0x8             
00115 #define TYPE_ALL                                0xf             
00116 
00117 
00120 #define ENCODE_AMF0                             0               
00121 #define ENCODE_AMF3                             3               
00122 
00123 
00132 struct FCExport FmsVariant
00133 {
00137         enum Type {
00138                 kU8,
00139                 kU16,
00140                 kU32,
00141                 kI8,
00142                 kI16,
00143                 kI32,
00144                 kI64,
00145                 kFloat,
00146                 kDouble,
00147                 kString,
00148                 kBuffer
00149         };
00150
00151         Type type;
00152
00156         union
00157         {
00161                 U8 u8;
00162
00165                 U16 u16;
00166
00169                 U32 u32;
00170
00173                 I8 i8;
00174
00177                 I16 i16;
00178
00181                 I32 i32;
00182
00185                 I64 i64;
00186
00189                 float f;
00190
00193                 double d;
00194
00198                 I8* str;
00199
00203                 struct {
00207                         U8* buf;
00208
00211                         U32 size;
00212                 };
00213         };
00214
00215         // Convenient setter functions
00216
00218         void setU8( U8 val )                    { type = kU8;           u8 = val; }
00219
00221         void setU16( U16 val )                  { type = kU16;          u16 = val; }
00222
00224         void setU32( U32 val )                  { type = kU32;          u32 = val; }
00225
00227         void setI8( I8 val )                    { type = kI8;           i8 = val; }
00228
00230         void setI16( I16 val )                  { type = kI16;          i16 = val; }
00231
00233         void setI32( I32 val )                  { type = kI32;          i32 = val; }
00234
00236         void setI64( I64 val )                  { type = kI64;          i64 = val; }
00237
00239         void setFloat( float val )              { type = kFloat;        f = val; }
00240
00242         void setDouble( double val )    { type = kDouble;       d = val; }
00243
00245         void setString( I8* val )               { type = kString;       str = val; }
00246
00248         void setBuffer( U8* b, U32 sz ) { type = kBuffer;       buf = b; size = sz; }
00249 };
00250
00251
00259 class FCExport IFmsServerContext
00260 {
00261         public:
00265                 enum MessageType
00266                 {
00267                         kError,
00268                         kWarning,
00269                         kInformation,
00270                 };
00271
00278                 virtual U32 getVersion() = 0;
00279
00305                 virtual int getConfig(
00306                         const char* pstrKey,
00307                         char** pstrVal,
00308                         int iBufSize ) = 0;
00309
00323                 virtual void log(
00324                         const char* pstrMsg,
00325                         U16 suType,
00326                         bool boolToEventLog = false ) = 0;
00327
00328
00334                 virtual ~IFmsServerContext()  {}
00335 };
00336
00337 #endif 
00338 
00339 
FMS Adaptors Footer

 

©2007 Adobe Systems Incorporated.  All Rights Reserved.