You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ro...@apache.org on 2004/03/08 14:22:02 UTC

cvs commit: ws-axis/c/src/soap CharacterElement.cpp ComplexElement.cpp HeaderBlock.cpp

roshan      2004/03/08 05:22:02

  Modified:    c/include/axis/common IHeaderBlock.h
               c/include/axis/soap BasicNode.h CharacterElement.h
                        ComplexElement.h HeaderBlock.h
               c/src/soap CharacterElement.cpp ComplexElement.cpp
                        HeaderBlock.cpp
  Log:
  Made the Header Traversing API methods/objects constant, so that the user will not be able to delete the objects which are traversed
  
  Revision  Changes    Path
  1.6       +3 -3      ws-axis/c/include/axis/common/IHeaderBlock.h
  
  Index: IHeaderBlock.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/common/IHeaderBlock.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- IHeaderBlock.h	28 Feb 2004 06:27:56 -0000	1.5
  +++ IHeaderBlock.h	8 Mar 2004 13:22:02 -0000	1.6
  @@ -83,7 +83,7 @@
   class IHeaderBlock
   {
   public:
  -	virtual BasicNode* getFirstChild() =0;
  +	virtual const BasicNode* getFirstChild() =0;
   	/**
   	 * Returns the number of child elements of this HeaderBlock.
   	 * @return The number of child elements of this HeaderBlock.
  @@ -104,7 +104,7 @@
   	 * @return The last child element is returned if it exists. If the child element 
   	 *  doesn't exsist this method returns NULL.
   	 */
  -	virtual BasicNode* getLastChild() = 0;
  +	virtual const BasicNode* getLastChild() = 0;
   
   	/**
   	 * Returns the child element at the given postion. The user has to check whether the
  @@ -113,7 +113,7 @@
   	 * @return The required child element is returned if it exists. If the child element 
   	 *  doesn't exsist this method returns NULL.
   	 */
  -	virtual BasicNode* getChild(int iChildPosition) = 0;
  +	virtual const BasicNode* getChild(int iChildPosition) = 0;
   
   	virtual int addChild(BasicNode* pBasicNode)=0;
   	virtual void setLocalName(const AxisChar* localname)=0;
  
  
  
  1.5       +5 -5      ws-axis/c/include/axis/soap/BasicNode.h
  
  Index: BasicNode.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/BasicNode.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- BasicNode.h	28 Feb 2004 06:27:56 -0000	1.4
  +++ BasicNode.h	8 Mar 2004 13:22:02 -0000	1.5
  @@ -94,13 +94,13 @@
   	 *  depends on the TYPE of the node.
   	 */
   	virtual int getNoOfChildren() = 0;
  -	virtual BasicNode* getFirstChild() = 0;
  -	virtual BasicNode* getLastChild() = 0;
  -	virtual BasicNode* getChild(int iChildPosition) = 0;
  +	virtual const BasicNode* getFirstChild() const = 0;
  +	virtual const BasicNode* getLastChild() const = 0;
  +	virtual const BasicNode* getChild(int iChildPosition) const = 0;
   	//virtual bool operator ==( const BasicNode &objChEle)=0;
  -	virtual const AxisChar* getValue()=0;
  +	virtual const AxisChar* getValue() const =0;
   	virtual int setValue(const AxisChar* pachValue)=0;
  -	virtual NODE_TYPE getNodeType()=0;
  +	virtual NODE_TYPE getNodeType() const =0;
   	virtual int setURI(const AxisChar* sURI) =0;
   	virtual int addChild(BasicNode* pBasicNode) =0;
   	virtual int setLocalName(const AxisChar* sLocalName) =0;
  
  
  
  1.6       +5 -5      ws-axis/c/include/axis/soap/CharacterElement.h
  
  Index: CharacterElement.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/CharacterElement.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- CharacterElement.h	28 Feb 2004 06:27:56 -0000	1.5
  +++ CharacterElement.h	8 Mar 2004 13:22:02 -0000	1.6
  @@ -81,7 +81,7 @@
   public:
   	bool operator ==( const CharacterElement &objChEle);
   	int setValue(const AxisChar* pachValue);
  -	const AxisChar* getValue();
  +	const AxisChar* getValue() const;
   
   	/**
   	 * This method is overridden to return 0 always because this 
  @@ -97,7 +97,7 @@
   	 *  A user of a CharacterElement should not use this method.
   	 * @return Always return NULL to indicate unsuccessfull operation.
   	 */
  -	BasicNode* getFirstChild() {return NULL;}
  + 	const BasicNode* getFirstChild() const {return NULL;}
   
   	/**
   	 * This method is overridden to return NULL always because this 
  @@ -105,7 +105,7 @@
   	 *  A user of a CharacterElement should not use this method.
   	 * @return Always return NULL to indicate unsuccessfull operation.
   	 */
  -	BasicNode* getLastChild() {return NULL;}
  +	const BasicNode* getLastChild() const {return NULL;}
   
   	/**
   	 * This method is overridden to return NULL always because this 
  @@ -113,7 +113,7 @@
   	 *  A user of a CharacterElement should not use this method.
   	 * @return Always return NULL to indicate unsuccessfull operation.
   	 */
  -	BasicNode* getChild(int iChildPosition) {return NULL;}
  +	const BasicNode* getChild(int iChildPosition) const {return NULL;}
   
   	/**
   	 * This method is overridden to return fail(AXIS_FAIL) always because this 
  @@ -153,7 +153,7 @@
   	 * included to adhere its interface.
   	 */
   	int serialize(SoapSerializer& pSZ, list<AxisChar*>& lstTmpNameSpaceStack) {return AXIS_SUCCESS;}
  -	NODE_TYPE getNodeType();
  +	NODE_TYPE getNodeType() const;
   	CharacterElement(const AxisChar* sValue);
   	CharacterElement();
   	virtual ~CharacterElement();
  
  
  
  1.6       +5 -5      ws-axis/c/include/axis/soap/ComplexElement.h
  
  Index: ComplexElement.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/ComplexElement.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ComplexElement.h	28 Feb 2004 06:27:56 -0000	1.5
  +++ ComplexElement.h	8 Mar 2004 13:22:02 -0000	1.6
  @@ -88,10 +88,10 @@
   	 * @return The number of child elements of this ComplexElement.
   	 */
   	int getNoOfChildren();
  -	BasicNode* getChild(int iChildPosition);
  -	BasicNode* getLastChild();
  -	BasicNode* getFirstChild();
  -	NODE_TYPE getNodeType();
  +	const BasicNode* getChild(int iChildPosition) const;
  +	const BasicNode* getLastChild() const;
  +	const BasicNode* getFirstChild() const;
  +	NODE_TYPE getNodeType() const;
   	int setURI(const AxisChar* pachURI);
   	int addChild(BasicNode* pBasicNode);
   	int setLocalName(const AxisChar* pachLocalName);
  @@ -123,7 +123,7 @@
   	 * @param
   	 * @return Always return NULL to indicate unsuccessful.
   	 */
  -	const AxisChar* getValue() {return NULL;}
  +	const AxisChar* getValue() const {return NULL;}
   
   private:
   	int iNoOfChildren;
  
  
  
  1.7       +3 -3      ws-axis/c/include/axis/soap/HeaderBlock.h
  
  Index: HeaderBlock.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/soap/HeaderBlock.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- HeaderBlock.h	28 Feb 2004 06:27:56 -0000	1.6
  +++ HeaderBlock.h	8 Mar 2004 13:22:02 -0000	1.7
  @@ -125,7 +125,7 @@
   	list<Attribute*> m_namespaceDecls;
   
   public:
  -	BasicNode* getFirstChild();
  +	const BasicNode* getFirstChild();
   	int getNoOfChildren();
   	BasicNode* createChild(NODE_TYPE eNODE_TYPE,  AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, AxisChar* pachValue);
   
  @@ -216,7 +216,7 @@
   	 * @return The last child element is returned if it exists. If the child element 
   	 *  doesn't exsist this method returns NULL.
   	 */
  -	BasicNode* getLastChild();
  +	const BasicNode* getLastChild();
   
   	/**
   	 * Returns the child element at the given postion. The user has to check whether the
  @@ -225,7 +225,7 @@
   	 * @return The required child element is returned if it exists. If the child element 
   	 *  doesn't exsist this method returns NULL.
   	 */
  -	BasicNode* getChild(int iChildPosition);
  +	const BasicNode* getChild(int iChildPosition);
   	int addChild(BasicNode* pBasicNode);
   
   	void setLocalName(const AxisChar* localname);
  
  
  
  1.10      +2 -2      ws-axis/c/src/soap/CharacterElement.cpp
  
  Index: CharacterElement.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/CharacterElement.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CharacterElement.cpp	28 Feb 2004 06:27:56 -0000	1.9
  +++ CharacterElement.cpp	8 Mar 2004 13:22:02 -0000	1.10
  @@ -91,7 +91,7 @@
   	free(m_pachValue);
   }
   
  -NODE_TYPE CharacterElement::getNodeType()
  +NODE_TYPE CharacterElement::getNodeType() const
   {
   	return m_iNodeType;
   }
  @@ -106,7 +106,7 @@
   	}
   }
   
  -const AxisChar* CharacterElement::getValue()
  +const AxisChar* CharacterElement::getValue() const
   {
   	return m_pachValue;
   }
  
  
  
  1.10      +7 -7      ws-axis/c/src/soap/ComplexElement.cpp
  
  Index: ComplexElement.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/ComplexElement.cpp,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ComplexElement.cpp	28 Feb 2004 06:27:56 -0000	1.9
  +++ ComplexElement.cpp	8 Mar 2004 13:22:02 -0000	1.10
  @@ -268,14 +268,14 @@
   	return AXIS_SUCCESS;
   }
   
  -NODE_TYPE ComplexElement::getNodeType()
  +NODE_TYPE ComplexElement::getNodeType() const
   {
   	return m_iNodeType;
   }
   
  -BasicNode* ComplexElement::getFirstChild()
  +const BasicNode* ComplexElement::getFirstChild() const
   {
  -	list<BasicNode*>::iterator itCurrChild= m_children.begin();
  +	list<BasicNode*>::const_iterator itCurrChild= m_children.begin();
   
   	if (itCurrChild != m_children.end()) {		
   		return (*itCurrChild);
  @@ -284,9 +284,9 @@
   	return NULL;
   }
   
  -BasicNode* ComplexElement::getLastChild()
  +const BasicNode* ComplexElement::getLastChild() const
   {
  -	list<BasicNode*>::reverse_iterator ritCurrChild= m_children.rbegin();
  +	list<BasicNode*>::const_reverse_iterator ritCurrChild= m_children.rbegin();
   
   	if (ritCurrChild != m_children.rend()) {		
   		return (*ritCurrChild);
  @@ -295,12 +295,12 @@
   	return NULL;
   }
   
  -BasicNode* ComplexElement::getChild(int iChildPosition)
  +const BasicNode* ComplexElement::getChild(int iChildPosition) const
   {
   	if (iChildPosition > iNoOfChildren) {
   		return NULL;
   	} else {
  -		list<BasicNode*>::iterator itCurrChild= m_children.begin();
  +		list<BasicNode*>::const_iterator itCurrChild= m_children.begin();
   		/*The following is done since the previous line already takes the iterator one step forward */
   		iChildPosition--;
   
  
  
  
  1.13      +3 -3      ws-axis/c/src/soap/HeaderBlock.cpp
  
  Index: HeaderBlock.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/soap/HeaderBlock.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- HeaderBlock.cpp	28 Feb 2004 06:27:56 -0000	1.12
  +++ HeaderBlock.cpp	8 Mar 2004 13:22:02 -0000	1.13
  @@ -294,7 +294,7 @@
   	return AXIS_SUCCESS;
   }
   
  -BasicNode* HeaderBlock::getLastChild()
  +const BasicNode* HeaderBlock::getLastChild()
   {
   	list<BasicNode*>::reverse_iterator ritCurrBasicNode= m_children.rbegin();
   
  @@ -305,7 +305,7 @@
   	return NULL;
   }
   
  -BasicNode* HeaderBlock::getChild(int iChildPosition)
  +const BasicNode* HeaderBlock::getChild(int iChildPosition)
   {
   	if (iChildPosition > iNoOFChildren) {
   		return NULL;
  @@ -529,7 +529,7 @@
   	return iNoOFChildren;
   }
   
  -BasicNode* HeaderBlock::getFirstChild()
  +const BasicNode* HeaderBlock::getFirstChild()
   {
   	list<BasicNode*>::iterator itCurrBasicNode= m_children.begin();