DataDirector API
RawProducer.h
Go to the documentation of this file.
1 /*! \file RawProducer.h
2  \brief The RawProducer class. Produces attributes from RAW UDP datagrams.
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 _RAW_PRODUCER_H_
42 #define _RAW_PRODUCER_H_
43 
44 #include "ChunkProducer.h"
45 
46 namespace disti
47 {
48 
49 class DDD_EXPORT RawProducer : public ChunkProducer
50 {
51 public:
52 
53  /** Constructor */
54  RawProducer();
55 
56  /** Processes an inbound message, classifying it into chunks and then updating their associated
57  * attributes.
58  * \param msgBuf A buffer containing a message
59  * \param receivedLength The length of the received message
60  */
61  virtual void ProcessMessage(unsigned char *msgBuf,unsigned int receivedLength);
62 
63  /** Builds an outbound message buffer. Only implemented by ChunkProducers that send data.
64  * \param msgBuf A buffer to contain the message
65  * \param maxMessageLength The max length of the message to build
66  * \return The length of the message built or -1 if no message built
67  */
68  virtual int BuildMessage(unsigned char *msgBuf,unsigned int maxMessageLength, unsigned int chunkNumber);
69 
70 protected:
71  virtual void OnAttributeChanged(DDD_AttributeBase *attribute);
72 
73 private:
74  /** \return Returns true if a given rule element fires true based on the current chunk being processed
75  * \param element The rule element to try
76  */
77  bool MatchRuleElement(RuleElement *element);
78 
79  /** \return Returns true if all of the rule elements fire true based on the current chunk being processed
80  * \param chunk The chunk description containing the rules to try
81  */
82  bool MatchesRule(ChunkDescription *chunk);
83 };
84 
85 /** Creator function for RawProducer used by ChunkProducerFactory */
86 DDD_EXPORT extern ChunkProducer *CreateRawProducer();
87 
88 } // end of namespace disti
89 
90 #endif
91 
The ChunkProducer class.
Definition: ChunkProducer.h:183
Definition: RawProducer.h:49
ChunkProducer * CreateRawProducer()
A virtual interface class for all DataDirector attribute types.
Definition: DDD_AttributeBase.h:87
Definition: ChunkProducer.h:237
Definition: ChunkProducer.h:126
Definition: AttributeChangedEmitter.h:46