summaryrefslogtreecommitdiff
path: root/TAO/tao/Object_Reference_Const_Sequence_Element_T.h
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tao/Object_Reference_Const_Sequence_Element_T.h')
-rw-r--r--TAO/tao/Object_Reference_Const_Sequence_Element_T.h85
1 files changed, 85 insertions, 0 deletions
diff --git a/TAO/tao/Object_Reference_Const_Sequence_Element_T.h b/TAO/tao/Object_Reference_Const_Sequence_Element_T.h
new file mode 100644
index 00000000000..bd6da2a4915
--- /dev/null
+++ b/TAO/tao/Object_Reference_Const_Sequence_Element_T.h
@@ -0,0 +1,85 @@
+#ifndef guard_object_const_reference_sequence_element_hpp
+#define guard_object_const_reference_sequence_element_hpp
+/**
+ * @file
+ *
+ * @brief Implement the type returned by const operator[] in object_reference
+ * sequences.
+ *
+ * $Id$
+ *
+ * @author Johnny Willemsen
+ */
+#include "tao/Basic_Types.h"
+
+TAO_BEGIN_VERSIONED_NAMESPACE_DECL
+
+namespace TAO
+{
+namespace details
+{
+
+template<typename obj_ref_traits>
+class object_reference_const_sequence_element
+{
+public:
+ typedef typename obj_ref_traits::object_type object_reference_type;
+ typedef object_reference_type * value_type;
+ typedef object_reference_type const * const_value_type;
+ typedef typename obj_ref_traits::object_type_var object_reference_var;
+
+public:
+ object_reference_const_sequence_element(
+ value_type const & e, CORBA::Boolean release)
+ : element_(&e)
+ , release_(release)
+ {
+ }
+
+ object_reference_const_sequence_element(
+ object_reference_const_sequence_element const & rhs)
+ : element_(rhs.element_)
+ , release_(rhs.release_)
+ {
+ }
+
+ ~object_reference_const_sequence_element()
+ {
+ }
+
+ inline operator const_value_type() const
+ {
+ return *element_;
+ }
+
+ inline const object_reference_type * in (void) const {
+ return *this->element_;
+ }
+
+ inline value_type operator->() const
+ {
+ return *this->element_;
+ }
+
+ inline CORBA::Boolean release() const
+ {
+ return this->release_;
+ }
+
+private:
+ // This function is not implemented
+ object_reference_const_sequence_element();
+ object_reference_const_sequence_element & operator=(
+ object_reference_const_sequence_element const & rhs);
+
+private:
+ value_type const * const element_;
+ CORBA::Boolean release_;
+};
+
+} // namespace details
+} // namespace CORBA
+
+TAO_END_VERSIONED_NAMESPACE_DECL
+
+#endif // guard_object_const_reference_sequence_element_hpp