1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #include <precomp.h>
29 #include <ary/idl/i_constgroup.hxx>
30 #include <ary/idl/ik_constgroup.hxx>
31 
32 
33 // NOT FULLY DECLARED SERVICES
34 #include <cosv/tpl/processor.hxx>
35 #include <sci_impl.hxx>
36 
37 
38 namespace ary
39 {
40 namespace idl
41 {
42 
43 
44 ConstantsGroup::ConstantsGroup( const String &      i_sName,
45                                 Ce_id               i_nModule )
46     :   sName(i_sName),
47         nModule(i_nModule),
48         aConstants()
49 {
50 }
51 
52 ConstantsGroup::~ConstantsGroup()
53 {
54 }
55 
56 void
57 ConstantsGroup::do_Accept( csv::ProcessorIfc & io_processor ) const
58 {
59     csv::CheckedCall(io_processor, *this);
60 }
61 
62 ClassId
63 ConstantsGroup::get_AryClass() const
64 {
65     return class_id;
66 }
67 
68 const String &
69 ConstantsGroup::inq_LocalName() const
70 {
71     return sName;
72 }
73 
74 Ce_id
75 ConstantsGroup::inq_NameRoom() const
76 {
77     return nModule;
78 }
79 
80 Ce_id
81 ConstantsGroup::inq_Owner() const
82 {
83     return nModule;
84 }
85 
86 E_SightLevel
87 ConstantsGroup::inq_SightLevel() const
88 {
89     return sl_File;
90 }
91 
92 
93 namespace ifc_constgroup
94 {
95 
96 inline const ConstantsGroup &
97 constgroup_cast( const CodeEntity & i_ce )
98 {
99     csv_assert( i_ce.AryClass() == ConstantsGroup::class_id );
100 	return static_cast< const ConstantsGroup& >(i_ce);
101 }
102 
103 void
104 attr::Get_Constants( Dyn_CeIterator &    o_result,
105                      const CodeEntity &  i_ce )
106 {
107     o_result = new SCI_Vector<Ce_id>(constgroup_cast(i_ce).aConstants);
108 }
109 
110 } // namespace ifc_constgroup
111 
112 
113 }   //  namespace   idl
114 }   //  namespace   ary
115