Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Examples  

AbstractFactory.hpp

00001 #if   !defined(__ABSTRACTFACTORY_HPP)
00002 #define __ABSTRACTFACTORY_HPP
00003 
00004 /*
00005   CoreLinux++ 
00006   Copyright (C) 1999,2000 CoreLinux Consortium
00007   
00008    The CoreLinux++ Library is free software; you can redistribute it and/or
00009    modify it under the terms of the GNU Library General Public License as
00010    published by the Free Software Foundation; either version 2 of the
00011    License, or (at your option) any later version.
00012 
00013    The CoreLinux++ Library Library is distributed in the hope that it will 
00014    be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016    Library General Public License for more details.
00017 
00018    You should have received a copy of the GNU Library General Public
00019    License along with the GNU C Library; see the file COPYING.LIB.  If not,
00020    write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021    Boston, MA 02111-1307, USA.  
00022 */   
00023 
00024 #if   !defined(__COMMON_HPP)
00025 #include <Common.hpp>
00026 #endif
00027 
00028 #if   !defined(__ALLOCATOR_HPP)
00029 #include <Allocator.hpp>
00030 #endif
00031 
00032 #if   !defined(__ALLOCATORNOTFOUNDEXCEPTION_HPP)
00033 #include <AllocatorNotFoundException.hpp>
00034 #endif
00035 
00036 #if   !defined(__ALLOCATORALREADYEXISTSEXCEPTION_HPP)
00037 #include <AllocatorAlreadyExistsException.hpp>
00038 #endif
00039 
00040 #if   !defined(__ASSOCIATIVEITERATOR_HPP)
00041 #include <AssociativeIterator.hpp>
00042 #endif
00043 
00044 #if   !defined(__ITERATOR_HPP)
00045 #include <Iterator.hpp>
00046 #endif
00047 
00048 namespace corelinux
00049 {
00050 
00059    template< class UniqueId >
00060       class AbstractFactory : public CoreLinuxObject
00061       {
00062    
00063       public:
00064    
00065          //
00066          // Constructors and Destructor
00067          //
00068    
00070    
00071                            AbstractFactory( void )
00072                               :
00073                               CoreLinuxObject()
00074                            {
00075                               ;  // do nothing
00076                            }
00077    
00083                            AbstractFactory( const AbstractFactory & )
00084                               :
00085                               CoreLinuxObject()
00086                            {
00087 
00088                            }
00089    
00091    
00092          virtual           ~AbstractFactory( void ) 
00093                            {
00094                               ;  // do nothing
00095                            }
00096    
00097          //
00098          // Operator overloads
00099          //
00100    
00107                   AbstractFactory & operator=( const AbstractFactory & )
00108                   {
00109                      return ( *this );
00110                   }
00111    
00118                   bool  operator==( const AbstractFactory & aRef ) const
00119                   {
00120                      return( this == &aRef );
00121                   }
00122    
00123          //
00124          // Pure virtual accessors
00125          //
00126 
00133          virtual  Count getCreateCount( void ) const = 0;
00134    
00141          virtual  Count getDestroyCount( void ) const = 0;
00142    
00143    
00152          virtual  AllocatorPtr   getAllocator( UniqueId ) const
00153                      throw(AllocatorNotFoundException) = 0;
00154    
00155          //
00156          // Pure virtual mutators
00157          //
00158    
00165          virtual  void  addAllocator( UniqueId, AllocatorPtr )
00166                            throw(AllocatorAlreadyExistsException) = 0;
00167    
00176          virtual  AllocatorPtr   removeAllocator( UniqueId )
00177                                     throw(AllocatorNotFoundException) = 0;
00178    
00179          //
00180          // Iterator factory methods
00181          //
00188          virtual  Iterator<Allocator *> *   createIterator( void ) const = 0;
00189    
00195          virtual  void  destroyIterator( Iterator<Allocator *> * ) const = 0;
00196    
00204          virtual  AssociativeIterator<UniqueId,Allocator *> *   
00205                      createAssociativeIterator( void ) const = 0;
00206    
00213          virtual  void  destroyAssociativeIterator
00214                            ( 
00215                               AssociativeIterator<UniqueId,Allocator *> * 
00216                            ) const = 0;
00217    
00218       };
00219 }
00220 
00221 #endif //   if   !defined(__ABSTRACTFACTORY_HPP)
00222 
00223 /*
00224    Common rcs information do not modify
00225    $Author: prudhomm $
00226    $Revision: 1.1 $
00227    $Date: 2000/04/23 20:43:13 $
00228    $Locker:  $
00229 */
00230 

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