Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

InterfaceRepository.h

Go to the documentation of this file.
00001 // /******************************************************************************\
00002 // *
00003 // * File:          InterfaceRepository.h
00004 // * Creation date: May 25, 2001 11:34
00005 // * Author:        ClassBuilder
00006 // *                XXXX
00007 // * Purpose:       Declaration of class 'SCInterfaceRepository'
00008 // *
00009 // * Modifications: @INSERT_MODIFICATIONS(* )
00010 // * June 06, 2001 12:52 WERS
00011 // *     Added method 'FindInterfaceMethod'
00012 // * May 25, 2001 11:34 WERS
00013 // *     Added method 'DestructorInclude'
00014 // *     Added method 'ConstructorInclude'
00015 // *     Added method '~SCInterfaceRepository'
00016 // *     Added method 'SCInterfaceRepository'
00017 // *     Added relation 'InterfaceRepository(SCInterfaceRepository) <>-->> InterfaceMethod(SCInterfaceMethod)'
00018 // *
00019 // *
00020 // \******************************************************************************/
00021 #ifndef _INTERFACEREPOSITORY_H
00022 #define _INTERFACEREPOSITORY_H
00023 
00024 //@START_USER1
00029 /* --------------------------------------------------------------
00030 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl>
00031 
00032 This program is free software; you can redistribute it and/or
00033 modify it under the terms of the GNU General Public License
00034 as published by the Free Software Foundation; either
00035 version 2 of the License, or (at your option) any later
00036 version.
00037 
00038 This program is distributed in the hope that it will be useful,
00039 but WITHOUT ANY WARRANTY; without even the implied warranty of
00040 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00041 GNU General Public License for more details.
00042 
00043 You should have received a copy of the GNU General Public License
00044 along with this program; if not, write to the Free Software
00045 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00046 -------------------------------------------------------------- */
00047 //@END_USER1
00048 
00049 
00050 class SCInterfaceRepository
00051 {
00052     // RELATION_MULTI_OWNED_ACTIVE(SCInterfaceRepository, InterfaceRepository, SCInterfaceMethod, InterfaceMethod)
00053 public:
00054     SCInterfaceMethod * _firstInterfaceMethod;
00055     SCInterfaceMethod * _lastInterfaceMethod;
00056     int _countInterfaceMethod;
00057 
00058 protected:
00059     void AddInterfaceMethodFirst(SCInterfaceMethod* item);
00060     void AddInterfaceMethodLast(SCInterfaceMethod* item);
00061     void AddInterfaceMethodAfter(SCInterfaceMethod* item, SCInterfaceMethod* pos);
00062     void AddInterfaceMethodBefore(SCInterfaceMethod* item, SCInterfaceMethod* pos);
00063     void RemoveInterfaceMethod(SCInterfaceMethod* item);
00064     void ReplaceInterfaceMethod(SCInterfaceMethod* item, SCInterfaceMethod* newItem);
00065 
00066 public:
00067     void DeleteAllInterfaceMethod();
00068     SCInterfaceMethod* GetFirstInterfaceMethod() const;
00069     SCInterfaceMethod* GetLastInterfaceMethod() const;
00070     SCInterfaceMethod* GetNextInterfaceMethod(SCInterfaceMethod* pos) const;
00071     SCInterfaceMethod* GetPrevInterfaceMethod(SCInterfaceMethod* pos) const;
00072     int GetInterfaceMethodCount() const;
00073     void MoveInterfaceMethodFirst(SCInterfaceMethod* item);
00074     void MoveInterfaceMethodLast(SCInterfaceMethod* item);
00075     void MoveInterfaceMethodAfter(SCInterfaceMethod* item, SCInterfaceMethod* pos);
00076     void MoveInterfaceMethodBefore(SCInterfaceMethod* item, SCInterfaceMethod* pos);
00077     void SortInterfaceMethod(int (*comp)(SCInterfaceMethod*, SCInterfaceMethod*));
00078     
00079     class  InterfaceMethodIterator
00080     {
00081     private:
00082         SCInterfaceMethod* _refInterfaceMethod;
00083         SCInterfaceMethod* _prevInterfaceMethod;
00084         SCInterfaceMethod* _nextInterfaceMethod;
00085         const SCInterfaceRepository* _iterInterfaceRepository;
00086         
00087         InterfaceMethodIterator* _prev;
00088         InterfaceMethodIterator* _next;
00089         
00090         int (SCInterfaceMethod::*_method)() const;
00091         
00092         static InterfaceMethodIterator* _first;
00093         static InterfaceMethodIterator* _last;
00094         
00095     public:
00096         InterfaceMethodIterator(const SCInterfaceRepository* iterInterfaceRepository,
00097                          int (SCInterfaceMethod::*method)() const = 0,
00098                          SCInterfaceMethod* refInterfaceMethod = 0);
00099         InterfaceMethodIterator(const SCInterfaceRepository& iterInterfaceRepository,
00100                          int (SCInterfaceMethod::*method)() const = 0,
00101                          SCInterfaceMethod* refInterfaceMethod = 0);
00102         InterfaceMethodIterator(const InterfaceMethodIterator& iterator,
00103                          int (SCInterfaceMethod::*method)() const = 0);
00104         ~InterfaceMethodIterator();
00105         
00106         InterfaceMethodIterator& operator= (const InterfaceMethodIterator& iterator)
00107         {
00108             _iterInterfaceRepository = iterator._iterInterfaceRepository;
00109             _refInterfaceMethod = iterator._refInterfaceMethod;
00110             _prevInterfaceMethod = iterator._prevInterfaceMethod;
00111             _nextInterfaceMethod = iterator._nextInterfaceMethod;
00112             _method = iterator._method;
00113             return *this;
00114         }
00115         SCInterfaceMethod* operator++ ()
00116         {
00117             _nextInterfaceMethod = _iterInterfaceRepository->GetNextInterfaceMethod(_nextInterfaceMethod);
00118             if (_method != 0)
00119             {
00120                 while (_nextInterfaceMethod && !(_nextInterfaceMethod->*_method)())
00121                     _nextInterfaceMethod = _iterInterfaceRepository->GetNextInterfaceMethod(_nextInterfaceMethod);
00122             }
00123             _refInterfaceMethod = _prevInterfaceMethod = _nextInterfaceMethod;
00124             return _refInterfaceMethod;
00125         }
00126         SCInterfaceMethod* operator-- ()
00127         {
00128             _prevInterfaceMethod = _iterInterfaceRepository->GetPrevInterfaceMethod(_prevInterfaceMethod);
00129             if (_method != 0)
00130             {
00131                 while (_prevInterfaceMethod && !(_prevInterfaceMethod->*_method)())
00132                     _prevInterfaceMethod = _iterInterfaceRepository->GetPrevInterfaceMethod(_prevInterfaceMethod);
00133             }
00134             _refInterfaceMethod = _nextInterfaceMethod = _prevInterfaceMethod;
00135             return _refInterfaceMethod;
00136         }
00137         operator SCInterfaceMethod*() { return _refInterfaceMethod; }
00138         SCInterfaceMethod* operator-> () { return _refInterfaceMethod; }
00139         SCInterfaceMethod* Get() { return _refInterfaceMethod; }
00140         void Reset() { _refInterfaceMethod = _prevInterfaceMethod = _nextInterfaceMethod = (SCInterfaceMethod*)0; }
00141         
00142         int IsLast() { return (_iterInterfaceRepository->GetLastInterfaceMethod() == _refInterfaceMethod); }
00143         int IsFirst() { return (_iterInterfaceRepository->GetFirstInterfaceMethod() == _refInterfaceMethod); }
00144         
00145         static void Check(SCInterfaceMethod* itemInterfaceMethod);
00146         static void Check(SCInterfaceMethod* itemInterfaceMethod, SCInterfaceMethod* newItemInterfaceMethod);
00147     };
00148 
00149 //@START_USER2
00150 //@END_USER2
00151 
00152 // Members
00153 private:
00154 
00155 protected:
00156 
00157 public:
00158 
00159 // Methods
00160 private:
00161     void ConstructorInclude();
00162     void DestructorInclude();
00163 
00164 protected:
00165 
00166 public:
00167     SCInterfaceRepository();
00168     virtual ~SCInterfaceRepository();
00169     SCInterfaceMethod* FindInterfaceMethod(const char* methPath);
00170 };
00171 
00172 #endif
00173 
00174 
00175 #ifdef CB_INLINES
00176 #ifndef _INTERFACEREPOSITORY_H_INLINES
00177 #define _INTERFACEREPOSITORY_H_INLINES
00178 
00179 //@START_USER3
00180 //@END_USER3
00181 
00182 #endif
00183 #endif
00184 

This documentation is part of the "SOAP to CORBA bridge" project
Copyright © 2000 by Lifeline Networks bv.
All rights are reserved.