Revert "Minor modernization of DynamicAny code"
[ACE_TAO.git] / TAO / tao / GIOP_Message_Generator_Parser.cpp
blob6243f4ae2e59135156bf623368da3e4da528f802
1 // -*- C++ -*-
2 #include "tao/GIOP_Message_Generator_Parser.h"
3 #include "tao/Pluggable_Messaging_Utils.h"
4 #include "tao/GIOP_Utils.h"
5 #include "tao/debug.h"
6 #include "tao/CDR.h"
7 #include "ace/Log_Msg.h"
9 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
11 TAO_GIOP_Message_Generator_Parser::~TAO_GIOP_Message_Generator_Parser ()
15 int
16 TAO_GIOP_Message_Generator_Parser::parse_reply (
17 TAO_InputCDR &stream,
18 TAO_Pluggable_Reply_Params &params)
20 // Read the request id
21 if (!stream.read_ulong (params.request_id_))
23 if (TAO_debug_level)
25 TAOLIB_ERROR ((LM_ERROR,
26 ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply :")
27 ACE_TEXT ("extracting request id\n")));
29 return -1;
32 // and the reply status type. status can be NO_EXCEPTION,
33 // SYSTEM_EXCEPTION, USER_EXCEPTION, LOCATION_FORWARD,
34 // LOCATION_FORWARD_PERM
35 CORBA::ULong rep_stat = 0;
36 if (!stream.read_ulong (rep_stat))
38 if (TAO_debug_level > 0)
40 TAOLIB_ERROR ((LM_ERROR,
41 ACE_TEXT ("TAO (%P|%t) : TAO_GIOP_Message_Generator_Parser::parse_reply, ")
42 ACE_TEXT ("extracting reply status\n")));
44 return -1;
47 params.reply_status (static_cast <GIOP::ReplyStatusType> (rep_stat));
49 return 0;
53 int
54 TAO_GIOP_Message_Generator_Parser::parse_locate_reply (
55 TAO_InputCDR &cdr,
56 TAO_Pluggable_Reply_Params &params)
58 // Read the request id
59 if (!cdr.read_ulong (params.request_id_))
61 if (TAO_debug_level > 0)
62 TAOLIB_ERROR ((LM_ERROR,
63 ACE_TEXT ("TAO (%P|%t|%N|%l):parse_locate_reply, ")
64 ACE_TEXT ("extracting request id\n")));
66 return -1;
69 // and the locate reply status type. status can be UNKNOWN_OBJECT,
70 // OBJECT_HERE, OBJECT_FORWARD, OBJECT_FORWARD_PERM
71 // LOC_SYSTEM_EXCEPTION, LOC_NEEDS_ADDRESSING_MODE
73 // Please note here that we are NOT converting to the Pluggable
74 // messaging layer exception as this is GIOP specific. Not many
75 // messaging protocols have the locate_* messages.
76 CORBA::ULong locate_reply_status;
77 if (!cdr.read_ulong (locate_reply_status))
79 if (TAO_debug_level > 0)
80 TAOLIB_ERROR ((LM_ERROR,
81 ACE_TEXT ("TAO N|(%P|%t|l) parse_locate_reply, ")
82 ACE_TEXT ("extracting locate reply status\n")));
84 return -1;
86 params.locate_reply_status (static_cast <GIOP::LocateStatusType> (locate_reply_status));
88 return 0;
91 bool
92 TAO_GIOP_Message_Generator_Parser::is_ready_for_bidirectional () const
94 return false;
97 TAO_END_VERSIONED_NAMESPACE_DECL