VR-Forces 4.2 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
examples
interfaceContent
interfaceContentSim
myInterfaceContent.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2004 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
/*******************************************************************************
6
** $RCSfile: myInterfaceContent.h,v $ $Revision: 1.7 $ $State: Exp $
7
*******************************************************************************/
8
9
#ifndef MyInterfaceContent_H_
10
#define MyInterfaceContent_H_
11
12
//VR-Forces includes
13
#include <vrfExtProtocol/ifaceCont.h>
14
#include <vrfExtProtocol/msgTypes.h>
15
16
//VR-Link includes
17
#include <vlutil/vlString.h>
18
#include <vlutil/vlNetTypes.h>
19
20
//Class MyInterfaceContent
21
//This is an example of a DtSimInterfaceContent subclass which can be
22
//used to send a message from one DtVrfMessageInterface to another
23
//which consists of a string and a number.
24
//8 bytes total
25
26
//To prevent conflicts with existing VR-Forces messages, increment custom
27
//messages starting at MIN_USER_INTERFACE_MESSAGE_TYPE as defined in
28
//msgTypes.h.
29
const
int
MyInterfaceContentType
= MIN_USER_INTERFACE_MESSAGE_TYPE + 1;
30
31
class
MyInterfaceContent
:
public
DtSimInterfaceContent
32
{
33
public
:
34
35
//default constructor
36
MyInterfaceContent
();
37
38
//destructor
39
virtual
~MyInterfaceContent
();
40
41
//copy constructor
42
MyInterfaceContent
(
const
MyInterfaceContent
& orig);
43
44
//assignment operator
45
MyInterfaceContent
&
operator=
(
const
MyInterfaceContent
& orig);
46
47
//Returns the type of interface content (MyInterfaceContentType as defined
48
//above).
49
virtual
int
type
()
const
;
50
51
//Calls the copy constructor to create a clone
52
virtual
DtSimInterfaceContent
*
clone
()
const
;
53
54
//Set the message string
55
virtual
const
DtString
&
message
()
const
;
56
57
//Get the message string
58
virtual
void
setMessage
(
const
DtString
& message);
59
60
//Set the number
61
virtual
unsigned
int
number
()
const
;
62
63
//Get the number
64
virtual
void
setNumber
(
unsigned
int
number);
65
66
//See if this is an acknowledgement
67
virtual
bool
ack
()
const
;
68
69
//Set if this is an acknowledgement
70
virtual
void
setAck
(
bool
);
71
72
//Returns the size of the full network representation padded to an 8-byte
73
//boundary.
74
virtual
int
netRepSize
()
const
;
75
76
//Fills in the message from the network buffer
77
virtual
bool
setFromNet
(
const
char
* contentBuffer,
78
unsigned
contentSize);
79
80
//Fills in the network buffer with the message contents
81
virtual
bool
setToNet
();
82
83
//Prints the formatted contents of the message into the given string
84
virtual
void
printDataToString
(
DtString
& str);
85
86
//Static creator function which gets registered with the
87
//DtInterfaceContentFactory
88
static
DtSimInterfaceContent
*
creator
();
89
90
protected
:
91
DtString
myMessage
;
92
DtU32
myNumber
;
93
bool
myAck
;
94
};
95
96
#endif
Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)