1 : //==============================================================================
2 : // File <$/src/cpp/prod/protocol/giop/reply_header_12.cpp>
3 : // This file is part of YaOrb : Yet Another Object Request Broker,
4 : // Copyright (c) 2000-2003, Marc Alff.
5 : //
6 : // This program is free software; you can redistribute it and/or
7 : // modify it under the terms of the GNU General Public License
8 : // as published by the Free Software Foundation; either version 2
9 : // of the License, or (at your option) any later version.
10 : //
11 : // This program is distributed in the hope that it will be useful,
12 : // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 : // GNU General Public License for more details.
15 : //
16 : // You should have received a copy of the GNU General Public License
17 : // along with this program; if not, write to the Free Software
18 : // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 : //
20 : //==============================================================================
21 :
22 : #include <yaorb/CORBA.h>
23 : #include <yaorb/YAORB.h>
24 :
25 : #include "src/cpp/prod/protocol/giop/reply_header_12.h"
26 : #include "src/cpp/prod/protocol/cdr/msg.h"
27 :
28 : static void cdr_ReplyStatusType(YAORB::CDR *cdrs,
29 : GIOP12ReplyHeader::ReplyStatusType *data)
30 : {
31 : CORBA::ULong tmp ;
32 :
33 2 : switch (cdrs->Op())
34 : {
35 : case YAORB::CDR_READ:
36 : {
37 2 : cdrs->cdr_ULong( & tmp) ;
38 2 : *data = (GIOP12ReplyHeader::ReplyStatusType) tmp ;
39 2 : break ;
40 : }
41 : case YAORB::CDR_WRITE:
42 : {
43 0 : tmp = (CORBA::ULong) (*data) ;
44 0 : cdrs->cdr_ULong( & tmp) ;
45 : break ;
46 : }
47 : }
48 :
49 2 : if (tmp > 5)
50 : {
51 1 : ThrowMarshal(cdrs) ;
52 : }
53 : }
54 :
55 2 : GIOP12ReplyHeader::GIOP12ReplyHeader()
56 : : _request_id(0),
57 : _reply_status(NO_EXCEPTION),
58 2 : _service_context()
59 : {}
60 :
61 2 : GIOP12ReplyHeader::~GIOP12ReplyHeader()
62 : {}
63 :
64 2 : void GIOP12ReplyHeader::cdr(YAORB::CDR *cdrs)
65 : {
66 2 : cdrs->cdr_ULong( & _request_id) ;
67 2 : cdr_ReplyStatusType(cdrs, & _reply_status) ;
68 : _service_context.cdr(cdrs) ;
69 : }
70 :
71 : CORBA::ULong
72 1 : GIOP12ReplyHeader::GetRequestId(void) const
73 : {
74 : return _request_id ;
75 : }
76 :
77 : GIOP12ReplyHeader::ReplyStatusType
78 1 : GIOP12ReplyHeader::GetReplyStatus(void) const
79 : {
80 : return _reply_status ;
81 : }
82 :
83 : const IOP::ServiceContextList&
84 0 : GIOP12ReplyHeader::GetServiceContext(void) const
85 : {
86 : return _service_context ;
87 : }
88 :
|