xref: /aoo42x/main/autodoc/source/udm/unittest/test.cxx (revision 8a106958)
1898949d6SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3898949d6SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4898949d6SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5898949d6SAndrew Rist  * distributed with this work for additional information
6898949d6SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7898949d6SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8898949d6SAndrew Rist  * "License"); you may not use this file except in compliance
9898949d6SAndrew Rist  * with the License.  You may obtain a copy of the License at
10898949d6SAndrew Rist  *
11898949d6SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12898949d6SAndrew Rist  *
13898949d6SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14898949d6SAndrew Rist  * software distributed under the License is distributed on an
15898949d6SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16898949d6SAndrew Rist  * KIND, either express or implied.  See the License for the
17898949d6SAndrew Rist  * specific language governing permissions and limitations
18898949d6SAndrew Rist  * under the License.
19898949d6SAndrew Rist  *
20898949d6SAndrew Rist  *************************************************************/
21898949d6SAndrew Rist 
22898949d6SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <precomp.h>
25cdf0e10cSrcweir 
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
28cdf0e10cSrcweir #include <udm/integer_i.hxx>
29cdf0e10cSrcweir #include <udm/string_i.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir using namespace udm;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir // TypeSystem      aTypeSys;
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir class Function
37cdf0e10cSrcweir {
38cdf0e10cSrcweir   public:
39cdf0e10cSrcweir 
40cdf0e10cSrcweir     intt                nId;
41cdf0e10cSrcweir };
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class Ctor : public Function
44cdf0e10cSrcweir {
45cdf0e10cSrcweir   public:
46cdf0e10cSrcweir 
47cdf0e10cSrcweir     csv::String         sClassName;
48cdf0e10cSrcweir };
49cdf0e10cSrcweir 
50cdf0e10cSrcweir class Method : public Function
51cdf0e10cSrcweir {
52cdf0e10cSrcweir   public:
53cdf0e10cSrcweir 
54cdf0e10cSrcweir     csv::String         sFunctionName;
55cdf0e10cSrcweir     std::vector< std::pair< intt, String > >
56cdf0e10cSrcweir                         aParameters;
57cdf0e10cSrcweir };
58cdf0e10cSrcweir 
59cdf0e10cSrcweir 
60cdf0e10cSrcweir class PrObj
61cdf0e10cSrcweir {
62cdf0e10cSrcweir   public:
63cdf0e10cSrcweir     intt                nId;
64cdf0e10cSrcweir     csv::String         sName;
65cdf0e10cSrcweir     std::vector< PrObj* >
66cdf0e10cSrcweir                         aMethods;
67cdf0e10cSrcweir     std::vector< PrObj* >
68cdf0e10cSrcweir                         aData;
69cdf0e10cSrcweir };
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 
fx()74cdf0e10cSrcweir void fx()
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     intt            n = 5;
77cdf0e10cSrcweir     Dyn<Integer_i>  px = new Integer_i(n);
78cdf0e10cSrcweir     Integer &       x = *px;
79cdf0e10cSrcweir 
80cdf0e10cSrcweir     csv::String     s;
81cdf0e10cSrcweir     Dyn<String_i>   ps = new String_i(s);
82cdf0e10cSrcweir     String &        xs = *ps;
83cdf0e10cSrcweir 
84cdf0e10cSrcweir     xs = "Hallo";
85cdf0e10cSrcweir 
86cdf0e10cSrcweir     int dev01 = 2;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     xs = csv::String("Haha");
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     dev01 = 2;
91cdf0e10cSrcweir 
92cdf0e10cSrcweir     csv::String s2 = xs;
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     dev01 = 2;
96cdf0e10cSrcweir 
97cdf0e10cSrcweir //  const char * pc = xs;
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 
100cdf0e10cSrcweir     intt a = x;
101cdf0e10cSrcweir     x = 15;
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     Cout() << a << " " << x << Endl();  // Must be:   5 15
104cdf0e10cSrcweir }
105cdf0e10cSrcweir 
106cdf0e10cSrcweir 
107cdf0e10cSrcweir 
108cdf0e10cSrcweir 
109