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

IHeaderBlock.h

00001 /*
00002  *   Copyright 2003-2004 The Apache Software Foundation.
00003  *
00004  *   Licensed under the Apache License, Version 2.0 (the "License");
00005  *   you may not use this file except in compliance with the License.
00006  *   You may obtain a copy of the License at
00007  *
00008  *       http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  *   Unless required by applicable law or agreed to in writing, software
00011  *   distributed under the License is distributed on an "AS IS" BASIS,
00012  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *   See the License for the specific language governing permissions and
00014  *   limitations under the License.
00015  */
00016 
00017 #if !defined(_IHEADERBLOCK_H____OF_AXIS_INCLUDED_)
00018 #define _IHEADERBLOCK_H____OF_AXIS_INCLUDED_
00019 
00020 #include "BasicNode.h"
00021 #include "SoapEnvVersions.h"
00022 #include <axis/IAttribute.h>
00023 
00024 #ifdef __cplusplus
00025 
00026 AXIS_CPP_NAMESPACE_START
00027 
00028 class Attribute;
00029 
00030 AXIS_CPP_NAMESPACE_END
00031 
00032 #endif
00033 
00034 enum HEADER_BLOCK_STD_ATTR_TYPE 
00035 {   ROLE_NEXT=1, ROLE_NONE=2, 
00036     ROLE_ULTIMATE_RECEIVER=3, 
00037     ACTOR=4, MUST_UNDERSTAND_TRUE= 5, 
00038     MUST_UNDERSTAND_FALSE=6
00039 };
00040 
00041 
00053 /*
00054  * Revision 1.1  2004/05/26 samisa
00055  * Added copy constructor and clone
00056  */
00057 
00058 /*
00059  * Revision 1.2  2004/06/13 roshan
00060  * Added doxygen comments to help autobuild API docs
00061  */
00062 
00063 /*
00064  * Revision 1.12  2004/06/13 susantha
00065  * Added support for writing C web services and handlers
00066  */
00067 AXIS_CPP_NAMESPACE_START
00068 typedef struct {
00069         const BasicNode* (AXISCALL* getFirstChild)(void* pObj);
00070         /*add all other API functions here*/
00071 } HeaderBlockFunctions;
00072 AXIS_CPP_NAMESPACE_END
00073 #ifdef __cplusplus
00074 AXIS_CPP_NAMESPACE_START
00075 class IHeaderBlock
00076 {
00077 public:
00085     virtual int addNamespaceDecl(IAttribute *pAttribute)=0;
00086 
00095     virtual IAttribute* createNamespaceDecl(const AxisChar *prefix, 
00096             const AxisChar *uri)=0; 
00097 
00098     virtual const BasicNode* getFirstChild() =0;
00104     virtual int getNoOfChildren() =0;
00105 
00133     virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE,  
00134         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00135         AxisChar* pachValue) = 0;
00136 
00158     virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, 
00159         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00160         AxisChar* pachValue) = 0;
00161 
00191     virtual Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
00192         eStdAttrType, SOAP_VERSION eSOAP_VERSION) =0;
00193 
00204     virtual Attribute* createAttribute(const AxisChar* localname, 
00205         const AxisChar* prefix, 
00206         const AxisChar* uri, const AxisChar* value) = 0;
00207 
00217     virtual Attribute* createAttribute(const AxisChar *localname, 
00218         const AxisChar *prefix, const AxisChar *value) = 0;
00227      virtual const AxisChar* getAttributeValue(const AxisChar* localname,
00228          const AxisChar* prefix) = 0;
00229  
00230 
00243     virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE) = 0;
00244 
00259     virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE)=0;
00260 
00268     virtual const BasicNode* getLastChild() = 0;
00269 
00278     virtual const BasicNode* getChild(int iChildPosition) = 0;
00279 
00286     virtual int addChild(BasicNode* pBasicNode)=0;
00287 
00293     virtual void setLocalName(const AxisChar* localname)=0;
00294 
00300     virtual void setUri(const AxisChar* uri)=0;
00301 
00302     /*
00303       * Sets the prefix of this Header Block.
00304       *
00305       * @param prefix The prefix to set in.
00306       */
00307         /* Commented by Susantha - 21/06/2004
00308          * The prefix should be decided by the Serializer at runtime
00309          *
00310     virtual void setPrefix(const AxisChar* prefix)=0;
00311         */
00312 #ifdef UNIT_TESTING_ON
00313 
00316     virtual int initializeForTesting() = 0;
00317 #endif
00318     
00319     IHeaderBlock(){/*empty body as there are no member variable*/};
00320 
00321     IHeaderBlock(const IHeaderBlock& rCopy){/*empty body as there are no member variable*/};
00322 
00328     virtual IHeaderBlock* clone() = 0;
00329 
00333     virtual ~IHeaderBlock() {};
00334 
00335         static HeaderBlockFunctions ms_VFtable;
00336         static bool bInitialized;
00337 };
00338 AXIS_CPP_NAMESPACE_END
00339 #endif
00340 AXIS_CPP_NAMESPACE_START
00341 typedef struct { 
00342         void* _object; /* this will be C++ Call Object */
00343         HeaderBlockFunctions* _functions; /* this is the static function table */
00344 } HeaderBlock_C;
00345 AXIS_CPP_NAMESPACE_END
00346 #ifndef __cplusplus
00347 typedef HeaderBlock_C HeaderBlock; 
00348 #endif
00349 
00350 #endif 
00351 

Generated on Wed Aug 18 11:42:23 2004 for AxisC++ by doxygen1.2.18