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

TypeCodeList.h

Go to the documentation of this file.
00001 // /******************************************************************************\
00002 // *
00003 // * File:          TypeCodeList.h
00004 // * Creation date: June 14, 2001 08:46
00005 // * Author:        ClassBuilder
00006 // *                XXXX
00007 // * Purpose:       Declaration of class 'TypeCodeList'
00008 // *
00009 // * Modifications: @INSERT_MODIFICATIONS(* )
00010 // * June 19, 2001 12:44 WERS
00011 // *     Deleted method 'FindRecursion'
00012 // * June 19, 2001 10:45 WERS
00013 // *     Added method 'FindRecursion'
00014 // *     Updated return type of method 'FindRecursion'
00015 // * June 14, 2001 08:46 WERS
00016 // *     Added method 'DestructorInclude'
00017 // *     Added method 'ConstructorInclude'
00018 // *     Added method 'Exists'
00019 // *     Added method '~TypeCodeList'
00020 // *     Added method 'TypeCodeList'
00021 // *     Added relation 'TypeCodeList <>-->> TypeCodeElm'
00022 // *
00023 // *
00024 // \******************************************************************************/
00025 #ifndef _TYPECODELIST_H
00026 #define _TYPECODELIST_H
00027 
00028 //@START_USER1
00033 /* --------------------------------------------------------------
00034 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl>
00035 
00036 This program is free software; you can redistribute it and/or
00037 modify it under the terms of the GNU General Public License
00038 as published by the Free Software Foundation; either
00039 version 2 of the License, or (at your option) any later
00040 version.
00041 
00042 This program is distributed in the hope that it will be useful,
00043 but WITHOUT ANY WARRANTY; without even the implied warranty of
00044 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00045 GNU General Public License for more details.
00046 
00047 You should have received a copy of the GNU General Public License
00048 along with this program; if not, write to the Free Software
00049 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00050 -------------------------------------------------------------- */
00051 //@END_USER1
00052 
00053 
00054 class TypeCodeList
00055 {
00056     // RELATION_MULTI_OWNED_ACTIVE(TypeCodeList, TypeCodeList, TypeCodeElm, TypeCodeElm)
00057 public:
00058     TypeCodeElm * _firstTypeCodeElm;
00059     TypeCodeElm * _lastTypeCodeElm;
00060     int _countTypeCodeElm;
00061 
00062 protected:
00063     void AddTypeCodeElmFirst(TypeCodeElm* item);
00064     void AddTypeCodeElmLast(TypeCodeElm* item);
00065     void AddTypeCodeElmAfter(TypeCodeElm* item, TypeCodeElm* pos);
00066     void AddTypeCodeElmBefore(TypeCodeElm* item, TypeCodeElm* pos);
00067     void RemoveTypeCodeElm(TypeCodeElm* item);
00068     void ReplaceTypeCodeElm(TypeCodeElm* item, TypeCodeElm* newItem);
00069 
00070 public:
00071     void DeleteAllTypeCodeElm();
00072     TypeCodeElm* GetFirstTypeCodeElm() const;
00073     TypeCodeElm* GetLastTypeCodeElm() const;
00074     TypeCodeElm* GetNextTypeCodeElm(TypeCodeElm* pos) const;
00075     TypeCodeElm* GetPrevTypeCodeElm(TypeCodeElm* pos) const;
00076     int GetTypeCodeElmCount() const;
00077     void MoveTypeCodeElmFirst(TypeCodeElm* item);
00078     void MoveTypeCodeElmLast(TypeCodeElm* item);
00079     void MoveTypeCodeElmAfter(TypeCodeElm* item, TypeCodeElm* pos);
00080     void MoveTypeCodeElmBefore(TypeCodeElm* item, TypeCodeElm* pos);
00081     void SortTypeCodeElm(int (*comp)(TypeCodeElm*, TypeCodeElm*));
00082     
00083     class  TypeCodeElmIterator
00084     {
00085     private:
00086         TypeCodeElm* _refTypeCodeElm;
00087         TypeCodeElm* _prevTypeCodeElm;
00088         TypeCodeElm* _nextTypeCodeElm;
00089         const TypeCodeList* _iterTypeCodeList;
00090         
00091         TypeCodeElmIterator* _prev;
00092         TypeCodeElmIterator* _next;
00093         
00094         int (TypeCodeElm::*_method)() const;
00095         
00096         static TypeCodeElmIterator* _first;
00097         static TypeCodeElmIterator* _last;
00098         
00099     public:
00100         TypeCodeElmIterator(const TypeCodeList* iterTypeCodeList,
00101                          int (TypeCodeElm::*method)() const = 0,
00102                          TypeCodeElm* refTypeCodeElm = 0);
00103         TypeCodeElmIterator(const TypeCodeList& iterTypeCodeList,
00104                          int (TypeCodeElm::*method)() const = 0,
00105                          TypeCodeElm* refTypeCodeElm = 0);
00106         TypeCodeElmIterator(const TypeCodeElmIterator& iterator,
00107                          int (TypeCodeElm::*method)() const = 0);
00108         ~TypeCodeElmIterator();
00109         
00110         TypeCodeElmIterator& operator= (const TypeCodeElmIterator& iterator)
00111         {
00112             _iterTypeCodeList = iterator._iterTypeCodeList;
00113             _refTypeCodeElm = iterator._refTypeCodeElm;
00114             _prevTypeCodeElm = iterator._prevTypeCodeElm;
00115             _nextTypeCodeElm = iterator._nextTypeCodeElm;
00116             _method = iterator._method;
00117             return *this;
00118         }
00119         TypeCodeElm* operator++ ()
00120         {
00121             _nextTypeCodeElm = _iterTypeCodeList->GetNextTypeCodeElm(_nextTypeCodeElm);
00122             if (_method != 0)
00123             {
00124                 while (_nextTypeCodeElm && !(_nextTypeCodeElm->*_method)())
00125                     _nextTypeCodeElm = _iterTypeCodeList->GetNextTypeCodeElm(_nextTypeCodeElm);
00126             }
00127             _refTypeCodeElm = _prevTypeCodeElm = _nextTypeCodeElm;
00128             return _refTypeCodeElm;
00129         }
00130         TypeCodeElm* operator-- ()
00131         {
00132             _prevTypeCodeElm = _iterTypeCodeList->GetPrevTypeCodeElm(_prevTypeCodeElm);
00133             if (_method != 0)
00134             {
00135                 while (_prevTypeCodeElm && !(_prevTypeCodeElm->*_method)())
00136                     _prevTypeCodeElm = _iterTypeCodeList->GetPrevTypeCodeElm(_prevTypeCodeElm);
00137             }
00138             _refTypeCodeElm = _nextTypeCodeElm = _prevTypeCodeElm;
00139             return _refTypeCodeElm;
00140         }
00141         operator TypeCodeElm*() { return _refTypeCodeElm; }
00142         TypeCodeElm* operator-> () { return _refTypeCodeElm; }
00143         TypeCodeElm* Get() { return _refTypeCodeElm; }
00144         void Reset() { _refTypeCodeElm = _prevTypeCodeElm = _nextTypeCodeElm = (TypeCodeElm*)0; }
00145         
00146         int IsLast() { return (_iterTypeCodeList->GetLastTypeCodeElm() == _refTypeCodeElm); }
00147         int IsFirst() { return (_iterTypeCodeList->GetFirstTypeCodeElm() == _refTypeCodeElm); }
00148         
00149         static void Check(TypeCodeElm* itemTypeCodeElm);
00150         static void Check(TypeCodeElm* itemTypeCodeElm, TypeCodeElm* newItemTypeCodeElm);
00151     };
00152 
00153 //@START_USER2
00154 //@END_USER2
00155 
00156 // Members
00157 private:
00158 
00159 protected:
00160 
00161 public:
00162 
00163 // Methods
00164 private:
00165     void ConstructorInclude();
00166     void DestructorInclude();
00167 
00168 protected:
00169 
00170 public:
00171     TypeCodeList();
00172     virtual ~TypeCodeList();
00173     bool Exists(CORBA::TypeCode_ptr tc);
00174 };
00175 
00176 #endif
00177 
00178 
00179 #ifdef CB_INLINES
00180 #ifndef _TYPECODELIST_H_INLINES
00181 #define _TYPECODELIST_H_INLINES
00182 
00183 //@START_USER3
00184 //@END_USER3
00185 
00186 #endif
00187 #endif
00188 

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