cid#1371314: Add move semantics
Change-Id: I995cbdb2b6adc707abe5f1a179e94251641120bc
This commit is contained in:
@@ -62,10 +62,20 @@ class Mapping
|
|||||||
public:
|
public:
|
||||||
inline explicit Mapping( uno_Mapping * pMapping = nullptr );
|
inline explicit Mapping( uno_Mapping * pMapping = nullptr );
|
||||||
inline Mapping( const Mapping & rMapping );
|
inline Mapping( const Mapping & rMapping );
|
||||||
|
Mapping(Mapping && other): _pMapping(other._pMapping)
|
||||||
|
{ other._pMapping = nullptr; }
|
||||||
inline ~Mapping();
|
inline ~Mapping();
|
||||||
inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping );
|
inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping );
|
||||||
inline Mapping & SAL_CALL operator = ( const Mapping & rMapping )
|
inline Mapping & SAL_CALL operator = ( const Mapping & rMapping )
|
||||||
{ return operator = ( rMapping._pMapping ); }
|
{ return operator = ( rMapping._pMapping ); }
|
||||||
|
Mapping & operator =(Mapping && other) {
|
||||||
|
if (_pMapping != nullptr) {
|
||||||
|
(*_pMapping->release)(_pMapping);
|
||||||
|
}
|
||||||
|
_pMapping = other._pMapping;
|
||||||
|
other._pMapping = nullptr;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
inline uno_Mapping * SAL_CALL get() const
|
inline uno_Mapping * SAL_CALL get() const
|
||||||
{ return _pMapping; }
|
{ return _pMapping; }
|
||||||
inline bool SAL_CALL is() const
|
inline bool SAL_CALL is() const
|
||||||
|
Reference in New Issue
Block a user