summaryrefslogtreecommitdiffstats
path: root/sdo-cpp/tags/cpp-sdo-1.0.incubating-M3/runtime/core/src/commonj/sdo/RefCountingPointer.cpp
blob: 07d4834574010e366aee964e99bd9679a3345541 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 *   
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/* $Rev$ $Date$ */

#include "commonj/sdo/RefCountingPointer.h"
#include "commonj/sdo/DataFactory.h"
#include "commonj/sdo/DataObject.h"
#include "commonj/sdo/DataGraph.h"
#include "commonj/sdo/ChangeSummary.h"
#include "commonj/sdo/XMLDocument.h"
#include "commonj/sdo/XSDHelper.h"
#include "commonj/sdo/XMLHelper.h"

namespace commonj{
    namespace sdo{
        
        // officially, there is nothing here- but if I dont use the overrides in
        // the templates, then they dont get generated.
        void Test ()
        {
            
#if defined(WIN32) || defined (_WINDOWS)
            /* 1) construct */
            DataFactoryPtr fptr = DataFactory::getDataFactory();
            
            /* 2) use the & operator= */
            fptr = DataFactory::getDataFactory();
            
            /* 3) copy */
            DataFactoryPtr fptr2 = fptr;
            
            /* 4) use the == and ! */
            if (fptr2 == fptr || !fptr){}
            
            /* 5) Use the T*  and  * */
            DataFactory* dmsf = fptr;
            DataFactory& dmsr = *fptr;
            
            /* 1) construct */
            DataFactoryPtr dfptr(fptr);
            
            /* 3) copy */
            DataFactoryPtr dfptr2 = dfptr;
            
            /* 2) use the & operator= */
            dfptr = dfptr2;
            
            /* 4) use the == and ! */
            if (dfptr2 == dfptr || !dfptr){}
            
            /* 5) Use the T*  and  * */
            DataFactory* ddmsf = dfptr;
            DataFactory& ddmsr = *dfptr;
            
            /* 6) Use the -> */
            DataObjectPtr dptr = dfptr->create("nothing","nowhere"); 
            
            /* and agin to catch the = */
            dptr = fptr->create("nothing","nowhere");
            
            DataObjectPtr dptr2 = dptr;
            
            /* Use the T*  and  * */
            DataObject* dof = dptr;
            DataObject& dor = *dptr;
            
            if (dptr2 == dptr || !dptr){}
            
            
            ChangeSummaryPtr cptr = dptr->getChangeSummary();
            cptr = dptr->getChangeSummary();
            ChangeSummaryPtr cptr2 = cptr;
            
            ChangeSummary* cof = cptr;
            ChangeSummary& cop = *cptr;
            
            
            if (cptr2 == cptr || !cptr){}
            
            cptr->endLogging();
            
            SequencePtr sptr = dptr->getSequence();
            sptr = dptr->getSequence();
            SequencePtr sptr2 = sptr;
            
            Sequence* sof = sptr;
            Sequence& sop = *sptr;
            
            
            if (sptr2 == sptr || !sptr){}
            
            sptr->getBooleanValue(0);
            
            
            // Generate code for XMLDocumentPtr
            XMLDocumentPtr xmldocptr1 = 0;
            XMLDocumentPtr xmldocptr2 = xmldocptr1;
            xmldocptr1 = xmldocptr2;
            if (xmldocptr2 == xmldocptr1 || !xmldocptr1){}
            XMLDocument* xmldocp = xmldocptr1;
            XMLDocument& xmldocref = *xmldocptr2;
            xmldocptr1->getEncoding();

            // Generate code for XSDHelperPtr
            XSDHelperPtr xsdhptr1 = 0;
            XSDHelperPtr xsdhptr2 = xsdhptr1;
            xsdhptr1 = xsdhptr2;
            if (xsdhptr2 == xsdhptr1 || !xsdhptr1){}
            XSDHelper* xsdhp = xsdhptr1;
            XSDHelper& xsdhref = *xsdhptr2;
            xsdhptr1->define("dummy");

            // Generate code for XMLHelperPtr
            XMLHelperPtr xmlhptr1 = 0;
            XMLHelperPtr xmlhptr2 = xmlhptr1;
            xmlhptr1 = xmlhptr2;
            if (xmlhptr2 == xmlhptr1 || !xmlhptr1){}
            XMLHelper* xmlhp = xmlhptr1;
            XMLHelper& xmlhref = *xmlhptr2;
            xmlhptr1->load("dummy");

            // Generate code for DataGraphPtr
            DataGraphPtr dgptr1 = 0;
            DataGraphPtr dgptr2 = dgptr1;
            dgptr1 = dgptr2;
            if (dgptr2 == dgptr1 || !dgptr1){}
            DataGraph* dghp = dgptr1;
            DataGraph& dgref = *dgptr2;
            dgptr1->getRootObject();

#endif
            
        }
    };
};