Merge pull request #2216 from jwillemsen/jwi-cxxversionchecks
[ACE_TAO.git] / TAO / tao / Object_Reference_Const_Sequence_Element_T.h
blob8b9b5b4c9ebc833ef6cf28230a0bcdf461941ced
1 #ifndef guard_object_const_reference_sequence_element_hpp
2 #define guard_object_const_reference_sequence_element_hpp
3 /**
4 * @file
6 * @brief Implement the type returned by const operator[] in object_reference
7 * sequences.
9 * @author Johnny Willemsen
11 #include "tao/Basic_Types.h"
13 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
15 namespace TAO
17 namespace details
19 template<typename obj_ref_traits>
20 class object_reference_const_sequence_element
22 public:
23 typedef typename obj_ref_traits::object_type object_reference_type;
24 typedef object_reference_type * value_type;
25 typedef object_reference_type const * const_value_type;
26 typedef typename obj_ref_traits::object_type_var object_reference_var;
28 public:
29 object_reference_const_sequence_element(
30 value_type const & e, CORBA::Boolean release)
31 : element_(&e)
32 , release_(release)
36 object_reference_const_sequence_element(
37 object_reference_const_sequence_element const & rhs)
38 : element_(rhs.element_)
39 , release_(rhs.release_)
43 ~object_reference_const_sequence_element()
47 inline operator object_reference_type * () const
49 return *this->element_;
52 inline object_reference_type * in () const
54 return *this->element_;
57 inline value_type operator->() const
59 return *this->element_;
62 inline CORBA::Boolean release() const
64 return this->release_;
67 private:
68 // This function is not implemented
69 object_reference_const_sequence_element();
70 object_reference_const_sequence_element & operator=(
71 object_reference_const_sequence_element const & rhs);
73 private:
74 value_type const * const element_;
75 CORBA::Boolean const release_;
77 } // namespace details
78 } // namespace CORBA
80 TAO_END_VERSIONED_NAMESPACE_DECL
82 #endif // guard_object_const_reference_sequence_element_hpp