CigiSession Class Reference

#include <CigiSession.h>

Inheritance diagram for CigiSession:

CigiHostSession CigiIGSession List of all members.

Public Types

 Host
 IG
enum  SessionTypeEnum { Host, IG }

Public Member Functions

virtual ~CigiSession ()
int SetCigiVersion (const int CigiVersionIn, bool bndchk=true)
int SetCigiVersion (const int CigiVersionIn, const int CigiMinorVersionIn, bool bndchk=true)
int SetCigiVersion (CigiVersionID CigiVersionIn, bool bndchk=true)
void SetMostMatureReceivedCigiVersion (CigiVersionID &Version)
 Sets the complete Cigi Version value of the most mature.
CigiVersionID GetCompleteCigiVersion (void)
int GetCigiVersion (void)
int GetCigiMinorVersion (void)
CigiOutgoingMsgGetOutgoingMsgMgr (void)
CigiIncomingMsgGetIncomingMsgMgr (void)
CigiAnimationTableGetAnimationTableMgr (void)
void SetSynchronous (bool Sync)
bool IsSynchronous (void)
int RegisterUserPacket (CigiBasePacket *Packet, Cigi_uint8 PacketID, bool HostSend, bool IGSend)
bool IsHost (void)
bool IsIG (void)

Protected Member Functions

 CigiSession (const int NumInBuf, const int InBufLen, const int NumOutBuf, const int OutBufLen, SessionTypeEnum SessionTypeIn)

Protected Attributes

CigiOutgoingMsg OutMsg
CigiIncomingMsg InMsg
CigiAnimationTable ATbl
SessionTypeEnum SessionType
bool Synchronous
const CigiVersionID MostMatureKnownCigi

Detailed Description

The base class for the Session

Definition at line 69 of file CigiSession.h.


Member Enumeration Documentation

enum CigiSession::SessionTypeEnum

The enumeration for the Session Type

Enumerator:
Host 
IG 

Definition at line 76 of file CigiSession.h.

00077    {
00078       Host,
00079       IG
00080    };


Constructor & Destructor Documentation

CigiSession::~CigiSession (  )  [virtual]

General Destructor

Definition at line 83 of file CigiSession.cpp.

00084 {
00085 
00086 }

CigiSession::CigiSession ( const int  NumInBuf,
const int  InBufLen,
const int  NumOutBuf,
const int  OutBufLen,
SessionTypeEnum  SessionTypeIn 
) [protected]

Protected Constructor

Parameters:
NumInBuf - The number of incoming message buffers.
InBufLen - The size in bytes of each of the incoming message buffers.
NumOutBuf - The number of outgoing message buffers.
OutBufLen - The size in bytes of each of the outgoing message buffers.
JTblType - The Jump Table type. (Host or IG)

Definition at line 56 of file CigiSession.cpp.

References ATbl, CigiOutgoingMsg::ChangeOutgoingCigiVersion(), CigiMessage::CreateBuffer(), InMsg, MostMatureKnownCigi, OutMsg, CigiMessage::SetAnimationTable(), CigiIncomingMsg::SetReaderVersion(), and CigiMessage::SetSession().

00058                                                         : 
00059    SessionType( SessionTypeIn ),
00060    Synchronous( true ),
00061    MostMatureKnownCigi(3,3)
00062 {
00063 
00064    CigiVersionID InitVersion = MostMatureKnownCigi;
00065    OutMsg.SetSession(this);
00066    OutMsg.ChangeOutgoingCigiVersion(InitVersion);
00067    InMsg.SetSession(this);
00068    InMsg.SetReaderVersion(InitVersion);  // Default version initialization
00069 
00070    OutMsg.CreateBuffer(NumOutBuf, OutBufLen);
00071    InMsg.CreateBuffer(NumInBuf, InBufLen);
00072 
00073    OutMsg.SetAnimationTable(&ATbl);
00074    InMsg.SetAnimationTable(&ATbl);
00075 
00076 }


Member Function Documentation

