Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Based_Pointer_T.cpp
blob9a1b64bd756a766f316e6244781a94b6c1579301
1 #ifndef ACE_BASED_POINTER_T_CPP
2 #define ACE_BASED_POINTER_T_CPP
4 #include "ace/Based_Pointer_T.h"
5 #include "ace/Based_Pointer_Repository.h"
6 #include "ace/Log_Category.h"
8 # define ACE_TRACEX(X) ACE_Trace ____ (ACE_TEXT (X), __LINE__, ACE_TEXT (__FILE__))
10 #if !defined (__ACE_INLINE__)
11 #include "ace/Based_Pointer_T.inl"
12 #endif /* __ACE_INLINE__ */
14 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
16 ACE_ALLOC_HOOK_DEFINE_Tc(ACE_Based_Pointer_Basic)
18 template <class CONCRETE>
19 ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer ()
21 ACE_TRACE ("ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer");
24 template <class CONCRETE> void
25 ACE_Based_Pointer_Basic<CONCRETE>::dump () const
27 #if defined (ACE_HAS_DUMP)
28 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::dump");
30 ACELIB_DEBUG ((LM_DEBUG, ACE_BEGIN_DUMP, this));
31 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("\ntarget_ = %d\n"), this->target_));
32 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("base_offset_ = %d\n"), this->base_offset_));
33 ACELIB_DEBUG ((LM_DEBUG, ACE_TEXT ("computed pointer = %x\n"),
34 (CONCRETE *)(ACE_COMPUTE_BASED_POINTER (this))));
35 ACELIB_DEBUG ((LM_DEBUG, ACE_END_DUMP));
36 #endif /* ACE_HAS_DUMP */
39 template <class CONCRETE>
40 ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (CONCRETE *initial)
41 : ACE_Based_Pointer_Basic<CONCRETE> (initial)
43 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
46 template <class CONCRETE>
47 ACE_Based_Pointer<CONCRETE>::ACE_Based_Pointer (const void *base_addr, int)
48 : ACE_Based_Pointer_Basic<CONCRETE> (base_addr, 0)
50 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
53 template <class CONCRETE>
54 ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic ()
55 : target_ (0),
56 base_offset_ (0)
58 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
59 void *base_addr = 0;
61 // Find the base address associated with our <this> pointer. Note
62 // that it's ok for <find> to return 0, which simply indicates that
63 // the address is not in memory-mapped virtual address space.
64 ACE_BASED_POINTER_REPOSITORY::instance ()->find (this,
65 base_addr);
66 this->base_offset_ = (char *) this - (char *) base_addr;
69 template <class CONCRETE>
70 ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (const void *base_addr, int)
71 : target_ (0),
72 base_offset_ (0)
74 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
75 this->base_offset_ = (char *) this - (char *) base_addr;
78 template <class CONCRETE>
79 ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic (CONCRETE *rhs)
80 : target_ (0),
81 base_offset_ (0)
83 ACE_TRACE ("ACE_Based_Pointer_Basic<CONCRETE>::ACE_Based_Pointer_Basic");
85 if (rhs == 0)
86 // Store a value of <target_> that indicate "NULL" pointer.
87 this->target_ = -1;
88 else
90 void *base_addr = 0;
92 // Find the base address associated with the <addr> pointer.
93 // Note that it's ok for <find> to return 0, which simply
94 // indicates that the address is not in memory-mapped virtual
95 // address space.
96 ACE_BASED_POINTER_REPOSITORY::instance ()->find (this,
97 base_addr);
98 this->base_offset_ = (char *) this - (char *) base_addr;
99 this->target_ = ((char *) rhs - (char *) base_addr);
103 ACE_END_VERSIONED_NAMESPACE_DECL
105 #endif /* ACE_BASED_POINTER_T_CPP */