ACE_Based_Pointer< CONCRETE > Class Template Reference

A smart proxy that keeps track of the relative offset of a "pointer" from its base address. More...

#include <Based_Pointer_T.h>

Inheritance diagram for ACE_Based_Pointer< CONCRETE >:

Inheritance graph
[legend]
Collaboration diagram for ACE_Based_Pointer< CONCRETE >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ACE_Based_Pointer (void)
 ACE_Based_Pointer (CONCRETE *initial)
 ACE_Based_Pointer (const void *base_addr, int dummy)
 ACE_Based_Pointer (const ACE_Based_Pointer< CONCRETE > &)
 Copy constructor (not implemented yet).

void operator= (const ACE_Based_Pointer< CONCRETE > &)
 Assignment operator.

void operator= (CONCRETE *from)
 Pseudo-assignment operator.

CONCRETE * operator-> (void)
 The C++ "delegation operator".


Detailed Description

template<class CONCRETE>
class ACE_Based_Pointer< CONCRETE >

A smart 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 by overloading the C++ delegation operator ->().

Definition at line 159 of file Based_Pointer_T.h.


Constructor & Destructor Documentation

template<class CONCRETE>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Based_Pointer< CONCRETE >::ACE_Based_Pointer void   ) 
 

Constructor. See constructor for ACE_Based_Pointer_Basic for details.

Definition at line 19 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00020 {
00021   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
00022 }

template<class CONCRETE>
ACE_Based_Pointer< CONCRETE >::ACE_Based_Pointer CONCRETE *  initial  ) 
 

Initialize this object using the pointer. See constructor for ACE_Based_Pointer_Basic for details.

Definition at line 40 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00041   : ACE_Based_Pointer_Basic<CONCRETE> (initial)
00042 {
00043   ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
00044 }

template<class CONCRETE>
ACE_Based_Pointer< CONCRETE >::ACE_Based_Pointer const void *  base_addr,
int  dummy
 

Initialize this object with known base_addr. dummy is a dummy value used to resolve overload ambiguity and it otherwise ignored.

Definition at line 47 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00048   : ACE_Based_Pointer_Basic<CONCRETE> (base_addr, 0)
00049 {
00050   ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
00051 }

template<class CONCRETE>
ACE_Based_Pointer< CONCRETE >::ACE_Based_Pointer const ACE_Based_Pointer< CONCRETE > &   ) 
 

Copy constructor (not implemented yet).

Definition at line 112 of file Based_Pointer_T.cpp.

References ACE_ASSERT, and ACE_TRACE.

00113   : ACE_Based_Pointer_Basic<CONCRETE> (rhs)
00114 {
00115   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
00116   ACE_ASSERT (0); // not implemented.
00117 }


Member Function Documentation

template<class CONCRETE>
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE CONCRETE * ACE_Based_Pointer< CONCRETE >::operator-> void   ) 
 

The C++ "delegation operator".

Definition at line 11 of file Based_Pointer_T.inl.

References ACE_COMPUTE_BASED_POINTER, and ACE_TRACE.

00012 {
00013   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator->");
00014   return reinterpret_cast<CONCRETE *> (ACE_COMPUTE_BASED_POINTER (this));
00015 }

template<class CONCRETE>
ACE_INLINE void ACE_Based_Pointer< CONCRETE >::operator= CONCRETE *  from  ) 
 

Pseudo-assignment operator.

Reimplemented from ACE_Based_Pointer_Basic< CONCRETE >.

Definition at line 30 of file Based_Pointer_T.inl.

References ACE_TRACE.

00031 {
00032   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator =");
00033   if (rhs == 0)
00034     // Store a value of <target_> that indicate "NULL" pointer.
00035     this->target_ = -1;
00036   else
00037     this->target_ = ((char *) rhs
00038                      - ((char *) this - this->base_offset_));
00039 }

template<class CONCRETE>
ACE_INLINE void ACE_Based_Pointer< CONCRETE >::operator= const ACE_Based_Pointer< CONCRETE > &   ) 
 

Assignment operator.

Definition at line 133 of file Based_Pointer_T.inl.

References ACE_TRACE, and ACE_Based_Pointer_Basic< CONCRETE >::addr().

00134 {
00135   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator=");
00136   *this = rhs.addr ();
00137 }


The documentation for this class was generated from the following files:
Generated on Thu Nov 9 11:20:18 2006 for ACE by doxygen 1.3.6