VR-Exchange 2.4 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) 2014 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 ) const;
102  virtual void readSelfFromBuffer( const void* buffer );
103 
104  virtual std::ostream& printDataToStream( std::ostream& stream ) const;
105 
106  };
107 
108 
110  {
111  return new DtStatisticsReportMessage();
112  }
113 
114 }

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)