CoreLinux++  0.4.32
TransparentComponent.hpp
1 #if !defined (__TRANSPARENTCOMPONENT_HPP)
2 #define __TRANSPARENTCOMPONENT_HPP
3 
4 /*
5  CoreLinux++
6  Copyright (C) 1999,2000 CoreLinux Consortium
7 
8  The CoreLinux++ Library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version.
12 
13  The CoreLinux++ Library Library is distributed in the hope that it will
14  be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public
19  License along with the GNU C Library; see the file COPYING.LIB. If not,
20  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  Boston, MA 02111-1307, USA.
22 */
23 
24 #if !defined(__COMMON_HPP)
25 #include <Common.hpp>
26 #endif
27 
28 #if !defined(__COMPONENT_HPP)
29 #include <Component.hpp>
30 #endif
31 
32 #if !defined(__ITERATOR_HPP)
33 #include <Iterator.hpp>
34 #endif
35 
36 #if !defined(__INVALIDCOMPOSITEEXCEPTION_HPP)
37 #include <InvalidCompositeException.hpp>
38 #endif /* __INVALIDCOMPOSITEEXCEPTION_HPP */
39 
40 
41 namespace corelinux
42 {
43  DECLARE_CLASS(InvalidCompositeException);
44 
51  template<class CompImpl>
53  {
54  public:
55 
57 
59  :
60  Component()
61  {
62  ; // do nothing
63  }
64 
70  (
71  const TransparentComponent & aRef
72  )
73  :
74  Component( aRef )
75  {
76  ; // do nothing
77  }
78 
80 
81  virtual ~TransparentComponent( void )
82  {
83  ; // do nothing
84  }
85 
86  //
87  // Operator overloads
88  //
96  {
97  return (*this);
98  }
99 
106  bool operator==
107  (
108  const TransparentComponent & aRef
109  ) const
110  {
111  return (*this = aRef);
112  }
113 
120  bool operator!=
121  (
122  const TransparentComponent & aRef
123  ) const
124  {
125  return !(*this = aRef);
126  }
127 
128  //
129  // Accessors
130  //
131 
132  //
133  // Mutators
134  //
135 
145  virtual void addComponent( CompImpl )
147  {
148  throw InvalidCompositeException(LOCATION);
149  }
150 
160  virtual void removeComponent( CompImpl )
162  {
163  throw InvalidCompositeException(LOCATION);
164  }
165 
166  //
167  // Factories
168  //
169 
182  {
183  throw InvalidCompositeException(LOCATION);
184  }
185 
199  {
200  throw InvalidCompositeException(LOCATION);
201  }
202 
203  };
204 
205 }
206 
207 #endif // if !defined(__TRANSPARENTCOMPONENT_HPP)
208 
209 /*
210  Common rcs information do not modify
211  $Author: prudhomm $
212  $Revision: 1.2 $
213  $Date: 2000/08/31 22:52:20 $
214  $Locker: $
215 */
216 
217 
218 
A TransparentComponent is a templated Component whereas it declares the interface for the objects in ...
Definition: TransparentComponent.hpp:52
virtual void addComponent(CompImpl)
Interface for adding component children to a composition.
Definition: TransparentComponent.hpp:145
virtual Iterator< CompImpl > * createIterator(void)
Interface for creating an Iterator to iterate through the children of a composition.
Definition: TransparentComponent.hpp:180
virtual ~TransparentComponent(void)
Virtual Destructor.
Definition: TransparentComponent.hpp:81
A Component declares the interface for the objects in a composition and implements default behavior...
Definition: Component.hpp:42
virtual void destroyIterator(Iterator< CompImpl > *)
Interface for returning a created Iterator.
Definition: TransparentComponent.hpp:197
InvalidCompositeException is an exception that is usually thrown when a composite operation is attemp...
Definition: InvalidCompositeException.hpp:44
TransparentComponent & operator=(const TransparentComponent &)
Assignment operator overload.
Definition: TransparentComponent.hpp:95
TransparentComponent(void)
Default Constructor.
Definition: TransparentComponent.hpp:58
virtual void removeComponent(CompImpl)
Interface for removing component children from a composition.
Definition: TransparentComponent.hpp:160
Component(void)
Default Constructor.
Definition: Component.cpp:39
The Iterator provides a way to access the elements of an collection type sequentially without exposin...
Definition: Iterator.hpp:44

This is the CoreLinux++ reference manual
Provided by The CoreLinux Consortium