VR-Link API Documentation for HLA 1516
eventId.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00005 
00006 
00007 #ifndef _eventId_H_
00008 #define _eventId_H_
00009 
00010 
00011 #include <vlutil/vlString.h>
00012 #include <vlpi/simulationAddress.h>
00013 
00016 
00017 class DT_DLL_VL DtEventId;
00018 
00020 typedef DtEventId DtEventID;
00021 
00022 
00023 #if DtHLA
00024 #include "globalObjDes.h"
00025 
00026 class DT_DLL_VL DtNetEventId
00027 {
00028 public:
00029    DtNetEventId():eventNum(0){}
00030 
00031    DtNetU16 eventNum;
00032 
00033 protected:
00034 
00039    DtNetEventId(const DtNetEventId& orig);
00040    DtNetEventId& operator=(const DtNetEventId& orig);
00041 };
00042 
00043 
00049 class DT_DLL_VL DtEventId
00050 {
00051 public:
00055    DtEventId(const char* str);
00056 
00058    DtEventId(const DtGlobalObjectDesignator& des, int eventNum);
00059 
00061    DtEventId(const DtNetEventId& netId);
00062 
00064    DtEventId(const DtEventId& netId);
00065 
00067    DtEventId& operator=(const DtEventId& orig);
00068 
00070    DtEventId();
00071 
00073    ~DtEventId();
00074 
00076    void setFromNet(const DtNetEventId& netId);
00077 
00079    DtNetEventId* netRep() const;
00081    int netSize() const;
00082    
00084    int operator==(const DtEventId &otherGuy) const;
00085    int operator!=(const DtEventId &otherGuy) const;
00086 
00088    void setEventNum(int eventNum);
00090    int eventNum() const;
00091 
00093    const DtGlobalObjectDesignator& objectId() const;
00095    void setObjectId(const DtGlobalObjectDesignator& name);
00096 
00098    const DtGlobalObjectDesignator& globalId() const;
00100    void setGlobalId(const DtGlobalObjectDesignator& name);
00101 
00103    const char* string() const;
00104 
00105 public:
00106 
00108    static const DtEventId& nullId();
00109 
00110 protected:
00111 
00113    void init(const DtGlobalObjectDesignator& des, int eventNum);
00114 
00115 protected:
00116 
00117    DtString myObjName;
00118    int myEventNum;
00119    DtNetEventId* myNetRep;
00120    DtString myStringRep;
00121 };
00122 
00123 #elif (DtDIS || DtTENA)
00124 
00125 
00126 class DT_DLL_VL DtNetEventId
00127 {
00128 public:
00129    DtNetSimulationAddress    DtSimulator;
00130    DtNetU16                  DtEvent;
00131 
00132    DtEventId operator=(const DtEventId &);
00133    DtNetEventId &operator=(const DtNetEventId &);
00134 };
00135 
00143 class DT_DLL_VL DtEventId
00144 {
00145   public:
00148    DtEventId(const char* str);
00149 
00151    DtEventId(int site, int host, int eventNum);
00152 
00154    DtEventId(DtNetEventId netId);
00155 
00157    DtEventId();
00158 
00160    ~DtEventId();
00161 
00163    void init(int site, int host, int eventNum);
00164 
00166    void setFromNet(DtNetEventId netId);
00167    operator DtNetEventId () const;
00168       
00170    int site() const;
00172    void setSite(int site);
00173 
00175    int host() const;
00177    void setHost(int host);
00178 
00180    int eventNum() const;
00182    void setEventNum(int eventNum);
00183 
00185    const char* string() const;
00186 
00187    int operator==(const DtEventId &otherGuy) const;
00188    int operator!=(const DtEventId &otherGuy) const;
00189 
00191    static const DtEventId& nullId();
00192 
00193 public:
00194 
00196    DtSimulationAddress DtSimulator;
00197 
00199    DtU16 DtEvent;
00200 
00202    DtString myStringRep;
00203 };
00204 
00205 #else
00206 #error "Please Choose Protocol!"
00207 #endif
00208 
00209 DT_DLL_VL std::ostream& operator<< (std::ostream& stream, const DtEventId& event);
00210 
00211 #endif
00212 

Document ID: Generated on Mon May 14 08:06:18 EDT 2012 from SVN revision 114750
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)