Loading...
Searching...
No Matches
ParameterValue.h
Go to the documentation of this file.
1/* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2
3 This file is part of the TerraLib - a Framework for building GIS enabled applications.
4
5 TerraLib is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version.
9
10 TerraLib is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public License
16 along with TerraLib. See COPYING. If not, write to
17 TerraLib Team at <terralib-team@terralib.org>.
18 */
19
20 /*!
21 \file terralib/process/ParameterValue.h
22
23 \brief This class represents the value of a parameter
24 */
25
26#ifndef __TERRALIB_PROCESS_INTERNAL_PARAMETERVALUE_H
27#define __TERRALIB_PROCESS_INTERNAL_PARAMETERVALUE_H
28
29 // TerraLib
30#include "Config.h"
31
32#include "../common/AbstractFactory.h"
33
34//STL include files
35#include <string>
36
37namespace te
38{
39 namespace process
40 {
41 /*!
42 \class Task
43
44 \brief This class represents the value of a parameter.
45 */
47 {
48 public:
49
50 //!< Constructor
51 ParameterValue(int dataType);
52
53 //!< Constructor
54 ParameterValue(const ParameterValue& rhs) = delete;
55
56 /*! \brief Virtual destructor. */
57 virtual ~ParameterValue();
58
59 //!< Gets the parameter data type
60 virtual int getDataType() const;
61
62 //!< Clones the object
63 virtual ParameterValue* clone() const = 0;
64
65 //!< Returns the string representation of the parameter value
66 virtual std::string toString() const = 0;
67
68 //!< Decodes the given string representation and sets the value into the parameter value object
69 virtual void fromString(const std::string& strValue) = 0;
70
71 protected:
72
73 int m_dataType; //!< The data type of the parameter value
74 };
75
76
77 /*!
78 \class ParameterValueFactory
79
80 \brief Abstract factory used to create ParameterValue.
81 */
82 class TEPROCESSEXPORT ParameterValueFactory : public te::common::AbstractFactory < te::process::ParameterValue, int >
83 {
84 protected:
85
86 /*!
87 \brief Constructor.
88
89 \param factoryKey The key that identifies the factory.
90 */
91 ParameterValueFactory(int dataType);
92
93 //!< Destructor
95 };
96
97 //!< Wrapper function used to create taks. Used to avoid C++ to create multiple instances of the factory singleton on Windows
99
100 } // end namespace process
101} // end namespace te
102
103#endif // __TERRALIB_PROCESS_INTERNAL_PARAMETERVALUE_H
104
This class defines the interface of abstract factories without initializing parameters.
Wrapper function used to create taks. Used to avoid C++ to create multiple instances of the factory s...
ParameterValueFactory(int dataType)
Constructor.
virtual ParameterValue * clone() const =0
Returns the string representation of the parameter value.
ParameterValue(int dataType)
< Constructor
virtual void fromString(const std::string &strValue)=0
int m_dataType
The data type of the parameter value.
virtual std::string toString() const =0
Decodes the given string representation and sets the value into the parameter value object.
ParameterValue(const ParameterValue &rhs)=delete
virtual int getDataType() const
Clones the object.
virtual ~ParameterValue()
Virtual destructor.
TEPROCESSEXPORT ParameterValue * CreateParameterValue(int dataType)
TerraLib.
#define TEPROCESSEXPORT
Definition: Config.h:47
Proxy configuration file for TerraView (see terraview_config.h).