VR-Forces 4.1 Class Documentation
ifaceCont.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: ifaceCont.h,v $ $Revision: 1.10 $ $State: Exp $
7 *******************************************************************************/
8 
9 //
10 // File: ifaceCont.h
11 //
12 // Class: DtSimInterfaceContent
13 //
14 
15 
16 #ifndef DtSimInterfaceContent_H_
17 #define DtSimInterfaceContent_H_
18 
19 #include <vlutil/vlString.h>
21 
22 //
23 // DtSimInterfaceContent is an abstract base class from which real interface
24 // content can be derived. Interface content is the request, response, or other
25 // information provided in an interface message.
26 //
27 // All classes derived from DtSimInterfaceContent must implement a type()
28 // function that returns the type of the interface content as an integer, such as
29 // DtCreate-EntityMessageType or DtPauseControlType.
30 // These are defined in msgTypes.h.
31 // Derived classes must also provide a clone() function that copies their contents.
32 //
33 // Content-Type: Not applicable.
34 //
35 // Parameters: type - The type of interface content, such as "create-entity" or
36 // "pause".
39 
42 {
43 protected:
44  // constructors are protected because no one should instantiate the
45  // base class, just derived versions.
46 
47  // default constructor
49 
50  // copy constructor; nothing to be copied. Here to thwart over-ambitious
51  // compilers that create one when it shouldn't.
53 
54  // assignment operator; same as copy costructor
55  const DtSimInterfaceContent & operator=(const DtSimInterfaceContent & orig);
56 
57 public:
58  virtual ~DtSimInterfaceContent();
59 
60  // Returns the type of Interface Content, such as "create-entity" or "pause".
61  virtual int type() const = 0;
62 
63  virtual DtSimInterfaceContent * clone() const = 0;
64 
65  // Like operator = except it return true if the target data was changed.
66  // Object makes a copy of data and does not take on management, caller is
67  // responsible for deletion.
68  virtual bool update (const DtSimInterfaceContent* data);
69 
70  virtual char* netRep();
71 
72  virtual int netRepSize() const { return 0; }
73 
74  virtual bool setFromNet(const char* contentBuffer,
75  unsigned contentSize)
76  { (void) &contentBuffer; (void) &contentSize;
77  return false; }
78 
79  virtual bool setToNet() { return false; }
80 
81  // Print message data
82  virtual void printDataToString(DtString& str);
83 
84  // Indicate whether the interface content should be
85  // sent with the sender's session ID. If this value
86  // is set to true, only those receivers that have the
87  // same session ID as the sender will read the message.
88  // If the value is set the false, every receiver will
89  // read the message, regardless of their session ID.
90  // Currently, only DtVrfObjectDataType messages set
91  // useSessionId to false.
92 
93  virtual void setUseSessionId(bool yesNo);
94  virtual bool useSessionId() const;
95 
96 public:
97  //
98  // Static functions
99  //
100 
101  static DtSimInterfaceContent* createInterfaceContent(int type);
102 
103  static void addInterfaceContentCreatorFcn(int type,
105 
106  static void setFactory(DtInterfaceContentFactory* factory);
107 
108  static DtInterfaceContentFactory* factory();
109 
110 protected:
111  virtual char* createNetworkBuffer();
112 
113 protected:
114  char* myNetRep;
116 
117 protected:
118 
120 
121 };
122 
123 
124 #endif
125 
126 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)