1%%--------------------------------------------------------------------
2%%
3%% %CopyrightBegin%
4%%
5%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
6%%
7%% Licensed under the Apache License, Version 2.0 (the "License");
8%% you may not use this file except in compliance with the License.
9%% You may obtain a copy of the License at
10%%
11%%     http://www.apache.org/licenses/LICENSE-2.0
12%%
13%% Unless required by applicable law or agreed to in writing, software
14%% distributed under the License is distributed on an "AS IS" BASIS,
15%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16%% See the License for the specific language governing permissions and
17%% limitations under the License.
18%%
19%% %CopyrightEnd%
20%%
21%%
22%%----------------------------------------------------------------------
23%% File    : orber_ifr_stringdef.erl
24%% Purpose : Code for Stringdef
25%%----------------------------------------------------------------------
26
27-module(orber_ifr_stringdef).
28
29-export(['_get_def_kind'/1,
30	 destroy/1,
31	 cleanup_for_destroy/1,			%not in CORBA 2.0
32	 '_get_type'/1,
33	 '_get_bound'/1,
34	 '_set_bound'/2
35	]).
36
37-import(orber_ifr_utils,[get_field/2,
38		   set_field/3
39		  ]).
40
41-include("orber_ifr.hrl").
42
43%%%======================================================================
44%%% StringDef (IDLType(IRObject))
45
46%%%----------------------------------------------------------------------
47%%% Interfaces inherited from IRObject
48
49'_get_def_kind'({ObjType,ObjID}) ?tcheck(ir_StringDef, ObjType) ->
50    orber_ifr_irobject:'_get_def_kind'({ObjType,ObjID}).
51
52destroy({ObjType, ObjID}) ?tcheck(ir_StringDef, ObjType) ->
53    F = fun() -> ObjList = cleanup_for_destroy({ObjType, ObjID}),
54		 orber_ifr_irobject:destroy([{ObjType,ObjID} | ObjList])
55	end,
56    orber_ifr_utils:ifr_transaction_write(F).
57
58cleanup_for_destroy({ObjType,ObjID}) ?tcheck(ir_StringDef, ObjType) ->
59    orber_ifr_idltype:cleanup_for_destroy({ObjType,ObjID}).
60
61%%%----------------------------------------------------------------------
62%%%  Interfaces inherited from IDLType
63
64'_get_type'({ObjType, ObjID}) ?tcheck(ir_StringDef, ObjType) ->
65    orber_ifr_idltype:'_get_type'({ObjType, ObjID}).
66
67%%%----------------------------------------------------------------------
68%%% Non-inherited interfaces
69
70'_get_bound'({ObjType, ObjID}) ?tcheck(ir_StringDef, ObjType) ->
71    get_field({ObjType,ObjID},bound).
72
73'_set_bound'({ObjType, ObjID}, EO_Value)
74		      ?tcheck(ir_StringDef, ObjType) ->
75    set_field({ObjType, ObjID}, bound, EO_Value).
76