00001
00057 #if !defined(_CIGI_SESSION_INCLUDED_)
00058 #define _CIGI_SESSION_INCLUDED_
00059
00060 #include "CigiOutgoingMsg.h"
00061 #include "CigiIncomingMsg.h"
00062 #include "CigiAnimationTable.h"
00063
00064
00065
00066
00069 class CIGI_SPEC CigiSession
00070 {
00071 public:
00072
00073
00076 enum SessionTypeEnum
00077 {
00078 Host,
00079 IG
00080 };
00081
00082
00083
00084
00087 virtual ~CigiSession();
00088
00089
00090
00091
00092
00093
00094
00095
00096
00105 int SetCigiVersion(const int CigiVersionIn, bool bndchk=true)
00106 {
00107 return( SetCigiVersion(CigiVersionIn, 0, bndchk));
00108 }
00109
00110
00121 int SetCigiVersion(const int CigiVersionIn,
00122 const int CigiMinorVersionIn,
00123 bool bndchk=true)
00124 {
00125 CigiVersionID tCigiVer;
00126 tCigiVer.CigiMajorVersion = CigiVersionIn;
00127 tCigiVer.CigiMinorVersion = CigiMinorVersionIn;
00128 return(OutMsg.SetOutgoingCigiVersion(tCigiVer,bndchk));
00129 }
00130
00131
00142 int SetCigiVersion(CigiVersionID CigiVersionIn,
00143 bool bndchk=true)
00144 {
00145 return(OutMsg.SetOutgoingCigiVersion(CigiVersionIn,bndchk));
00146 }
00147
00148
00150
00157 void SetMostMatureReceivedCigiVersion(CigiVersionID &Version)
00158 {
00159 OutMsg.SetMostMatureReceivedCigiVersion(Version);
00160 }
00161
00162
00163
00167 CigiVersionID GetCompleteCigiVersion(void)
00168 {
00169 return(OutMsg.GetOutgoingCigiVersion());
00170 }
00171
00172
00173
00177 int GetCigiVersion(void)
00178 {
00179 return(OutMsg.GetOutgoingCigiVersion().CigiMajorVersion);
00180 }
00181
00182
00183
00187 int GetCigiMinorVersion(void)
00188 {
00189 return(OutMsg.GetOutgoingCigiVersion().CigiMinorVersion);
00190 }
00191
00192
00193
00194
00195
00199 CigiOutgoingMsg & GetOutgoingMsgMgr(void) { return(OutMsg); }
00200
00201
00205 CigiIncomingMsg & GetIncomingMsgMgr(void) { return(InMsg); }
00206
00207
00211 CigiAnimationTable & GetAnimationTableMgr(void) { return(ATbl); }
00212
00213
00214
00215
00216
00222 void SetSynchronous(bool Sync) { Synchronous = Sync; }
00223
00224
00230 bool IsSynchronous(void) { return(Synchronous); }
00231
00232
00233
00234
00235
00249 int RegisterUserPacket(CigiBasePacket *Packet,
00250 Cigi_uint8 PacketID,
00251 bool HostSend, bool IGSend)
00252 {
00253 int outMsgStatus = OutMsg.RegisterUserPacket(Packet,PacketID,HostSend,IGSend);
00254 int inMsgStatus = InMsg.RegisterUserPacket(Packet,PacketID,HostSend,IGSend);
00255 if( outMsgStatus == CIGI_SUCCESS && inMsgStatus == CIGI_SUCCESS )
00256 return CIGI_SUCCESS;
00257 else if( outMsgStatus == CIGI_SUCCESS )
00258 return inMsgStatus;
00259 else
00260 return outMsgStatus;
00261 }
00262
00263
00264
00265
00266
00271 bool IsHost(void)
00272 {
00273 return((SessionType == Host) ? true : false);
00274 }
00275
00276
00281 bool IsIG(void)
00282 {
00283 return((SessionType == IG) ? true : false);
00284 }
00285
00286
00287
00288 protected:
00289
00290
00291
00292
00295 CigiOutgoingMsg OutMsg;
00296
00297
00300 CigiIncomingMsg InMsg;
00301
00302
00305 CigiAnimationTable ATbl;
00306
00307
00310 SessionTypeEnum SessionType;
00311
00312
00316 bool Synchronous;
00317
00318
00322 const CigiVersionID MostMatureKnownCigi;
00323
00324
00325
00326
00327
00337 CigiSession(const int NumInBuf, const int InBufLen,
00338 const int NumOutBuf, const int OutBufLen,
00339 SessionTypeEnum SessionTypeIn);
00340
00341
00342 };
00343
00344 #endif // !defined(_CIGI_SESSION_INCLUDED_)