64 #ifndef MADNESS_WORLD_SCOPED_PTR_H__INCLUDED
65 #define MADNESS_WORLD_SCOPED_PTR_H__INCLUDED
78 template<
typename ptrT>
80 template<
typename ptrT>
86 template<
typename ptrT>
88 template<
typename ptrT>
100 template<
typename ptrT>
124 ~ScopedPtr() { madness::detail::checked_delete<ptrT>(ptr_); }
134 MADNESS_ASSERT(p == NULL || p != ptr_);
143 MADNESS_ASSERT(ptr_ != NULL);
152 MADNESS_ASSERT(ptr_ != NULL);
160 ptrT*
get()
const {
return ptr_; }
166 operator bool()
const {
return (ptr_ != NULL); }
191 template<
typename ptrT>
200 template<
typename ptrT>
215 template<
typename ptrT>
221 ScopedArray(
const ScopedArray<ptrT>&);
222 ScopedArray& operator=(
const ScopedArray<ptrT>&);
223 void operator==(
const ScopedArray<ptrT>&)
const;
224 void operator!=(
const ScopedArray<ptrT>&)
const;
249 MADNESS_ASSERT(p == NULL || p != ptr_);
258 MADNESS_ASSERT(ptr_ != NULL);
266 ptrT*
get()
const {
return ptr_; }
272 operator bool()
const {
return (ptr_ != NULL); }
297 template<
typename ptrT>
307 template<
typename ptrT>
314 #endif // MADNESS_WORLD_SCOPED_PTR_H__INCLUDED
ptrT element_type
the pointer type
Definition: scopedptr.h:113
bool operator!() const
Not operator.
Definition: scopedptr.h:172
ptrT * operator->() const
Pointer member accessor.
Definition: scopedptr.h:151
ptrT * get() const
Pointer accessor.
Definition: scopedptr.h:160
void reset(ptrT *p=NULL)
Reset the current pointer.
Definition: scopedptr.h:248
bool operator!() const
Not operator.
Definition: scopedptr.h:278
ScopedArray(ptrT *p=NULL)
Construct a scoped pointer.
Definition: scopedptr.h:234
ptrT & operator[](std::size_t i) const
Array element accessor.
Definition: scopedptr.h:257
void reset(ptrT *p=NULL)
Reset the current pointer.
Definition: scopedptr.h:133
ScopedPtr(ptrT *p=NULL)
Construct a scoped pointer.
Definition: scopedptr.h:119
ptrT element_type
the pointer type
Definition: scopedptr.h:228
void swap(ScopedPtr< ptrT > &other)
Swap the pointers.
Definition: scopedptr.h:178
Scoped pointer.
Definition: scopedptr.h:77
FLOAT a(int j, FLOAT z)
Definition: y1.cc:86
~ScopedPtr()
Destructor.
Definition: scopedptr.h:124
ptrT & operator*() const
Dereference operator.
Definition: scopedptr.h:142
Scoped array.
Definition: scopedptr.h:85
void swap(ScopedArray< ptrT > &other)
Swap the pointers.
Definition: scopedptr.h:284
void swap(Vector< T, N > &l, Vector< T, N > &r)
Definition: array.h:308
Implements MadnessException.
~ScopedArray()
Destructor.
Definition: scopedptr.h:239
Holds machinery to set up Functions/FuncImpls using various Factories and Interfaces.
Definition: chem/atomutil.cc:45
T * get_pointer(const detail::ReferenceWrapper< T > &r)
Function for retreaving a pointer to the referenced object.
Definition: ref.h:207
FLOAT b(int j, FLOAT z)
Definition: y1.cc:79