DataDirector API
XplaneProducer.h
Go to the documentation of this file.
1 /*! \file XplaneProducer.h
2  \brief The XplaneProducer class. Produces attributes from XPLANE messages.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2012 The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBLITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef _XPLANE_PRODUCER_H_
42 #define _XPLANE_PRODUCER_H_
43 
44 #include "ChunkProducer.h"
45 
46 namespace disti
47 {
48 
49 #define MAX_XPLANE_DESCRIPTORS 255
50 
51 class DDD_EXPORT XplaneProducer : public ChunkProducer
52 {
53  /** An array mapping Xplane ID numbers to Chunk descriptors. This allows a fast O(1)
54  * lookup of which chunk descriptor matches an ID. We can do this because we know
55  * all Xplane IDs are < 255. If that changes, this array size will need to be changed.
56  */
57  ChunkDescription *_xplaneDataMap[MAX_XPLANE_DESCRIPTORS];
58 
59  /** Build the XplaneID to ChunkDescription map to improve Xplane decoding speed.
60  * This gets done the first time that the XplaneProducer processes a message
61  */
62  void BuildXplaneIDMap();
63 public:
64 
65  /** Constructor */
67 
68  /** Processes an inbound message, classifying it into chunks and then updating their associated
69  * attributes.
70  * \param msgBuf A buffer containing a message
71  * \param receivedLength The length of the received message
72  */
73  virtual void ProcessMessage(unsigned char *msgBuf,unsigned int receivedLength);
74 };
75 
76 /** Creator function for XplaneProducer used by ChunkProducerFactory */
77 DDD_EXPORT extern ChunkProducer *CreateXplaneProducer();
78 
79 } // end of namespace disti
80 
81 #endif
82 
The ChunkProducer class.
Definition: ChunkProducer.h:183
Definition: ChunkProducer.h:237
Definition: XplaneProducer.h:51
ChunkProducer * CreateXplaneProducer()
Definition: AttributeChangedEmitter.h:46