Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

ACE_Based_Pointer 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:

Inheritance graph
[legend]
Collaboration diagram for ACE_Based_Pointer:

Collaboration graph
[legend]
List of all members.

Public Methods

 ACE_Based_Pointer (void)
 Constructor. See constructor for <ACE_Based_Pointer_Basic> for details. More...

 ACE_Based_Pointer (CONCRETE *initial)
 Initialize this object using the <initial> pointer. See constructor for <ACE_Based_Pointer_Basic> for details. More...

 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. More...

 ACE_Based_Pointer (const ACE_Based_Pointer< CONCRETE > &)
 Copy constructor (not implemented yet). More...

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

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

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


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 157 of file Based_Pointer_T.h.


Constructor & Destructor Documentation

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

Constructor. See constructor for <ACE_Based_Pointer_Basic> for details.

Definition at line 17 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00018 {
00019   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
00020 }

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

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

Definition at line 35 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00036   : ACE_Based_Pointer_Basic<CONCRETE> (initial)
00037 {
00038   ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
00039 }

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 42 of file Based_Pointer_T.cpp.

References ACE_TRACE.

00043   : ACE_Based_Pointer_Basic<CONCRETE> (base_addr, 0)
00044 {
00045   ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
00046 }

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

Copy constructor (not implemented yet).

Definition at line 107 of file Based_Pointer_T.cpp.

References ACE_ASSERT, and ACE_TRACE.

00108   : ACE_Based_Pointer_Basic<CONCRETE> (rhs)
00109 {
00110   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
00111   ACE_ASSERT (0); // not implemented.
00112 }


Member Function Documentation

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

The C++ "delegation operator".

Definition at line 7 of file Based_Pointer_T.i.

References ACE_COMPUTE_BASED_POINTER, and ACE_TRACE.

00008 {
00009   ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::operator->");
00010   return (CONCRETE *)(ACE_COMPUTE_BASED_POINTER (this));
00011 }

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

Pseudo-assignment operator.

Reimplemented from ACE_Based_Pointer_Basic.

Definition at line 26 of file Based_Pointer_T.i.

References ACE_TRACE, ACE_Based_Pointer_Basic::base_offset_, and ACE_Based_Pointer_Basic::target_.

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

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

Assignment operator.

Definition at line 131 of file Based_Pointer_T.i.

References ACE_TRACE, and ACE_Based_Pointer_Basic::addr.

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


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 12:46:05 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002