VR-Link API Documentation for HLA 1516
intClassDesc.h
Go to the documentation of this file.
00001 /*********************************************************************
00002 ** Copyright (c) 1992-2010 VT MAK
00003 ** All rights reserved.
00004 *********************************************************************/
00007 
00008 #ifndef DtInterClassDesc_H_
00009 #define DtInterClassDesc_H_
00010 
00011 #if   DtHLA 
00012 
00013 #include <vlutil/vlMachineTypes.h>
00014 #include "rtiNamespace.h"
00015 #include "region.h"
00016 #include <vlutil/vlString.h>
00017 #include "userTagModifiers.h"
00018 #include <set>
00019 
00020 class DtExerciseConn;
00021 class DtVrlRtiAmbassador;
00022 
00023 
00027 class DT_DLL_VL DtInterClassDesc
00028 {
00029 public:
00030 
00032    DtInterClassDesc(const char* className, 
00033       DtInterClassDesc* base, RTI::InteractionClassHandle handle,
00034       DtExerciseConn* exConn);
00035 
00037    virtual ~DtInterClassDesc();
00038 
00040    virtual void addParam(const char* paramName);
00041 
00043    virtual RTI::InteractionClassHandle handle() const;
00044 
00046    virtual const char* name() const;
00047 
00049    virtual const DtInterClassDesc* baseClass() const;
00050 
00052    virtual DtInterClassDesc* baseClass();
00053 
00056    virtual int isOfClass(RTI::InteractionClassHandle hand) const;
00057 
00059    virtual int numParameters() const;
00060 
00062    virtual RTI::ParameterHandle parameterHandleByName(const char *paramName);
00063 
00065    virtual DtString parameterNameByHandle(const RTI::ParameterHandle& hand);
00066 
00067 #if !DtHLA_1516
00068 
00069    virtual int minParamHandle() const;
00070    virtual int maxParamHandle() const;
00071 #endif
00072 
00075 #if DtHLA_1516
00076    virtual const RTI::ParameterHandleSet& paramHandleSet() const;
00077 #else
00078    virtual const RTI::AttributeHandleSet& paramHandleSet() const;
00079 #endif
00080 
00082 #if DtHLA_1516
00083    virtual const RTI::ParameterHandleSet& ownParamHandles() const;
00084 #else
00085    virtual const RTI::AttributeHandleSet& ownParamHandles() const;
00086 #endif
00087 
00089    virtual void publish();
00090 
00092    virtual void unpublish();
00093 
00095    virtual void subscribe();
00096    
00098    virtual void subscribe(DtDDMRegionSP region);
00099    
00101    virtual void passiveSubscribe();
00102 
00104    virtual void unsubscribe();
00105 
00107    virtual void unsubscribe(DtDDMRegionSP region);
00108 
00110    virtual bool published() const;
00111 
00113    virtual bool subscribed() const;
00114 
00116    virtual DtVrlRtiAmbassador* rtiAmb();
00117 
00120    virtual bool neededByFederation() const;
00121 
00124    virtual bool everPublished() const;
00125 
00128    virtual bool everSubscribed() const;
00129 
00130    virtual void setUserTagModifier(DtInteractionTagModifierSP modifier);
00131    virtual DtInteractionTagModifierSP userTagModifier();
00132 
00133 public:
00134 
00136    static void setMaxParameters(int num);
00137    static int maxParameters();
00138 
00144    static void setSubscriptionTimeDelay(double delay);
00145 
00146 
00147 protected:
00148 
00150    static void startIntersCb(RTI::InteractionClassHandle hand,
00151       void* usr);
00152 
00154    static void stopIntersCb(RTI::InteractionClassHandle hand,
00155       void* usr);
00156 
00158    virtual void processStartInters(RTI::InteractionClassHandle hand);
00159 
00161    virtual void processStopInters(RTI::InteractionClassHandle hand);
00162 
00163 protected:
00164 
00166    DtInterClassDesc(const DtInterClassDesc& orig);
00167 
00169    DtInterClassDesc& operator=(const DtInterClassDesc& orig);
00170 
00171 protected:
00172 
00173    DtString myName;
00174    RTI::InteractionClassHandle myHandle;
00175 #if DtHLA_1516
00176    RTI::ParameterHandleSet* myParams;
00177    RTI::ParameterHandleSet* myOwnParams;
00178 #else
00179    RTI::AttributeHandleSet* myParams;
00180    RTI::AttributeHandleSet* myOwnParams;
00181 #endif
00182    DtInterClassDesc* myBase;
00183    DtExerciseConn* myExConn;
00184    bool myNeededFlag;
00185    bool myPublished;
00186    bool mySubscribed;
00187    bool myEverPublished;
00188    bool myEverSubscribed;
00189    RTI::ParameterHandle myMinParamHand;
00190    RTI::ParameterHandle myMaxParamHand;
00191    int myNumSubscribeRequests;
00192    DtInteractionTagModifierSP myTagModifier;
00193    std::set<DtDDMRegionSP> mySubscribedRegions;
00194 
00195 protected:
00196 
00197    static int theMaxParams;
00198    static double theSubscriptionTimeDelay;
00199 };
00200 
00201 inline RTI::InteractionClassHandle DtInterClassDesc::handle() const
00202 {
00203    return myHandle;
00204 }
00205 
00206 inline int DtInterClassDesc::numParameters() const
00207 {
00208    return myParams->size();
00209 }
00210 #if DtHLA_1516
00211 inline const RTI::ParameterHandleSet& DtInterClassDesc::paramHandleSet() const
00212 #else
00213 inline const RTI::AttributeHandleSet& DtInterClassDesc::paramHandleSet() const
00214 #endif
00215 {
00216    return *myParams;
00217 }
00218 
00219 #if DtHLA_1516
00220 inline const RTI::ParameterHandleSet& DtInterClassDesc::ownParamHandles() const
00221 #else
00222 inline const RTI::AttributeHandleSet& DtInterClassDesc::ownParamHandles() const
00223 #endif
00224 {
00225    return *myOwnParams;
00226 }
00227 
00228 inline int DtInterClassDesc::maxParameters()
00229 {
00230    return theMaxParams;
00231 }
00232 
00233 inline void DtInterClassDesc::setMaxParameters(int num)
00234 {
00235    theMaxParams = num;
00236 }
00237 
00238 inline const char* DtInterClassDesc::name() const
00239 {
00240    return myName.c_str();
00241 }
00242 
00243 inline const DtInterClassDesc* DtInterClassDesc::baseClass() const
00244 {
00245    return myBase;
00246 }
00247 
00248 inline DtInterClassDesc* DtInterClassDesc::baseClass() 
00249 {
00250    return myBase;
00251 }
00252 
00253 inline void DtInterClassDesc::setSubscriptionTimeDelay(double delay)
00254 {
00255    theSubscriptionTimeDelay = delay;
00256 }
00257 
00258 
00259 #endif
00260 #endif
00261 

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)