xref: /aoo41x/main/autodoc/source/ary/inc/slots.hxx (revision 1c78a5d6)
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_SLOTS_HXX
25 #define ARY_SLOTS_HXX
26 
27 
28 // USED SERVICES
29 	// BASE CLASSES
30 #include <ary/ceslot.hxx>
31 	// COMPONENTS
32 	// PARAMETERS
33 #include <ary/ary_disp.hxx>
34 #include <ary/types.hxx>
35 #include <ary/sequentialids.hxx>
36 #include <ary/cpp/c_types4cpp.hxx>
37 #include <ary/cpp/c_slntry.hxx>
38 
39 
40 
41 namespace ary
42 {
43 
44 
45 class Slot_Null : public Slot
46 {
47   public:
48 	virtual			   	~Slot_Null();
49 
50     virtual void        StoreAt(
51                             Display &           o_rDestination ) const;
52     virtual uintt       Size() const;
53 
54   private:
55     virtual void        StoreEntries(
56                             Display &           o_rDestination ) const;
57 };
58 
59 class Slot_MapLocalCe : public Slot
60 {
61   public:
62                         Slot_MapLocalCe(
63                             const cpp::Map_LocalCe & i_rData );
64 	virtual			   	~Slot_MapLocalCe();
65     virtual uintt       Size() const;
66 
67   private:
68     virtual void        StoreEntries(
69                             Display &           o_rDestination ) const;
70     // DATA
71     const cpp::Map_LocalCe *
72                         pData;
73 };
74 
75 class Slot_MapOperations : public Slot
76 {
77   public:
78                         Slot_MapOperations(
79                             const std::multimap<String, cpp::Ce_id> &
80                                                 i_rData );
81 	virtual			   	~Slot_MapOperations();
82     virtual uintt       Size() const;
83 
84   private:
85     virtual void        StoreEntries(
86                             Display &           o_rDestination ) const;
87     // DATA
88     const std::multimap<String, cpp::Ce_id> *
89                         pData;
90 };
91 
92 class Slot_ListLocalCe : public Slot
93 {
94   public:
95                         Slot_ListLocalCe(
96                             const cpp::List_LocalCe &
97                                                 i_rData );
98 	virtual			   	~Slot_ListLocalCe();
99 
100     virtual uintt       Size() const;
101 
102   private:
103     virtual void        StoreEntries(
104                             Display &           o_rDestination ) const;
105     // DATA
106     const cpp::List_LocalCe *
107                         pData;
108 };
109 
110 template <class ID>
111 class Slot_SequentialIds : public Slot
112 {
113   public:
Slot_SequentialIds(const SequentialIds<ID> & i_rData)114                         Slot_SequentialIds(
115                             const SequentialIds<ID> &
116                                                 i_rData )
117                             :   pData(&i_rData) {}
118 	virtual			   	~Slot_SequentialIds();
119 
120     virtual uintt       Size() const;
121 
122   private:
123     virtual void        StoreEntries(
124                             Display &           o_rDestination ) const;
125     // DATA
126     const SequentialIds<ID> *
127                         pData;
128 };
129 
130 
131 template <class ID>
~Slot_SequentialIds()132 Slot_SequentialIds<ID>::~Slot_SequentialIds()
133 {
134 }
135 
136 template <class ID>
137 uintt
Size() const138 Slot_SequentialIds<ID>::Size() const
139 {
140  	return pData->Size();
141 }
142 
143 template <class ID>
144 void
StoreEntries(Display & o_rDestination) const145 Slot_SequentialIds<ID>::StoreEntries( Display     & o_rDestination ) const
146 {
147 	for ( typename SequentialIds<ID>::const_iterator it = pData->Begin();
148 		  it != pData->End();
149 		  ++it )
150 	{
151 		o_rDestination.DisplaySlot_Rid( (*it).Value() );
152 	}
153 }
154 
155 
156 
157 
158 }   // namespace ary
159 #endif
160