VR-Link API Documentation for DIS
dIffPub.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1992-2010 VT MAK
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 
10 
11 #ifndef dIffPub_H_
12 #define dIffPub_H_
13 
14 #if DtDIS
15 
16 
17 #include "dObjPub.h"
18 #include "hostStructs.h"
19 #include "iffSR.h"
20 #include "dIffEnc.h"
21 #include "dIffDec.h"
22 
23 
25 
26 #ifdef __GNUC__
27 #define DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG 1
28 #endif
29 
30 #if DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG
31 
32 
33 static inline const DtObjectId& iffFindOwnId();
34 #else
35 #define iffFindOwnId() DtIffPublisher::findOwnId()
36 #endif
37 
42 {
43 
44 public:
45 
47  typedef DtIffStateRepository* (*DtStateRepCreator)();
48 
49 public:
50 
53  DtIffStateRepository *stateRepToUse,
54  DtExerciseConn* conn,
55  const DtObjectId& id = iffFindOwnId());
56 
60  DtExerciseConn* conn,
61  const DtObjectId& id = iffFindOwnId());
62 
65  DtExerciseConn* conn,
66  const DtObjectId& id = iffFindOwnId());
67 
70  DtExerciseConn* conn,
71  const char* name,
72  const DtObjectId& id = iffFindOwnId());
73 
75  virtual ~DtIffPublisher();
76 
77 
79  virtual void tick();
80 
83  virtual void forceUpdate();
84 
86  virtual DtIffStateRepository* iffStateRep();
87  virtual DtIffStateRepository* isr();
88 
90  virtual const DtObjectId& id() const;
91 
93  virtual const DtObjectId& localId() const;
94 
96  virtual const DtGlobalObjectDesignator& globalId() const;
97 
98 public:
99 
101  static void setStateRepCreator(DtStateRepCreator creator);
102  static DtStateRepCreator stateRepCreator(void);
103 
104  static void setClassDfltTimeThreshold(DtTime threshold);
105 
107  static const DtObjectId& findOwnId();
108 
109 protected:
110 
112  void init(const char* name,
113  const DtEntityIdentifier& id);
114 
116  DtIffPublisher(const DtIffPublisher& orig);
117 
120 protected:
121 
125 
126 protected:
127  static DtStateRepCreator theStateRepCreator;
130  char *myName;
131 };
132 
134 {
135  return static_cast<DtIffStateRepository*>(myStateRep);
136 }
137 
138 inline const DtObjectId& DtIffPublisher::localId() const
139 {
140  return id();
141 }
142 
143 #if DT_CANT_USE_STATIC_MEMBER_FCN_AS_DFLT_ARG
144 inline const DtObjectId& iffFindOwnId()
145 {
146  return DtIffPublisher::findOwnId();
147 }
148 #else
149 #undef iffFindOwnId
150 #endif
151 
152 
153 #endif
154 #endif
155 

Document ID: Generated on Wed Aug 14 15:35:11 EDT 2013 from SVN revision 130445
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)