DataDirector API
DDD_ConvertClamp.h
Go to the documentation of this file.
1 #ifndef _CONVERT_CLAMP_H_
2 #define _CONVERT_CLAMP_H_
3 
4 /*! \file DDD_ConvertClamp.h
5  \brief The DDD_ConvertClamp class. Data Director converter.
6 
7  \par Copyright Information
8 
9  Copyright (c) 2012 The DiSTI Corporation.<br>
10  11301 Corporate Blvd; Suite 100<br>
11  Orlando, Florida 32817<br>
12  USA<br>
13  <br>
14  All rights reserved.<br>
15 
16  This Software contains proprietary trade secrets of DiSTI and may not be
17 reproduced, in whole or part, in any form, or by any means of electronic,
18 mechanical, or otherwise, without the written permission of DiSTI. Said
19 permission may be derived through the purchase of applicable DiSTI product
20 licenses which detail the distribution rights of this content and any
21 Derivative Works based on this or other copyrighted DiSTI Software.
22 
23  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
24 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
25 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
26 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
27 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
28 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
29 
30  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
31 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
32 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
33 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
34 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
35 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBLITY
36 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
37 EXCEED FIVE DOLLARS (US$5.00).
38 
39  The aforementioned terms and restrictions are governed by the laws of the
40 State of Florida and the United States of America.
41 
42 */
43 
44 #include "DDD_ConvertBase.h"
45 #include "DDD_AttributeDouble.h"
46 #include "DDD_ConnectionEndpoint.h"
47 
48 namespace disti
49 {
50 
51 ////////////////////////////////////////////////////////////////////////////////
52 /** \brief Clamp Converter
53  *
54  * Restricts output to fit within a specified domain of [min, max]. <br>
55  * input: [1,1] <br>
56  * ouput: [1,MAX_CONVERTER_OUTPUT] <br>
57  * parameters: <br>
58  * \b min \a (double) <br>
59  * \b max \a (double) <br>
60  * \note Converter will refuse to run if min >= max. <br>
61  */
63 {
64 public:
65 
66  /** Constructor
67  * \param observer An attribute observer that will observer the parameters of the converter
68  * All converter parameters must use this observer for the converter to work right in the
69  * Data Director GUI.
70  */
72 
73  /** Destructor */
74  virtual ~DDD_ConvertClamp();
75 
76  static const char* CONVERT_CLAMP_CLASSNAME; /**< Classname string constant. Needed by the ConverterFactory */
77 
78  // Overrides from DDD_ConvertBase
79  virtual bool Init(const std::string &params);
80 
81  /** \return Returns true if the converter's configuration is valid
82  * \param inputs List of converter inputs
83  * \param outputs List of converter outputs
84  */
85  virtual bool ConfigurationValid(DDD_EndpointList& inputs, DDD_EndpointList& outputs);
86 
87  virtual bool Convert(DDD_EndpointList& inputs, DDD_EndpointList& outputs);
88 
89  virtual int MaxOutputs(){ return MAX_CONVERTER_OUTPUT; }
90 
91  virtual const char* ClassName() { return CONVERT_CLAMP_CLASSNAME; }
92 
93  virtual const char* Description() { return "Restricts output to fit within a specified domain of [min, max].\nConverter will refuse to run if min >= max."; }
94 
95 private:
96  DDD_AttributeDouble *_min, /**< The min value for the converter */
97  *_max; /**< The max value for the converter */
98 };
99 
100 } // end namespace disti
101 #endif
102 
The DDD_EndpintList class. A list of DDD_Endpoints.
Definition: DDD_ConnectionEndpoint.h:119
Abstract base class for all DDD_DataDirector converters.
Definition: DDD_ConvertBase.h:68
DDD_ConvertClamp(DDD_AttributeObserver *observer)
The DDD_ConvertBase class. Base class for Data Director converters.
virtual bool Convert(DDD_EndpointList &inputs, DDD_EndpointList &outputs)
#define MAX_CONVERTER_OUTPUT
Definition: DDD_ConvertBase.h:65
A virtual interface class for observers of attributes. AttributeObserver-derived objects are able to ...
Definition: DDD_AttributeBase.h:66
virtual int MaxOutputs()
Definition: DDD_ConvertClamp.h:89
DataDirector attribute class corresponding to a double-precision float datatype.
Definition: DDD_AttributeDouble.h:51
static const char * CONVERT_CLAMP_CLASSNAME
Definition: DDD_ConvertClamp.h:76
The DDD_AttributeDouble class. Double precision floating point attribute.
virtual bool ConfigurationValid(DDD_EndpointList &inputs, DDD_EndpointList &outputs)
virtual bool Init(const std::string &params)
Definition: AttributeChangedEmitter.h:46
Clamp Converter.
Definition: DDD_ConvertClamp.h:62
virtual const char * Description()
Definition: DDD_ConvertClamp.h:93
virtual const char * ClassName()
Definition: DDD_ConvertClamp.h:91