1 #ifndef guard_mock_reference_hpp
2 #define guard_mock_reference_hpp
6 * @brief Mock an object reference so we can test the sequences in
9 * @author Carlos O'Ryan
11 #include "ace/config-all.h"
13 #include "tao/Basic_Types.h"
15 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
16 // Forward declare the class a CORBA::release function for it. That
17 // avoids having to introduce CORBA::Object into the tests.
18 // Ideally the T_var and T_out types should accept mock objects
19 // too, but that is too much to bite in the current iteration.
23 void release(mock_reference
*);
28 TAO_END_VERSIONED_NAMESPACE_DECL
30 #include "tao/Objref_VarOut_T.h"
32 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
34 typedef mock_reference
*mock_reference_ptr
;
35 typedef TAO_Objref_Var_T
<mock_reference
> mock_reference_var
;
36 typedef TAO_Objref_Out_T
<mock_reference
> mock_reference_out
;
39 * @class mock_reference
41 * @brief Implement a concrete class with the right interface for an
47 virtual ~mock_reference();
49 typedef mock_reference_var _var_type
;
50 typedef mock_reference_out _out_type
;
52 static mock_reference
* allocate(int id
);
53 static mock_reference
* _nil();
55 static mock_reference
* _duplicate(mock_reference
* rhs
);
56 static void _tao_release(mock_reference
* rhs
);
58 inline bool operator==(mock_reference
const & rhs
) const
60 return id_
== rhs
.id_
;
63 inline bool operator!=(mock_reference
const & rhs
) const
65 return !(*this == rhs
);
76 inline mock_reference(int id
)
84 CORBA::Boolean
operator<< (TAO_OutputCDR
&, const mock_reference
*);
85 CORBA::Boolean
operator>> (TAO_InputCDR
&, mock_reference
*&);
90 struct Objref_Traits
< mock_reference
>
92 static mock_reference_ptr
duplicate (mock_reference_ptr
);
93 static void release (mock_reference_ptr
);
94 static mock_reference_ptr
nil (void);
95 static CORBA::Boolean
marshal (const mock_reference_ptr p
, TAO_OutputCDR
& cdr
);
99 TAO_END_VERSIONED_NAMESPACE_DECL
100 #endif // guard_mock_reference_hpp