Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

template<typename, typename>
class Geo::GeoAutoPtr

    └>D

A value type to take ownership of a raw object allocated on the heap and bind its life-time to the scope of this class.

Virtually identical to std::auto_ptr, but with policy-based destruction semantics.

Functions

NameDescription
~GeoAutoPtr()

Destructor - Delete the internal object.

Delete()

Explicitly delete the internal object.

Detach()

Release ownership of the internal object and return it to the client.

GeoAutoPtr(GeoAutoPtr &&)

Move constructor.

GeoAutoPtr(GeoAutoPtr< TOther, DOther > &)

Construct by assuming pointer from rhs, given a different contained type Theoretically could write a destruction policy that accepted matches to other policies, but none implemented to date.

GeoAutoPtr(GeoAutoPtr< TOther, DOther > &&)

Move constructor.

GeoAutoPtr(T *)

Take ownership of the raw-ptr obj. Explicit so that you don't unknowingly change ownership.

GeoAutoPtr(GeoAutoPtr< T, D > &)

Take ownership of the payload of other GeoAutoPtr.

GetPtr()

Explicitly return the contained type.

operator bool_type()

Is the object valid?

operator GeoAutoPtr< TOther, DOther >()

Convert to GeoAutoPtr of compatible type.

operator!=(const GeoAutoPtr &)

Equivalence/comparison tests.

operator*()

Allow dereferencing of the contained type.

operator[](Geo::s32)

Allow array referencing of the contained type.

operator<(const GeoAutoPtr &)

Equivalence/comparison tests.

operator=(GeoAutoPtr< T, D > &&)

Move assignment operator.

operator=(GeoAutoPtr< T, D > &)

Support assignment (modifying other object)

operator==(const GeoAutoPtr &)

Equivalence/comparison tests.

operator>(const GeoAutoPtr &)

Equivalence/comparison tests.

operator->()

Access members of the owned object.

Reset(T *)

Hold new object, destroying current.


Anchor
af80742fd869cc482f4d73237ed69213d
af80742fd869cc482f4d73237ed69213d

Geo::GeoAutoPtr< T, D >::~GeoAutoPtr

...

public: ~GeoAutoPtr()

...

Destructor - Delete the internal object.


Anchor
a93fa0a190fe517a180d2f9c5ec9c401d
a93fa0a190fe517a180d2f9c5ec9c401d

void Geo::GeoAutoPtr< T, D >::Delete

...

public: void Delete()

...

Explicitly delete the internal object.


Anchor
afd841f65d80f97751826bcb3813d9a3d
afd841f65d80f97751826bcb3813d9a3d

T* Geo::GeoAutoPtr< T, D >::Detach

...

public: T * Detach()

...

Release ownership of the internal object and return it to the client.

From then on its the client's responsibility to delete it.


Anchor
ac3699085b663febba2bd714ed11f0196
ac3699085b663febba2bd714ed11f0196

Geo::GeoAutoPtr< T, D >::GeoAutoPtr

...

public: GeoAutoPtr
(
    GeoAutoPtr && rhs
)

...

Move constructor.


Anchor
ade90316d3cbe9851c889c08caf0d8313
ade90316d3cbe9851c889c08caf0d8313

Geo::GeoAutoPtr< T, D >::GeoAutoPtr

...

public: GeoAutoPtr
(
    GeoAutoPtr< TOther, DOther > & rhs
)

...

Construct by assuming pointer from rhs, given a different contained type Theoretically could write a destruction policy that accepted matches to other policies, but none implemented to date.


Anchor
ab088476aaa76f0db22d918a7623d1e62
ab088476aaa76f0db22d918a7623d1e62

Geo::GeoAutoPtr< T, D >::GeoAutoPtr

...

public: GeoAutoPtr
(
    GeoAutoPtr< TOther, DOther > && rhs
)

...

Move constructor.


Anchor
a15fc4671dfa2005740145f5e963d7f22
a15fc4671dfa2005740145f5e963d7f22

Geo::GeoAutoPtr< T, D >::GeoAutoPtr

...

public: GeoAutoPtr
(
    T * obj
)

...

Take ownership of the raw-ptr obj. Explicit so that you don't unknowingly change ownership.


Anchor
a2553bcf767c1b18df8e161ad824b3783
a2553bcf767c1b18df8e161ad824b3783

