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

ParamList.h

Go to the documentation of this file.
00001 // /******************************************************************************\
00002 // *
00003 // * File:          ParamList.h
00004 // * Creation date: May 17, 2001 11:37
00005 // * Author:        ClassBuilder
00006 // *                XXXX
00007 // * Purpose:       Declaration of class 'SCParamList'
00008 // *
00009 // * Modifications: @INSERT_MODIFICATIONS(* )
00010 // * June 15, 2001 14:44 WERS
00011 // *     Updated interface of method 'SCParamList'
00012 // * June 08, 2001 09:36 WERS
00013 // *     Updated interface of method 'SCParamList'
00014 // * May 18, 2001 10:41 WERS
00015 // *     Updated interface of method 'ConstructorInclude'
00016 // *     Updated interface of method 'SCParamList'
00017 // *     Updated relation 'Invocation(SCInvocation) <>--> ParamList(SCParamList)'
00018 // *     Updated relation 'ParamList(SCParamList) <>-->> ParamValue(SCParamValue)'
00019 // * May 17, 2001 11:37 WERS
00020 // *     Added method 'DestructorInclude'
00021 // *     Added method 'ConstructorInclude'
00022 // *     Added method '~SCParamList'
00023 // *     Added method 'SCParamList'
00024 // *     Added relation 'Invocation(SCInvocation) <>--> ParamList(SCParamList)'
00025 // *     Added relation 'ParamList(SCParamList) <>-->> ParamValue(SCParamValue)'
00026 // *
00027 // *
00028 // \******************************************************************************/
00029 #ifndef _PARAMLIST_H
00030 #define _PARAMLIST_H
00031 
00032 //@START_USER1
00037 /* --------------------------------------------------------------
00038 Copyright (C) 2001 LifeLine Networks BV <soap2corba@lifeline.nl>
00039 
00040 This program is free software; you can redistribute it and/or
00041 modify it under the terms of the GNU General Public License
00042 as published by the Free Software Foundation; either
00043 version 2 of the License, or (at your option) any later
00044 version.
00045 
00046 This program is distributed in the hope that it will be useful,
00047 but WITHOUT ANY WARRANTY; without even the implied warranty of
00048 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00049 GNU General Public License for more details.
00050 
00051 You should have received a copy of the GNU General Public License
00052 along with this program; if not, write to the Free Software
00053 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00054 -------------------------------------------------------------- */
00055 //@END_USER1
00056 
00057 
00061 class SCParamList
00062 {
00063     // RELATION_MULTI_OWNED_ACTIVE(SCParamList, ParamList, SCParamValue, ParamValue)
00064 public:
00065     SCParamValue * _firstParamValue;
00066     SCParamValue * _lastParamValue;
00067     int _countParamValue;
00068 
00069 protected:
00070     void AddParamValueFirst(SCParamValue* item);
00071     void AddParamValueLast(SCParamValue* item);
00072     void AddParamValueAfter(SCParamValue* item, SCParamValue* pos);
00073     void AddParamValueBefore(SCParamValue* item, SCParamValue* pos);
00074     void RemoveParamValue(SCParamValue* item);
00075     void ReplaceParamValue(SCParamValue* item, SCParamValue* newItem);
00076 
00077 public:
00078     void DeleteAllParamValue();
00079     SCParamValue* GetFirstParamValue() const;
00080     SCParamValue* GetLastParamValue() const;
00081     SCParamValue* GetNextParamValue(SCParamValue* pos) const;
00082     SCParamValue* GetPrevParamValue(SCParamValue* pos) const;
00083     int GetParamValueCount() const;
00084     void MoveParamValueFirst(SCParamValue* item);
00085     void MoveParamValueLast(SCParamValue* item);
00086     void MoveParamValueAfter(SCParamValue* item, SCParamValue* pos);
00087     void MoveParamValueBefore(SCParamValue* item, SCParamValue* pos);
00088     void SortParamValue(int (*comp)(SCParamValue*, SCParamValue*));
00089     
00090     class  ParamValueIterator
00091     {
00092     private:
00093         SCParamValue* _refParamValue;
00094         SCParamValue* _prevParamValue;
00095         SCParamValue* _nextParamValue;
00096         const SCParamList* _iterParamList;
00097         
00098         ParamValueIterator* _prev;
00099         ParamValueIterator* _next;
00100         
00101         int (SCParamValue::*_method)() const;
00102         
00103         static ParamValueIterator* _first;
00104         static ParamValueIterator* _last;
00105         
00106     public:
00107         ParamValueIterator(const SCParamList* iterParamList,
00108                          int (SCParamValue::*method)() const = 0,
00109                          SCParamValue* refParamValue = 0);
00110         ParamValueIterator(const SCParamList& iterParamList,
00111                          int (SCParamValue::*method)() const = 0,
00112                          SCParamValue* refParamValue = 0);
00113         ParamValueIterator(const ParamValueIterator& iterator,
00114                          int (SCParamValue::*method)() const = 0);
00115         ~ParamValueIterator();
00116         
00117         ParamValueIterator& operator= (const ParamValueIterator& iterator)
00118         {
00119             _iterParamList = iterator._iterParamList;
00120             _refParamValue = iterator._refParamValue;
00121             _prevParamValue = iterator._prevParamValue;
00122             _nextParamValue = iterator._nextParamValue;
00123             _method = iterator._method;
00124             return *this;
00125         }
00126         SCParamValue* operator++ ()
00127         {
00128             _nextParamValue = _iterParamList->GetNextParamValue(_nextParamValue);
00129             if (_method != 0)
00130             {
00131                 while (_nextParamValue && !(_nextParamValue->*_method)())
00132                     _nextParamValue = _iterParamList->GetNextParamValue(_nextParamValue);
00133             }
00134             _refParamValue = _prevParamValue = _nextParamValue;
00135             return _refParamValue;
00136         }
00137         SCParamValue* operator-- ()
00138         {
00139             _prevParamValue = _iterParamList->GetPrevParamValue(_prevParamValue);
00140             if (_method != 0)
00141             {
00142                 while (_prevParamValue && !(_prevParamValue->*_method)())
00143                     _prevParamValue = _iterParamList->GetPrevParamValue(_prevParamValue);
00144             }
00145             _refParamValue = _nextParamValue = _prevParamValue;
00146             return _refParamValue;
00147         }
00148         operator SCParamValue*() { return _refParamValue; }
00149         SCParamValue* operator-> () { return _refParamValue; }
00150         SCParamValue* Get() { return _refParamValue; }
00151         void Reset() { _refParamValue = _prevParamValue = _nextParamValue = (SCParamValue*)0; }
00152         
00153         int IsLast() { return (_iterParamList->GetLastParamValue() == _refParamValue); }
00154         int IsFirst() { return (_iterParamList->GetFirstParamValue() == _refParamValue); }
00155         
00156         static void Check(SCParamValue* itemParamValue);
00157         static void Check(SCParamValue* itemParamValue, SCParamValue* newItemParamValue);
00158     };
00159 
00160 //@START_USER2
00161 //@END_USER2
00162 
00163 // Members
00164 private:
00165 
00166 protected:
00167 
00168 public:
00169 
00170 // Methods
00171 private:
00172     void ConstructorInclude();
00173     void DestructorInclude();
00174 
00175 protected:
00176 
00177 public:
00178     SCParamList(SCInterfaceMethod* pInterfaceMethod,
00179                 DynamicAny::DynAnyFactory_ptr dynFact);
00180     virtual ~SCParamList();
00181 };
00182 
00183 #endif
00184 
00185 
00186 #ifdef CB_INLINES
00187 #ifndef _PARAMLIST_H_INLINES
00188 #define _PARAMLIST_H_INLINES
00189 
00190 //@START_USER3
00191 //@END_USER3
00192 
00193 #endif
00194 #endif
00195 

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