WebLVC 1.7d API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
statisticsReportMessage.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2016 VT MAK
3  * All rights reserved.
4  ****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <portal/dllExport.h>
13 #include <portal/pControlMessage.h>
14 #include <broker/frameTimer.h>
15 
16 namespace MAKVrExchange
17 {
18 
22  : public DtPortalControlMessageTemplate<DtStatisticsReportMessageKind>
23  {
24  public:
25 
28 
30  typedef void (*StatisticsReportMessageCallbackType) (
31  const DtStatisticsReportMessage& message, void* userData );
32 
36  {
38  StatisticsField( const DtString& name, double val,
39  const DtString& unitStr = "", const DtString& descStr = "" )
40  : displayName( name )
41  , description( descStr )
42  , units( unitStr )
43  , value( val )
44  {
45  }
46 
49  bool operator < ( const StatisticsField& other ) const
50  {
51  return ( displayName < other.displayName );
52  }
53 
57  double value;
58 
59  };
60 
62  typedef std::vector<StatisticsField> FieldEntryVector;
63 
64  // CTOR.
66 
67  // Copy CTOR.
69 
70  // Virtual DTOR.
71  virtual ~DtStatisticsReportMessage();
72 
73  // Assignment operator.
75 
76  // Add the given callback to be called when message is sent.
77  static void addCallback( DtPortalConnection* connection,
78  StatisticsReportMessageCallbackType callbackFunction, void* userData );
79 
80  // Remove the given callback so it's not called when message is sent.
81  static void removeCallback( DtPortalConnection* connection,
82  StatisticsReportMessageCallbackType callbackFunction, void* userData );
83 
86 
88  DtDEC_ATTRIBUTE( FieldEntryVector, FieldEntries, fieldEntries );
89 
91  DtDEC_ATTRIBUTE( DtTime, ReportingInterval, reportingInterval );
92 
94 
96  public:
97 
98  static DtPortalMessage* create();
99 
100  virtual unsigned int netSize() const;
101  virtual void writeSelfToBuffer( void* buffer, int bufferSize ) const;
102  virtual void readSelfFromBuffer( const void* buffer, int bufferSize );
103 
104  virtual std::ostream& printDataToStream( std::ostream& stream ) const;
105 
106  };
107 
108 
110  {
111  return new DtStatisticsReportMessage();
112  }
113 
114 }
Contains the DtPortalControlMessage class declarations.
#define DT_DLL_LIBPORTAL
Definition: include/portal/dllExport.h:20
#define DtDEC_ATTRIBUTE(T, N, n)
A Macro to define an attribute; as well as make an accessor and mutator for that attribute.
Definition: addAttribute.h:49
DtString description
Definition: statisticsReportMessage.h:55
The base class for all messages passed through the portal.
Definition: pMessage.h:65
DtPortalControlMessageTemplate< DtStatisticsReportMessageKind > BaseClassType
Definition: statisticsReportMessage.h:27
PortalControlMessageTemplate is used to create new DtPortalControlMessage types.
Definition: pControlMessage.h:71
StatisticsField(const DtString &name, double val, const DtString &unitStr="", const DtString &descStr="")
CTOR.
Definition: statisticsReportMessage.h:38
Used by brokers to report timing statistics.
Definition: statisticsReportMessage.h:21
Contains the DtFrameTimer class declaration.
double value
Definition: statisticsReportMessage.h:57
DtString units
Definition: statisticsReportMessage.h:56
Storage for information about a statistics field.
Definition: statisticsReportMessage.h:35
Connects a broker to the Portal Data Exchange.
Definition: pConnection.h:49
DtString displayName
Definition: statisticsReportMessage.h:54
static DtPortalMessage * create()
NOTE: DtDEC_ATTRIBUTE resets the access specifier to protected.
Definition: statisticsReportMessage.h:109
std::vector< StatisticsField > FieldEntryVector
Definition: statisticsReportMessage.h:62

Document ID: Generated on Wed Jun 21 15:05:44 EDT 2023 from SVN revision 256253
Copyright © 2005-2023 MAK Technologies. All Rights Reserved (www.mak.com)