xref: /aoo41x/main/o3tl/qa/cow_wrapper_clients.cxx (revision 31682d32)
1*31682d32SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*31682d32SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*31682d32SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*31682d32SAndrew Rist  * distributed with this work for additional information
6*31682d32SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*31682d32SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*31682d32SAndrew Rist  * "License"); you may not use this file except in compliance
9*31682d32SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*31682d32SAndrew Rist  *
11*31682d32SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*31682d32SAndrew Rist  *
13*31682d32SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*31682d32SAndrew Rist  * software distributed under the License is distributed on an
15*31682d32SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*31682d32SAndrew Rist  * KIND, either express or implied.  See the License for the
17*31682d32SAndrew Rist  * specific language governing permissions and limitations
18*31682d32SAndrew Rist  * under the License.
19*31682d32SAndrew Rist  *
20*31682d32SAndrew Rist  *************************************************************/
21*31682d32SAndrew Rist 
22*31682d32SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include "cow_wrapper_clients.hxx"
25cdf0e10cSrcweir 
26cdf0e10cSrcweir namespace o3tltests {
27cdf0e10cSrcweir 
28cdf0e10cSrcweir class cow_wrapper_client2_impl
29cdf0e10cSrcweir {
30cdf0e10cSrcweir public:
cow_wrapper_client2_impl()31cdf0e10cSrcweir     cow_wrapper_client2_impl() : mnValue(0) {}
cow_wrapper_client2_impl(int nVal)32cdf0e10cSrcweir     explicit cow_wrapper_client2_impl( int nVal ) : mnValue(nVal) {}
setValue(int nVal)33cdf0e10cSrcweir     void setValue( int nVal ) { mnValue = nVal; }
getValue() const34cdf0e10cSrcweir     int  getValue() const { return mnValue; }
35cdf0e10cSrcweir 
operator ==(const cow_wrapper_client2_impl & rRHS) const36cdf0e10cSrcweir     bool operator==( const cow_wrapper_client2_impl& rRHS ) const { return mnValue == rRHS.mnValue; }
operator !=(const cow_wrapper_client2_impl & rRHS) const37cdf0e10cSrcweir     bool operator!=( const cow_wrapper_client2_impl& rRHS ) const { return mnValue != rRHS.mnValue; }
operator <(const cow_wrapper_client2_impl & rRHS) const38cdf0e10cSrcweir     bool operator<( const cow_wrapper_client2_impl& rRHS ) const { return mnValue < rRHS.mnValue; }
39cdf0e10cSrcweir 
40cdf0e10cSrcweir private:
41cdf0e10cSrcweir     int mnValue;
42cdf0e10cSrcweir };
43cdf0e10cSrcweir 
cow_wrapper_client2()44cdf0e10cSrcweir cow_wrapper_client2::cow_wrapper_client2() : maImpl()
45cdf0e10cSrcweir {
46cdf0e10cSrcweir }
47cdf0e10cSrcweir 
cow_wrapper_client2(int nVal)48cdf0e10cSrcweir cow_wrapper_client2::cow_wrapper_client2( int nVal ) :
49cdf0e10cSrcweir     maImpl( cow_wrapper_client2_impl(nVal) )
50cdf0e10cSrcweir {
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
~cow_wrapper_client2()53cdf0e10cSrcweir cow_wrapper_client2::~cow_wrapper_client2()
54cdf0e10cSrcweir {
55cdf0e10cSrcweir }
56cdf0e10cSrcweir 
cow_wrapper_client2(const cow_wrapper_client2 & rSrc)57cdf0e10cSrcweir cow_wrapper_client2::cow_wrapper_client2( const cow_wrapper_client2& rSrc ) :
58cdf0e10cSrcweir     maImpl(rSrc.maImpl)
59cdf0e10cSrcweir {
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
operator =(const cow_wrapper_client2 & rSrc)62cdf0e10cSrcweir cow_wrapper_client2& cow_wrapper_client2::operator=( const cow_wrapper_client2& rSrc )
63cdf0e10cSrcweir {
64cdf0e10cSrcweir     maImpl = rSrc.maImpl;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	return *this;
67cdf0e10cSrcweir }
68cdf0e10cSrcweir 
modify(int nVal)69cdf0e10cSrcweir void cow_wrapper_client2::modify( int nVal )
70cdf0e10cSrcweir {
71cdf0e10cSrcweir     maImpl->setValue( nVal );
72cdf0e10cSrcweir }
73cdf0e10cSrcweir 
queryUnmodified() const74cdf0e10cSrcweir int  cow_wrapper_client2::queryUnmodified() const
75cdf0e10cSrcweir {
76cdf0e10cSrcweir     return maImpl->getValue();
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
makeUnique()79cdf0e10cSrcweir void cow_wrapper_client2::makeUnique()
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     maImpl.make_unique();
82cdf0e10cSrcweir }
is_unique() const83cdf0e10cSrcweir bool cow_wrapper_client2::is_unique() const
84cdf0e10cSrcweir {
85cdf0e10cSrcweir     return maImpl.is_unique();
86cdf0e10cSrcweir }
use_count() const87cdf0e10cSrcweir oslInterlockedCount cow_wrapper_client2::use_count() const
88cdf0e10cSrcweir {
89cdf0e10cSrcweir     return maImpl.use_count();
90cdf0e10cSrcweir }
swap(cow_wrapper_client2 & r)91cdf0e10cSrcweir void cow_wrapper_client2::swap( cow_wrapper_client2& r )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     o3tl::swap(maImpl, r.maImpl);
94cdf0e10cSrcweir }
95cdf0e10cSrcweir 
operator ==(const cow_wrapper_client2 & rRHS) const96cdf0e10cSrcweir bool cow_wrapper_client2::operator==( const cow_wrapper_client2& rRHS ) const
97cdf0e10cSrcweir {
98cdf0e10cSrcweir     return maImpl == rRHS.maImpl;
99cdf0e10cSrcweir }
operator !=(const cow_wrapper_client2 & rRHS) const100cdf0e10cSrcweir bool cow_wrapper_client2::operator!=( const cow_wrapper_client2& rRHS ) const
101cdf0e10cSrcweir {
102cdf0e10cSrcweir     return maImpl != rRHS.maImpl;
103cdf0e10cSrcweir }
operator <(const cow_wrapper_client2 & rRHS) const104cdf0e10cSrcweir bool cow_wrapper_client2::operator<( const cow_wrapper_client2& rRHS ) const
105cdf0e10cSrcweir {
106cdf0e10cSrcweir     return maImpl < rRHS.maImpl;
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir // ---------------------------------------------------------------------------
110cdf0e10cSrcweir 
cow_wrapper_client3()111cdf0e10cSrcweir cow_wrapper_client3::cow_wrapper_client3() : maImpl()
112cdf0e10cSrcweir {
113cdf0e10cSrcweir }
114cdf0e10cSrcweir 
cow_wrapper_client3(int nVal)115cdf0e10cSrcweir cow_wrapper_client3::cow_wrapper_client3( int nVal ) :
116cdf0e10cSrcweir     maImpl( cow_wrapper_client2_impl(nVal) )
117cdf0e10cSrcweir {
118cdf0e10cSrcweir }
119cdf0e10cSrcweir 
~cow_wrapper_client3()120cdf0e10cSrcweir cow_wrapper_client3::~cow_wrapper_client3()
121cdf0e10cSrcweir {
122cdf0e10cSrcweir }
123cdf0e10cSrcweir 
cow_wrapper_client3(const cow_wrapper_client3 & rSrc)124cdf0e10cSrcweir cow_wrapper_client3::cow_wrapper_client3( const cow_wrapper_client3& rSrc ) :
125cdf0e10cSrcweir     maImpl(rSrc.maImpl)
126cdf0e10cSrcweir {
127cdf0e10cSrcweir }
128cdf0e10cSrcweir 
operator =(const cow_wrapper_client3 & rSrc)129cdf0e10cSrcweir cow_wrapper_client3& cow_wrapper_client3::operator=( const cow_wrapper_client3& rSrc )
130cdf0e10cSrcweir {
131cdf0e10cSrcweir     maImpl = rSrc.maImpl;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir 	return *this;
134cdf0e10cSrcweir }
135cdf0e10cSrcweir 
modify(int nVal)136cdf0e10cSrcweir void cow_wrapper_client3::modify( int nVal )
137cdf0e10cSrcweir {
138cdf0e10cSrcweir     maImpl->setValue( nVal );
139cdf0e10cSrcweir }
140cdf0e10cSrcweir 
queryUnmodified() const141cdf0e10cSrcweir int  cow_wrapper_client3::queryUnmodified() const
142cdf0e10cSrcweir {
143cdf0e10cSrcweir     return maImpl->getValue();
144cdf0e10cSrcweir }
145cdf0e10cSrcweir 
makeUnique()146cdf0e10cSrcweir void cow_wrapper_client3::makeUnique()
147cdf0e10cSrcweir {
148cdf0e10cSrcweir     maImpl.make_unique();
149cdf0e10cSrcweir }
is_unique() const150cdf0e10cSrcweir bool cow_wrapper_client3::is_unique() const
151cdf0e10cSrcweir {
152cdf0e10cSrcweir     return maImpl.is_unique();
153cdf0e10cSrcweir }
use_count() const154cdf0e10cSrcweir oslInterlockedCount cow_wrapper_client3::use_count() const
155cdf0e10cSrcweir {
156cdf0e10cSrcweir     return maImpl.use_count();
157cdf0e10cSrcweir }
swap(cow_wrapper_client3 & r)158cdf0e10cSrcweir void cow_wrapper_client3::swap( cow_wrapper_client3& r )
159cdf0e10cSrcweir {
160cdf0e10cSrcweir     o3tl::swap(maImpl, r.maImpl);
161cdf0e10cSrcweir }
162cdf0e10cSrcweir 
operator ==(const cow_wrapper_client3 & rRHS) const163cdf0e10cSrcweir bool cow_wrapper_client3::operator==( const cow_wrapper_client3& rRHS ) const
164cdf0e10cSrcweir {
165cdf0e10cSrcweir     return maImpl == rRHS.maImpl;
166cdf0e10cSrcweir }
operator !=(const cow_wrapper_client3 & rRHS) const167cdf0e10cSrcweir bool cow_wrapper_client3::operator!=( const cow_wrapper_client3& rRHS ) const
168cdf0e10cSrcweir {
169cdf0e10cSrcweir     return maImpl != rRHS.maImpl;
170cdf0e10cSrcweir }
operator <(const cow_wrapper_client3 & rRHS) const171cdf0e10cSrcweir bool cow_wrapper_client3::operator<( const cow_wrapper_client3& rRHS ) const
172cdf0e10cSrcweir {
173cdf0e10cSrcweir     return maImpl < rRHS.maImpl;
174cdf0e10cSrcweir }
175cdf0e10cSrcweir 
176cdf0e10cSrcweir } // namespace o3tltests
177