1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. 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, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef ARY_IDL_I_MODULE_HXX 25 #define ARY_IDL_I_MODULE_HXX 26 27 // BASE CLASSES 28 #include <ary/idl/i_ce.hxx> 29 30 // USED SERVICES 31 #include <ary/stdconstiter.hxx> 32 33 34 35 36 namespace ary 37 { 38 template <class> class NameTreeNode; 39 40 namespace idl 41 { 42 namespace ifc_module 43 { 44 struct attr; 45 } 46 class Gate; 47 48 49 /** Represents an IDL module. 50 51 "Name" in methods means all code entities which belong into 52 this namespace (not in a subnamespace of this one), but not 53 to the subnamespaces. 54 55 "SubNamespace" in method names refers to all direct subnamespaces. 56 */ 57 class Module : public CodeEntity 58 { 59 public: 60 enum E_ClassId { class_id = 2000 }; 61 62 // LIFECYCLE 63 Module(); 64 Module( 65 const String & i_sName, 66 const Module & i_rParent ); 67 ~Module(); 68 // OPERATIONS 69 void Add_Name( 70 const String & i_sName, 71 Ce_id i_nId ); 72 // INQUIRY 73 Ce_id Search_Name( 74 const String & i_sName ) const; 75 void Get_Names( 76 Dyn_StdConstIterator<Ce_id> & 77 o_rResult ) const; 78 private: 79 // Interface csv::ConstProcessorClient: 80 virtual void do_Accept( 81 csv::ProcessorIfc & io_processor ) const; 82 // Interface ary::Object: 83 virtual ClassId get_AryClass() const; 84 85 // Interface CodeEntity 86 virtual const String & inq_LocalName() const; 87 virtual Ce_id inq_NameRoom() const; 88 virtual Ce_id inq_Owner() const; 89 virtual E_SightLevel inq_SightLevel() const; 90 91 friend struct ifc_module::attr; 92 93 // DATA 94 Dyn< NameTreeNode<Ce_id> > 95 pImpl; 96 }; 97 98 99 inline bool is_Module(const CodeEntity & i_rCe)100is_Module( const CodeEntity & i_rCe ) 101 { 102 return i_rCe.AryClass() == Module::class_id; 103 } 104 105 106 107 108 } // namespace idl 109 } // namespace ary 110 #endif 111