initial load of upstream version 1.06.32
[xmlrpc-c] / tools / xml-rpc-api2cpp / DataType.hpp
1 #include <string>
2 #include <cassert>
3
4 class DataType {
5     std::string mTypeName;
6
7     DataType(DataType const&) { assert(false); }
8     
9     DataType& operator= (DataType const&) {
10         assert(false);
11         return *this;
12     }
13
14 public:
15     DataType(const std::string& type_name) : mTypeName(type_name) {}
16
17     virtual ~DataType () {}
18
19     // Return the name for this XML-RPC type.
20     virtual std::string
21     typeName() const { return mTypeName; }
22
23     // Given a parameter position, calculate a unique base name for all
24     // parameter-related variables.
25     virtual std::string
26     defaultParameterBaseName(int position) const;
27
28     // Virtual functions for processing parameters.
29     virtual std::string
30     parameterFragment(std::string const& base_name) const = 0;
31
32     virtual std::string
33     inputConversionFragment(std::string const& base_name) const = 0;
34
35     // Virtual functions for processing return values.
36     virtual std::string
37     returnTypeFragment () const = 0;
38
39     virtual std::string
40     outputConversionFragment(std::string const& var_name) const = 0;
41 };
42
43 const DataType& findDataType(const std::string& name);