CigiAnimationTable& CigiSession::GetAnimationTableMgr ( void   )  [inline]

Gets a reference to the Animation Table Manager object

Returns:
a reference to the Animation Table Manager object.

Definition at line 211 of file CigiSession.h.

00211 { return(ATbl); }

int CigiSession::GetCigiMinorVersion ( void   )  [inline]

Gets the Cigi Minor Version of the external interface.

Returns:
the Cigi Minor Version of the external interface.

Definition at line 187 of file CigiSession.h.

00188    {
00189       return(OutMsg.GetOutgoingCigiVersion().CigiMinorVersion);
00190    }

int CigiSession::GetCigiVersion ( void   )  [inline]

Gets the Cigi version of the external interface.

Returns:
the Cigi version of the external interface.

Definition at line 177 of file CigiSession.h.

00178    {
00179       return(OutMsg.GetOutgoingCigiVersion().CigiMajorVersion);
00180    }

CigiVersionID CigiSession::GetCompleteCigiVersion ( void   )  [inline]

Gets the Cigi version of the external interface.

Returns:
the complete Cigi version of the external interface.

Definition at line 167 of file CigiSession.h.

00168    {
00169       return(OutMsg.GetOutgoingCigiVersion());
00170    }

CigiIncomingMsg& CigiSession::GetIncomingMsgMgr ( void   )  [inline]

Gets a reference to the Incoming Message Manager object

Returns:
a reference to the Incoming Message Manager object.

Definition at line 205 of file CigiSession.h.

00205 { return(InMsg); }

CigiOutgoingMsg& CigiSession::GetOutgoingMsgMgr ( void   )  [inline]

Gets a reference to the Outgoing Message Manager object

Returns:
a reference to the Outgoing Message Manager object.

Definition at line 199 of file CigiSession.h.

00199 { return(OutMsg); }

bool CigiSession::IsHost ( void   )  [inline]

Notification as to whether the session is a Host session

Returns:
This returns true if this is a host session

Definition at line 271 of file CigiSession.h.

Referenced by CigiOutgoingMsg::ChangeBufferCigiVersion(), CigiOutgoingMsg::ChangeOutgoingCigiVersion(), CigiIncomingMsg::CheckFirstPacket(), CigiIncomingMsg::GetFirstPacket(), CigiOutgoingMsg::LockMsg(), CigiOutgoingMsg::operator<<(), CigiIncomingMsg::ProcessIncomingMsg(), CigiOutgoingMsg::RegisterUserPacket(), CigiIncomingMsg::RegisterUserPacket(), CigiIncomingMsg::SetReaderVersion(), and CigiOutgoingMsg::UpdateFrameCntr().

00272    {
00273       return((SessionType == Host) ? true : false);
00274    }

bool CigiSession::IsIG ( void   )  [inline]

Notification as to whether the session is a IG session

Returns:
This returns true if this is a IG session

Definition at line 281 of file CigiSession.h.

Referenced by CigiOutgoingMsg::operator<<(), CigiIncomingMsg::ProcessIncomingMsg(), CigiOutgoingMsg::RegisterUserPacket(), and CigiIncomingMsg::RegisterUserPacket().

00282    {
00283       return((SessionType == IG) ? true : false);
00284    }

bool CigiSession::IsSynchronous ( void   )  [inline]

Gets whether the interface is synchronous or asynchronous.

Returns:
Sync - The synchronous flag.
true - interface is synchronous.
false - interface is asynchronous.

Definition at line 230 of file CigiSession.h.

Referenced by CigiOutgoingMsg::IsSynchronous(), and CigiOutgoingMsg::UpdateFrameCntr().

00230 { return(Synchronous); }

int CigiSession::RegisterUserPacket ( CigiBasePacket Packet,
Cigi_uint8  PacketID,
bool  HostSend,
bool  IGSend 
) [inline]

Registers an user defined packet manager

