ACE 8.0.1
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
ACE_Based_Pointer_Basic< CONCRETE > Class Template Reference

A proxy that keeps track of the relative offset of a "pointer" from its base address. This class makes it possible to transparently use "pointers" in shared memory as easily as programming with pointers to local memory. In particular, we don't need to ensure that the base addresses of all the pointers are mapped into separate processes at the same absolute memory base address. More...

#include <Based_Pointer_T.h>

Inheritance diagram for ACE_Based_Pointer_Basic< CONCRETE >:
Inheritance graph
[legend]

Public Member Functions

 ACE_Based_Pointer_Basic ()
 
 ACE_Based_Pointer_Basic (CONCRETE *initial)
 
 ACE_Based_Pointer_Basic (const ACE_Based_Pointer_Basic &)=delete
 
 ACE_Based_Pointer_Basic (ACE_Based_Pointer_Basic &&)=delete
 
 ACE_Based_Pointer_Basic (const void *base_addr, int o)
 
void operator= (CONCRETE *from)
 
void operator= (const ACE_Based_Pointer_Basic &)
 
CONCRETE operator* () const
 
bool operator< (const ACE_Based_Pointer_Basic &) const
 
bool operator<= (const ACE_Based_Pointer_Basic &) const
 
bool operator> (const ACE_Based_Pointer_Basic &) const
 
bool operator>= (const ACE_Based_Pointer_Basic &) const
 
bool operator== (const ACE_Based_Pointer_Basic &) const
 
bool operator!= (const ACE_Based_Pointer_Basic &) const
 
CONCRETE operator[] (int index) const
 
void operator+= (int index)
 
 operator CONCRETE * () const
 Returns the underlying memory address of the smart pointer.
 
CONCRETEaddr () const
 Returns the underlying memory address of the smart pointer.
 
void dump () const
 Dump the state of the object.
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 Declare the dynamic allocation hooks.
 

Protected Attributes

ptrdiff_t target_
 
ptrdiff_t base_offset_
 Keep track of our offset from the base pointer.
 

Detailed Description

template<class CONCRETE>
class ACE_Based_Pointer_Basic< CONCRETE >

A proxy that keeps track of the relative offset of a "pointer" from its base address. This class makes it possible to transparently use "pointers" in shared memory as easily as programming with pointers to local memory. In particular, we don't need to ensure that the base addresses of all the pointers are mapped into separate processes at the same absolute memory base address.

Constructor & Destructor Documentation

◆ ACE_Based_Pointer_Basic() [1/5]

This constructor initializes the <base_offset_> by asking the <ACE_BASED_POINTER_REPOSITORY> Singleton for the base address of the memory region within which it is instantiated. Two results are possible:

  1. An <ACE_*_Memory_Pool> has stored a base address/size pair and the new based-pointer instance is located between the base address and the base address + size - 1. In this case, the repository returns the base address.
  2. No suitable address/size pair was found. The repository assumes an address in the regular (not mapped) virtual address space of the process and returns 0. In this case, the based-pointer uses its address as an offset to it's base address 0.

◆ ACE_Based_Pointer_Basic() [2/5]

Initialize this object using the initial pointer. This constructor initializes the <base_offset_> by asking the <ACE_BASED_POINTER_REPOSITORY> Singleton for the base address of the memory region within which it is instantiated. Three results are possible:

  1. An <ACE_*_Memory_Pool> has stored a base address/size pair and the new based-pointer instance is located between the base address and the base address + size - 1. In this case, the repository returns the base address.
  2. No suitable address/size pair was found. The repository assumes an address in the regular (not mapped) virtual address space of the process and returns 0. In this case, the based-pointer uses its address as an offset to its base address 0.
  3. If initial is 0 then set the value of <target_> to -1, which indicates a "NULL" pointer.

◆ ACE_Based_Pointer_Basic() [3/5]

◆ ACE_Based_Pointer_Basic() [4/5]

◆ ACE_Based_Pointer_Basic() [5/5]

Constructor for know base address. o is only used to resolve overload ambiguity.

Member Function Documentation

◆ addr()

template<class CONCRETE >
CONCRETE * ACE_Based_Pointer_Basic< CONCRETE >::addr ( ) const
inline

Returns the underlying memory address of the smart pointer.

◆ dump()

template<class CONCRETE >
void ACE_Based_Pointer_Basic< CONCRETE >::dump ( ) const

Dump the state of the object.

◆ operator CONCRETE *()

Returns the underlying memory address of the smart pointer.

◆ operator!=()

template<class CONCRETE >
bool ACE_Based_Pointer_Basic< CONCRETE >::operator!= ( const ACE_Based_Pointer_Basic< CONCRETE > & rhs) const
inline

◆ operator*()

◆ operator+=()

◆ operator<()

◆ operator<=()

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ operator==()

◆ operator>()

◆ operator>=()

◆ operator[]()

template<class CONCRETE >
CONCRETE ACE_Based_Pointer_Basic< CONCRETE >::operator[] ( int index) const
inline

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

template<class CONCRETE >
ACE_Based_Pointer_Basic< CONCRETE >::ACE_ALLOC_HOOK_DECLARE

Declare the dynamic allocation hooks.

◆ base_offset_

template<class CONCRETE >
ptrdiff_t ACE_Based_Pointer_Basic< CONCRETE >::base_offset_
protected

Keep track of our offset from the base pointer.

◆ target_

template<class CONCRETE >
ptrdiff_t ACE_Based_Pointer_Basic< CONCRETE >::target_
protected

The documentation for this class was generated from the following files: