xref: /aoo42x/main/autodoc/inc/ary/ceslot.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_CESLOT_HXX
25 #define ARY_CESLOT_HXX
26 //  KORR_DEPRECATED_3.0
27 
28 
29 // USED SERVICES
30 	// BASE CLASSES
31 	// COMPONENTS
32 	// PARAMETERS
33 
34 namespace ary
35 {
36 
37 class Display;
38 
39 /** Unterscheidungen von Slots
40 
41     Slots:
42     -   ReadWrite or ReadOnly
43     -   ContentType
44         -   Groups
45         -   MemberLink              'EnumValue from Enum' or 'Class from Namespace'
46         -   MemberData              'Parameter from Operation'
47         -   SimpleLink
48         -   CommentedLink           'Baseclass from Class'
49         -   DefaultCommentedLink    'Class from GlobaIndex'
50 */
51 
52 class Slot
53 {
54   public:
~Slot()55 	virtual			   	~Slot() {}
56 
57     virtual void        StoreAt(
58                             Display     &       o_rDestination ) const;
59     virtual uintt       Size() const = 0;
60 
61   private:
62     virtual void        StoreEntries(
63                             Display     &       o_rDestination ) const = 0;
64 };
65 
66 class Slot_AutoPtr
67 {
68   public:
Slot_AutoPtr(Slot * i_pSlot=0)69                         Slot_AutoPtr(
70                             Slot *              i_pSlot = 0 )
71                                                 :   pSlot(i_pSlot) {}
~Slot_AutoPtr()72                         ~Slot_AutoPtr()         { if (pSlot != 0) delete pSlot; }
73 
operator =(Slot * i_pSlot)74     Slot_AutoPtr &      operator=(
75                             Slot *              i_pSlot )
76                                                 { if (pSlot != 0) delete pSlot;
77                                                   pSlot = i_pSlot;
78                                                   return *this; }
79                         operator bool() const   { return pSlot != 0; }
80 
operator *()81     const Slot &        operator*()             { csv_assert(pSlot != 0);
82                                                   return *pSlot; }
operator ->()83     const Slot *        operator->()            { csv_assert(pSlot != 0);
84                                                   return pSlot; }
85 
86   private:
87     // Forbidden functions
88                         Slot_AutoPtr(const Slot_AutoPtr &);
89     Slot_AutoPtr &      operator=(const Slot_AutoPtr &);
90 
91     // DATA
92     Slot *              pSlot;
93 };
94 
95 
96 
97 
98 }   // namespace ary
99 #endif
100