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_IT_XNAMEROOM_HXX
25 #define ARY_IDL_IT_XNAMEROOM_HXX
26 
27 // BASE CLASSES
28 #include <ary/idl/i_type.hxx>
29 #include <nametreenode.hxx>
30 
31 
32 
33 
34 namespace ary
35 {
36 namespace idl
37 {
38 
39 
40 /** A namespace for ->Type s, as they are explicitely written in code.
41 
42     The search/identification string is usually the local name of
43     the Type. But for templated structs, the search string has this
44     pattern:
45                 <LocalName> '<' <StringOfTemplateTypeId>
46 */
47 class ExplicitNameRoom : public Type
48 {
49   public:
50     enum E_ClassId { class_id = 2204 };
51 
52     // LIFECYCLE
53                         ExplicitNameRoom();
54                         ExplicitNameRoom(
55                             const String &      i_sName,
56                             const ExplicitNameRoom &
57                                                 i_rParent );
58     virtual             ~ExplicitNameRoom();
59 
60     // OPERATIONS
61     /** @param i_sSearchString
62                 A local type name  usually.
63                 For templated types see class docu.
64         @see ExplicitNameRoom
65     */
Add_Name(const String & i_sSearchString,Type_id i_nId)66     void                Add_Name(
67                             const String &      i_sSearchString,
68                             Type_id             i_nId )
69                             { aImpl.Add_Name(i_sSearchString,i_nId); }
70     // INQUIRY
Name() const71     const String &      Name() const            { return aImpl.Name(); }
Depth() const72     intt                Depth() const           { return aImpl.Depth(); }
73     void                Get_FullName(
74                             StringVector &      o_rText,
75                             Ce_idList *         o_pRelatedCes,
76                             const Gate &        i_rGate ) const;
IsAbsolute() const77     bool                IsAbsolute() const      { return Depth() > 0
78                                                     ?   (*NameChain_Begin()).empty()
79                                                     :   false; }
80     /** @param i_sSearchString
81                 A local type name  usually.
82                 For templated types see class docu.
83         @see ExplicitNameRoom
84     */
Search_Name(const String & i_sSearchString) const85     Type_id             Search_Name(
86                             const String &      i_sSearchString ) const
87                             { return aImpl.Search_Name(i_sSearchString); }
88 
89     StringVector::const_iterator
NameChain_Begin() const90                         NameChain_Begin() const
91                             { return aImpl.NameChain_Begin(); }
92     StringVector::const_iterator
NameChain_End() const93                         NameChain_End() const
94                             { return aImpl.NameChain_End(); }
95   private:
96     // Interface csv::ConstProcessorClient:
97     virtual void        do_Accept(
98                             csv::ProcessorIfc & io_processor ) const;
99     // Interface Object:
100     virtual ClassId     get_AryClass() const;
101 
102     // Interface Type:
103     virtual void        inq_Get_Text(
104                             StringVector &      o_module,
105                             String &            o_name,
106                             Ce_id &             o_nRelatedCe,
107                             int &               o_nSequemceCount,
108                             const Gate &        i_rGate ) const;
109     // DATA
110     NameTreeNode<Type_id>
111                         aImpl;
112 };
113 
114 
115 
116 
117 }   // namespace idl
118 }   // namespace ary
119 #endif
120