VR-Link API Documentation for DIS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
datumMap.h
Go to the documentation of this file.
1 /********************************************************************
2 / Copyright (c) 1997 MaK Technologies, Inc.
3 / All rights reserved.
4 ********************************************************************/
5 /********************************************************************
6 / $RCSfile: datumMap.h,v $ $Revision: 1.1 $ $State: Exp $
7 ********************************************************************/
8 
11 
12 #ifndef DtDatumMap_H_
13 #define DtDatumMap_H_
14 
15 #if DtDIS
16 
17 #include <vlutil/vlConfig.h>
18 #include <stdio.h>
19 
20 #if DT_HAVE_STD_H
21 #include <std.h>
22 #endif
23 
24 #include <vlutil/vlHashlist.h>
25 #include <vlpi/disEnums.h>
26 #include "setDataPdu.h"
27 #include "dataQueryPdu.h"
28 #include "dataPdu.h"
29 
31 {
32  public:
34  virtual void setdata(const DtSetDataPdu &setDataPdu,
35  int fixedOrVar, int index, void *usr) = 0;
36  virtual void getdata(DtDataPdu *dataPdu, int fixedOrVar, int index,
37  void *usr) = 0;
38 };
39 
40 typedef void (*DtGlobalSetFcn)(const DtSetDataPdu &pdu, int fixedOrVar,
41  int index, void *usr);
42 typedef void (*DtGlobalGetFcn)(DtDataPdu *pdu, int fixedOrVar,
43  int index, void *usr);
44 
46 {
47  public:
49  : DtDatumMapEntry(), setFcn(setF), getFcn(getF) {}
50 
51  void setdata(const DtSetDataPdu &setDataPdu,
52  int fixedOrVar, int index, void *usr)
53  {
54  if (setFcn)
55  (*setFcn)(setDataPdu, fixedOrVar, index, usr);
56  }
57 
58  void getdata(DtDataPdu *dataPdu, int fixedOrVar, int index,
59  void *usr)
60  {
61  if (getFcn)
62  (*getFcn)(dataPdu, fixedOrVar, index, usr);
63  }
64  protected:
67 };
68 
70  public:
71  DtDatumMap(void) : list(101) { }
72 
73  void setData(const DtSetDataPdu &data, void *usr);
74 
75  void fillDataPdu(DtDataPdu *dataPdu, void *usr);
76  void initDataPdu(const DtSetDataPdu &setDataPdu, DtDataPdu *dataPdu);
77  void initDataPdu(const DtDataQueryPdu &queryPdu, DtDataPdu *dataPdu);
78  void makeResponseDataPdu(const DtSetDataPdu &setDataPdu,
79  DtDataPdu *dataPdu, void *usr)
80  {
81  initDataPdu(setDataPdu, dataPdu);
82  fillDataPdu(dataPdu, usr);
83  }
84  void makeResponseDataPdu(const DtDataQueryPdu &queryPdu,
85  DtDataPdu *dataPdu, void *usr)
86  {
87  initDataPdu(queryPdu, dataPdu);
88  fillDataPdu(dataPdu, usr);
89  }
90 
91  DtDatumMapEntry *lookup(DtDatumParam id, int verbose=1);
92  void install(DtDatumMapEntry *entry, DtDatumParam id);
93  void remove(DtDatumParam id, int verbose=1);
94  protected:
96 };
97 
98 #endif
99 #endif
100 
101 
102 
103 
104 
105 
106 

Document ID: Generated on Fri Dec 2 02:42:08 EST 2016 from SVN revision 171416
Copyright © 2005-2016 VT MÄK. All Rights Reserved (www.mak.com)