summaryrefslogtreecommitdiff
path: root/ACE
diff options
context:
space:
mode:
authorAdam Mitz <mitza@objectcomputing.com>2021-11-05 10:44:46 -0500
committerAdam Mitz <mitza@objectcomputing.com>2021-11-05 10:44:46 -0500
commit2bc264c4ebe25a8aebb0d33a19b308132864fb58 (patch)
tree449fc7d84960ef06ea2f5069988f07d1a1b61471 /ACE
parentfd83ab71c26234f56b7e8bfb3794c7058b923dcc (diff)
downloadATCD-2bc264c4ebe25a8aebb0d33a19b308132864fb58.tar.gz
ACE_Based_Pointer is not copyable/moveable
- use =delete instead of asserting - also clean up comments and style
Diffstat (limited to 'ACE')
-rw-r--r--ACE/ace/Based_Pointer_T.cpp22
-rw-r--r--ACE/ace/Based_Pointer_T.h49
-rw-r--r--ACE/ace/Based_Pointer_T.inl30
3 files changed, 36 insertions, 65 deletions
diff --git a/ACE/ace/Based_Pointer_T.cpp b/ACE/ace/Based_Pointer_T.cpp
index e3504108156..9a1b64bd756 100644
--- a/ACE/ace/Based_Pointer_T.cpp
+++ b/ACE/ace/Based_Pointer_T.cpp
@@ -16,7 +16,7 @@ ACE_BEGIN_VERSIONED_NAMESPACE_DECL
ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Based_Pointer_Basic)
template <class CONCRETE>
-ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (void)
+ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer ()
{
ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
}
@@ -44,14 +44,14 @@ ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (CONCRETE *initial)
}
template <class CONCRETE>
-ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (const void* base_addr, int)
+ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (const void *base_addr, int)
: ACE_Based_Pointer_Basic<CONCRETE> (base_addr, 0)
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
}
template <class CONCRETE>
-ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (void)
+ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic ()
: target_ (0),
base_offset_ (0)
{
@@ -100,22 +100,6 @@ ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (CONCRETE *rhs)
}
}
-template <class CONCRETE>
-ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic<CONCRETE> &)
-{
- ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
-
- ACE_ASSERT (0); // not implemented.
-}
-
-template <class CONCRETE>
-ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (const ACE_Based_Pointer<CONCRETE> &rhs)
- : ACE_Based_Pointer_Basic<CONCRETE> (rhs)
-{
- ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
- ACE_ASSERT (0); // not implemented.
-}
-
ACE_END_VERSIONED_NAMESPACE_DECL
#endif /* ACE_BASED_POINTER_T_CPP */
diff --git a/ACE/ace/Based_Pointer_T.h b/ACE/ace/Based_Pointer_T.h
index 33085713804..902e90f2a36 100644
--- a/ACE/ace/Based_Pointer_T.h
+++ b/ACE/ace/Based_Pointer_T.h
@@ -59,7 +59,7 @@ public:
* based-pointer uses its address as an offset to it's base
* address 0.
*/
- ACE_Based_Pointer_Basic (void);
+ ACE_Based_Pointer_Basic ();
/**
* Initialize this object using the @a initial pointer. This
@@ -84,48 +84,37 @@ public:
*/
ACE_Based_Pointer_Basic (CONCRETE *initial);
- /// Copy constructor.
- ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic<CONCRETE> &);
+ ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic &) = delete;
+ ACE_Based_Pointer_Basic (ACE_Based_Pointer_Basic &&) = delete;
/// Constructor for know base address. @a o is only used to
/// resolve overload ambiguity.
ACE_Based_Pointer_Basic (const void *base_addr, int o);
- /// Pseudo-assignment operator.
- void operator = (CONCRETE *from);
+ void operator= (CONCRETE *from);
- /// Pseudo-assignment operator.
- void operator = (const ACE_Based_Pointer_Basic<CONCRETE> &);
+ void operator= (const ACE_Based_Pointer_Basic &);
- /// Dereference operator.
CONCRETE operator * () const;
- /// Less than operator.
- bool operator < (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator< (const ACE_Based_Pointer_Basic &) const;
- /// Less than or equal operator.
- bool operator <= (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator<= (const ACE_Based_Pointer_Basic &) const;
- /// Greater than operator.
- bool operator > (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator> (const ACE_Based_Pointer_Basic &) const;
- /// Greater than or equal operator.
- bool operator >= (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator>= (const ACE_Based_Pointer_Basic &) const;
- /// Equality operator.
- bool operator == (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator== (const ACE_Based_Pointer_Basic &) const;
- /// Inequality operator.
- bool operator != (const ACE_Based_Pointer_Basic<CONCRETE> &) const;
+ bool operator!= (const ACE_Based_Pointer_Basic &) const;
- /// Subscript operator.
- CONCRETE operator [](int index) const;
+ CONCRETE operator[] (int index) const;
- /// Increment operator.
void operator+= (int index);
/// Returns the underlying memory address of the smart pointer.
- operator CONCRETE *() const;
+ operator CONCRETE * () const;
/// Returns the underlying memory address of the smart pointer.
CONCRETE *addr () const;
@@ -159,7 +148,7 @@ class ACE_Based_Pointer : public ACE_Based_Pointer_Basic<CONCRETE>
public:
/// Constructor. See constructor for ACE_Based_Pointer_Basic for
/// details.
- ACE_Based_Pointer (void);
+ ACE_Based_Pointer ();
/// Initialize this object using the <initial> pointer. See
/// constructor for ACE_Based_Pointer_Basic for details.
@@ -170,17 +159,15 @@ public:
/// otherwise ignored.
ACE_Based_Pointer (const void *base_addr, int dummy);
- /// Copy constructor (not implemented yet).
- ACE_Based_Pointer (const ACE_Based_Pointer<CONCRETE> &);
+ ACE_Based_Pointer (const ACE_Based_Pointer &) = delete;
+ ACE_Based_Pointer (ACE_Based_Pointer &&) = delete;
- /// Assignment operator.
- void operator = (const ACE_Based_Pointer<CONCRETE> &);
+ void operator= (const ACE_Based_Pointer &);
/// Pseudo-assignment operator.
void operator = (CONCRETE *from);
- /// The C++ "delegation operator".
- CONCRETE *operator-> (void);
+ CONCRETE *operator-> ();
};
ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/Based_Pointer_T.inl b/ACE/ace/Based_Pointer_T.inl
index c9b00d5c703..a4104dd3165 100644
--- a/ACE/ace/Based_Pointer_T.inl
+++ b/ACE/ace/Based_Pointer_T.inl
@@ -5,14 +5,14 @@
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
template <class CONCRETE> ACE_INLINE CONCRETE *
-ACE_Based_Pointer<CONCRETE>::operator->(void)
+ACE_Based_Pointer<CONCRETE>::operator-> ()
{
ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator->");
return reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
}
template <class CONCRETE> ACE_INLINE void
-ACE_Based_Pointer_Basic<CONCRETE>::operator = (CONCRETE *rhs)
+ACE_Based_Pointer_Basic<CONCRETE>::operator= (CONCRETE *rhs)
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator =");
if (rhs == 0)
@@ -24,7 +24,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::operator = (CONCRETE *rhs)
}
template <class CONCRETE> ACE_INLINE void
-ACE_Based_Pointer<CONCRETE>::operator = (CONCRETE *rhs)
+ACE_Based_Pointer<CONCRETE>::operator= (CONCRETE *rhs)
{
ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator =");
if (rhs == 0)
@@ -36,7 +36,7 @@ ACE_Based_Pointer<CONCRETE>::operator = (CONCRETE *rhs)
}
template <class CONCRETE> ACE_INLINE CONCRETE
-ACE_Based_Pointer_Basic<CONCRETE>::operator *() const
+ACE_Based_Pointer_Basic<CONCRETE>::operator * () const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator *");
return *reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
@@ -54,7 +54,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::addr () const
}
template <class CONCRETE> ACE_INLINE
-ACE_Based_Pointer_Basic<CONCRETE>::operator CONCRETE *() const
+ACE_Based_Pointer_Basic<CONCRETE>::operator CONCRETE * () const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator CONCRETE *()");
@@ -62,7 +62,7 @@ ACE_Based_Pointer_Basic<CONCRETE>::operator CONCRETE *() const
}
template <class CONCRETE> ACE_INLINE CONCRETE
-ACE_Based_Pointer_Basic<CONCRETE>::operator [] (int index) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator[] (int index) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator []");
CONCRETE *c =
@@ -71,63 +71,63 @@ ACE_Based_Pointer_Basic<CONCRETE>::operator [] (int index) const
}
template <class CONCRETE> ACE_INLINE void
-ACE_Based_Pointer_Basic<CONCRETE>::operator += (int index)
+ACE_Based_Pointer_Basic<CONCRETE>::operator+= (int index)
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator +=");
this->base_offset_ += (index * sizeof (CONCRETE));
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator == (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator== (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator ==");
return ACE_COMPUTE_BASED_POINTER (this) == ACE_COMPUTE_BASED_POINTER (&rhs);
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator != (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator!= (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator !=");
return !(*this == rhs);
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator < (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator< (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator <");
return ACE_COMPUTE_BASED_POINTER (this) < ACE_COMPUTE_BASED_POINTER (&rhs);
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator <= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator<= (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator <=");
return ACE_COMPUTE_BASED_POINTER (this) <= ACE_COMPUTE_BASED_POINTER (&rhs);
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator > (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator> (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator >");
return ACE_COMPUTE_BASED_POINTER (this) > ACE_COMPUTE_BASED_POINTER (&rhs);
}
template <class CONCRETE> ACE_INLINE bool
-ACE_Based_Pointer_Basic<CONCRETE>::operator >= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs) const
+ACE_Based_Pointer_Basic<CONCRETE>::operator>= (const ACE_Based_Pointer_Basic &rhs) const
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator >=");
return ACE_COMPUTE_BASED_POINTER (this) >= ACE_COMPUTE_BASED_POINTER (&rhs);
}
template <class CONCRETE> ACE_INLINE void
-ACE_Based_Pointer_Basic<CONCRETE>::operator= (const ACE_Based_Pointer_Basic<CONCRETE> &rhs)
+ACE_Based_Pointer_Basic<CONCRETE>::operator= (const ACE_Based_Pointer_Basic &rhs)
{
ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::operator=");
*this = rhs.addr ();
}
template <class CONCRETE> ACE_INLINE void
-ACE_Based_Pointer<CONCRETE>::operator= (const ACE_Based_Pointer<CONCRETE> &rhs)
+ACE_Based_Pointer<CONCRETE>::operator= (const ACE_Based_Pointer &rhs)
{
ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator=");
*this = rhs.addr ();