Geo::GeoAutoPtr< T, D >::GeoAutoPtr

...

public: GeoAutoPtr
(
    GeoAutoPtr< T, D > & rhs
)

...

Take ownership of the payload of other GeoAutoPtr.

Inheritance from the destruction policy ensures that you cannot assign between GeoAutoPtr of different policies, whilst allowing assignment to GeoAutoPtr to base types.


Anchor
a5bd08789b31e1297a204743f3a7a8c4b
a5bd08789b31e1297a204743f3a7a8c4b

T* Geo::GeoAutoPtr< T, D >::GetPtr

...

public: T * GetPtr() const

...

Explicitly return the contained type.


Anchor
a3d1d2ed5249756f4b608b1b7a57a94f5
a3d1d2ed5249756f4b608b1b7a57a94f5

Geo::GeoAutoPtr< T, D >::operator bool_type

...

public: operator bool_type() const

...

Is the object valid?


Anchor
ae5035fc6e887c92ec2222d3bcc619794
ae5035fc6e887c92ec2222d3bcc619794

Geo::GeoAutoPtr< T, D >::operator GeoAutoPtr< TOther, DOther >

...

public: operator GeoAutoPtr< TOther, DOther >()

...

Convert to GeoAutoPtr of compatible type.


Anchor
a896b8881aaa74b45776217ad4fef23cd
a896b8881aaa74b45776217ad4fef23cd

bool Geo::GeoAutoPtr< T, D >::operator!=

...

public: bool operator!=
(
    const GeoAutoPtr & rhs
) const

...

Equivalence/comparison tests.


Anchor
a134a9c968efe5cb35610c6d9860be895
a134a9c968efe5cb35610c6d9860be895

T& Geo::GeoAutoPtr< T, D >::operator*

...

public: T & operator*() const

...

Allow dereferencing of the contained type.


Anchor
a299b118a6a579177c3e4600a066e06c7
a299b118a6a579177c3e4600a066e06c7

T& Geo::GeoAutoPtr< T, D >::operator[]

...

public: T & operator[]
(
    Geo::s32 idx
) const

...

Allow array referencing of the contained type.


Anchor
a7a1634481779de5e994395c7f9f5b6ac
a7a1634481779de5e994395c7f9f5b6ac

bool Geo::GeoAutoPtr< T, D >::operator<

...

public: bool operator<
(
    const GeoAutoPtr & rhs
) const

...

Equivalence/comparison tests.


Anchor
a67309828dc36328fba0420f0fb52b5d3
a67309828dc36328fba0420f0fb52b5d3

GeoAutoPtr<T,D>& Geo::GeoAutoPtr< T, D >::operator=

...

public: GeoAutoPtr< T, D > & operator=
(
    GeoAutoPtr< T, D > && obj
)

...

Move assignment operator.


Anchor
af2e989db0d9d5e018094475ec344f500
af2e989db0d9d5e018094475ec344f500

GeoAutoPtr<T,D>& Geo::GeoAutoPtr< T, D >::operator=

...

public: GeoAutoPtr< T, D > & operator=
(
    GeoAutoPtr< T, D > & obj
)

...

Support assignment (modifying other object)


Anchor
a1336e9de0e4eb35087a783e44c670ca2
a1336e9de0e4eb35087a783e44c670ca2

bool Geo::GeoAutoPtr< T, D >::operator==

...

public: bool operator==
(
    const GeoAutoPtr & rhs
) const

...

Equivalence/comparison tests.


Anchor
a62585b6b5ad0e0e82232183579ea6c7d
a62585b6b5ad0e0e82232183579ea6c7d

bool Geo::GeoAutoPtr< T, D >::operator>

...

public: bool operator>
(
    const GeoAutoPtr & rhs
) const

...

Equivalence/comparison tests.


Anchor
a4b9abed006d3c0e4c673d30b061f97c3
a4b9abed006d3c0e4c673d30b061f97c3

T* Geo::GeoAutoPtr< T, D >::operator->

...

public: T * operator->() const

...

Access members of the owned object.


Anchor
af2911bb4a5fc171f375e4a3855c090a4
af2911bb4a5fc171f375e4a3855c090a4

void Geo::GeoAutoPtr< T, D >::Reset

...

public: void Reset
(
    T * obj
)

...

Hold new object, destroying current.