DataDirector API
DDD_ConvertConstant.h
Go to the documentation of this file.
1 #ifndef _CONVERT_CONSTANT_H_
2 #define _CONVERT_CONSTANT_H_
3 
4 /*! \file DDD_ConvertConstant.h
5  \brief The DDD_ConvertConstant 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_AttributeString.h"
46 #include <string>
47 #include <iostream>
48 #include <sstream>
49 
50 namespace disti
51 {
52 
53 ////////////////////////////////////////////////////////////////////////////////
54 /** \brief Constant Converter
55  *
56  * Simply assigns a constant value to its outputs. <br>
57  * input: [0,0] <br>
58  * ouput: [1,MAX_CONVERTER_OUTPUT] <br>
59  * parameters: <br>
60  * \b constant \a (string) <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_ConvertConstant();
75 
76  static const char* CONVERT_CONSTANT_CLASSNAME; /**< Classname string constant. Needed by the ConverterFactory */
77 
78  // Overrides from DDD_ConvertBase
79  virtual bool Init(const std::string &params);
80 
81  virtual bool Convert(DDD_EndpointList& inputs, DDD_EndpointList& outputs);
82 
83  virtual int MinInputs() { return 0; }
84  virtual int MaxInputs() { return 0; }
85  virtual int MaxOutputs() { return MAX_CONVERTER_OUTPUT; }
86 
87  virtual const char* ClassName() { return CONVERT_CONSTANT_CLASSNAME; }
88  virtual const char* Description() { return "Simply passes a constant value to its outputs."; }
89 
90 private:
91  DDD_AttributeString *_constant; /**< The constant value for the converter */
92 };
93 
94 } // end namespace disti
95 
96 #endif
97 
The DDD_EndpintList class. A list of DDD_Endpoints.
Definition: DDD_ConnectionEndpoint.h:119
DataDirector attribute class corresponding to a string datatype.
Definition: DDD_AttributeString.h:52
virtual const char * ClassName()
Definition: DDD_ConvertConstant.h:87
virtual bool Convert(DDD_EndpointList &inputs, DDD_EndpointList &outputs)
Abstract base class for all DDD_DataDirector converters.
Definition: DDD_ConvertBase.h:68
The DDD_ConvertBase class. Base class for Data Director converters.
static const char * CONVERT_CONSTANT_CLASSNAME
Definition: DDD_ConvertConstant.h:76
virtual int MaxOutputs()
Definition: DDD_ConvertConstant.h:85
#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 MinInputs()
Definition: DDD_ConvertConstant.h:83
DDD_ConvertConstant(DDD_AttributeObserver *observer)
virtual bool Init(const std::string &params)
Constant Converter.
Definition: DDD_ConvertConstant.h:62
virtual int MaxInputs()
Definition: DDD_ConvertConstant.h:84
virtual const char * Description()
Definition: DDD_ConvertConstant.h:88
The DDD_AttributeString class. String attribute.
Definition: AttributeChangedEmitter.h:46