9 #ifndef CoinSmartPtr_hpp
10 #define CoinSmartPtr_hpp
171 #if COIN_IPOPT_CHECKLEVEL > 2
172 # define IP_DEBUG_SMARTPTR
174 #ifdef IP_DEBUG_SMARTPTR
175 # include "IpDebug.hpp"
349 if (
ptr_->ReferenceCount() == 0) {
377 #define dbg_smartptr_verbosity 0
406 #if COIN_COINUTILS_CHECKLEVEL > 0
415 #if COIN_IPOPT_CHECKLEVEL > 0
436 template <
class U1,
class U2>
442 template <
class U1,
class U2>
448 template <
class U1,
class U2>
454 template <
class U1,
class U2>
460 template <
class U1,
class U2>
466 template <
class U1,
class U2>
473 template <
class U1,
class U2>
481 return static_cast<const void*
>(lhs) == static_cast<const void*>(rhs);
491 template <
class U1,
class U2>
496 template <
class U1,
class U2>
501 template <
class U1,
class U2>
506 template <
class U1,
class U2>
511 template <
class U1,
class U2>
516 template <
class U1,
class U2>
522 #define CoinReferencedObject Coin::ReferencedObject
523 #define CoinSmartPtr Coin::SmartPtr
524 #define CoinComparePointers Coin::ComparePointers
friend bool operator!=(const SmartPtr< U1 > &lhs, const SmartPtr< U2 > &rhs)
Overloaded in-equality comparison operator, allows the user to compare the value of two SmartPtrs...
SmartPtr< T > & operator=(const SmartPtr< T > &rhs)
Overloaded equals operator, allows the user to set the value of the SmartPtr from another SmartPtr...
int ReferenceCount() const
bool IsNull() const
Returns true if the SmartPtr is NULL.
T & operator*() const
Overloaded dereference operator, allows the user to dereference the contained pointer.
friend bool operator==(const SmartPtr< U1 > &lhs, const SmartPtr< U2 > &rhs)
Overloaded equality comparison operator, allows the user to compare the value of two SmartPtrs...
bool operator!=(const Coin::SmartPtr< U1 > &lhs, const Coin::SmartPtr< U2 > &rhs)
virtual ~ReferencedObject()
Template class for Smart Pointers.
T * operator->() const
Overloaded arrow operator, allows the user to call methods using the contained pointer.
SmartPtr< T > & SetFromRawPtr_(T *rhs)
Set the value of the internal raw pointer from another raw pointer, releasing the previously referenc...
typedef void(COINLINKAGE_CB *clp_callback)(Clp_Simplex *model
typedef for user call back.
SmartPtr(const SmartPtr< T > ©)
Copy constructor, initialized from copy.
SmartPtr()
Default constructor, initialized to NULL.
bool IsValid() const
Returns true if the SmartPtr is NOT NULL.
SmartPtr(T *ptr)
Constructor, initialized from T* ptr.
bool ComparePointers(const U1 *lhs, const U2 *rhs)
~SmartPtr()
Destructor, automatically decrements the reference count, deletes the object if necessary.
SmartPtr< T > & operator=(T *rhs)
Overloaded equals operator, allows the user to set the value of the SmartPtr from a raw pointer...
void ReleasePointer_()
Release the currently referenced object.
SmartPtr< T > & SetFromSmartPtr_(const SmartPtr< T > &rhs)
Set the value of the internal raw pointer from a SmartPtr, releasing the previously referenced object...
bool operator==(const Coin::SmartPtr< U1 > &lhs, const Coin::SmartPtr< U2 > &rhs)
T * ptr_
Actual raw pointer to the object.
T * GetRawPtr() const
Returns the raw pointer contained.