Parameters:
Packet - A pointer to an user defined packet manager object.
PacketID - The packet ID this manager processes.
HostSend - Flag specifying that the host can send this packet.
true - The host can send this packet.
false - The host cannot send this packet.
IGSend - Flag specifying that the IG can send this packet.
true - The IG can send this packet.
false - The IG cannot send this packet.
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 249 of file CigiSession.h.

References CIGI_SUCCESS.

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    }

int CigiSession::SetCigiVersion ( CigiVersionID  CigiVersionIn,
bool  bndchk = true 
) [inline]

Sets the Cigi version of the external interface with bound checking control

Parameters:
CigiVersionIn - The Cigi Version being used.
CigiMinorVersionIn - Sets the Cigi Minor Version of the external interface
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 142 of file CigiSession.h.

00144    {
00145       return(OutMsg.SetOutgoingCigiVersion(CigiVersionIn,bndchk));
00146    }

int CigiSession::SetCigiVersion ( const int  CigiVersionIn,
const int  CigiMinorVersionIn,
bool  bndchk = true 
) [inline]

Sets the Cigi version of the external interface with bound checking control

Parameters:
CigiVersionIn - The Cigi Version being used.
CigiMinorVersionIn - Sets the Cigi Minor Version of the external interface
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 121 of file CigiSession.h.

References CigiVersionID::CigiMajorVersion, and CigiVersionID::CigiMinorVersion.

00124    {
00125       CigiVersionID tCigiVer;
00126       tCigiVer.CigiMajorVersion = CigiVersionIn;
00127       tCigiVer.CigiMinorVersion = CigiMinorVersionIn;
00128       return(OutMsg.SetOutgoingCigiVersion(tCigiVer,bndchk));
00129    }

int CigiSession::SetCigiVersion ( const int  CigiVersionIn,
bool  bndchk = true 
) [inline]

Sets the Cigi version of the external interface with bound checking control

Parameters:
CigiVersionIn - The Cigi Version being used.
bndchk - Enables (true) or disables (false) bounds checking
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 105 of file CigiSession.h.

00106    {
00107       return( SetCigiVersion(CigiVersionIn, 0, bndchk));
00108    }

void CigiSession::SetMostMatureReceivedCigiVersion ( CigiVersionID Version  )  [inline]

Sets the complete Cigi Version value of the most mature.

Parameters:
CigiVersionIn - The most mature Cigi Version of the incoming message interface
Returns:
This returns CIGI_SUCCESS or an error code defined in CigiErrorCodes.h

Definition at line 157 of file CigiSession.h.

Referenced by CigiIncomingMsg::CheckFirstPacket().

00158    {
00159       OutMsg.SetMostMatureReceivedCigiVersion(Version);
00160    }

void CigiSession::SetSynchronous ( bool  Sync  )  [inline]

Specifies whether the interface is synchronous or asynchronous.

Parameters:
Sync - The synchronous flag.
true - interface is synchronous.
false - interface is asynchronous.

Definition at line 222 of file CigiSession.h.

00222 { Synchronous = Sync; }


Member Data Documentation

CigiAnimationTable CigiSession::ATbl [protected]

Animation Table Object

Definition at line 305 of file CigiSession.h.

Referenced by CigiSession(), and CigiMessage::SetAnimationTable().

CigiIncomingMsg CigiSession::InMsg [protected]

Incoming Message Object

Definition at line 300 of file CigiSession.h.

Referenced by CigiSession().

const CigiVersionID CigiSession::MostMatureKnownCigi [protected]

Definition at line 322 of file CigiSession.h.

Referenced by CigiSession().

CigiOutgoingMsg CigiSession::OutMsg [protected]

Outgoing Message Object

Definition at line 295 of file CigiSession.h.

Referenced by CigiSession().

SessionTypeEnum CigiSession::SessionType [protected]

Session Type IG or Host

Definition at line 310 of file CigiSession.h.

bool CigiSession::Synchronous [protected]

A flag specifying whether this session is synchronous or asynchronous.

Definition at line 316 of file CigiSession.h.


The documentation for this class was generated from the following files:
Generated on Wed Apr 29 09:00:10 2009 for CCL by  doxygen 1.4.7