1 : //==============================================================================
2 : // File <$/src/cpp/prod/protocol/giop/locate_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/locate_reply_header_12.h"
26 : #include "src/cpp/prod/protocol/cdr/msg.h"
27 :
28 : static void
29 : cdr_LocateStatusType(
30 : YAORB::CDR *cdrs,
31 : GIOP12LocateReplyHeader::LocateStatusType *data)
32 : {
33 : CORBA::ULong tmp ;
34 :
35 2 : switch (cdrs->Op())
36 : {
37 : case YAORB::CDR_READ:
38 : {
39 2 : cdrs->cdr_ULong( & tmp) ;
40 2 : *data = (GIOP12LocateReplyHeader::LocateStatusType) tmp ;
41 2 : break ;
42 : }
43 : case YAORB::CDR_WRITE:
44 : {
45 0 : tmp = (CORBA::ULong) (*data) ;
46 0 : cdrs->cdr_ULong( & tmp) ;
47 : break ;
48 : }
49 : }
50 :
51 2 : if (tmp > 5)
52 : {
53 1 : ThrowMarshal(cdrs) ;
54 : }
55 : }
56 :
57 2 : GIOP12LocateReplyHeader::GIOP12LocateReplyHeader()
58 2 : : _request_id(0), _locate_status(UNKNOWN_OBJECT)
59 : {}
60 :
61 2 : GIOP12LocateReplyHeader::~GIOP12LocateReplyHeader()
62 2 : {}
63 :
64 2 : void GIOP12LocateReplyHeader::cdr(YAORB::CDR *cdrs)
65 : {
66 2 : cdrs->cdr_ULong(& _request_id) ;
67 2 : cdr_LocateStatusType(cdrs, & _locate_status) ;
68 : }
69 :
70 : CORBA::ULong
71 1 : GIOP12LocateReplyHeader::GetRequestId(void) const
72 : {
73 : return _request_id ;
74 : }
75 :
76 : GIOP12LocateReplyHeader::LocateStatusType
77 1 : GIOP12LocateReplyHeader::GetLocateStatus(void) const
78 : {
79 : return _locate_status ;
80 : }
81 :
|