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 "Attribute.h"
00023 
00024 enum HEADER_BLOCK_STD_ATTR_TYPE 
00025 {   ROLE_NEXT=1, ROLE_NONE=2, 
00026     ROLE_ULTIMATE_RECEIVER=3, 
00027     ACTOR=4, MUST_UNDERSTAND_TRUE= 5, 
00028     MUST_UNDERSTAND_FALSE=6
00029 };
00030 
00031 
00043 /*
00044  * Revision 1.1  2004/05/26 samisa
00045  * Added copy constructor and clone
00046  */
00047 
00048 /*
00049  * Revision 1.2  2004/06/13 roshan
00050  * Added doxygen comments to help autobuild API docs
00051  */
00052 
00053 /*
00054  * Revision 1.12  2004/06/13 susantha
00055  * Added support for writing C web services and handlers
00056  */
00057 
00058 typedef struct {
00059         const BasicNode* (AXISCALL* getFirstChild)(void* pObj);
00060         /*add all other API functions here*/
00061 } HeaderBlockFunctions;
00062 
00063 #ifdef __cplusplus
00064 
00065 class IHeaderBlock
00066 {
00067 public:
00068     virtual const BasicNode* getFirstChild() =0;
00074     virtual int getNoOfChildren() =0;
00075 
00103     virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE,  
00104         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00105         AxisChar* pachValue) = 0;
00106 
00128     virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE, 
00129         AxisChar *pachLocalName, AxisChar *pachPrefix, AxisChar *pachUri, 
00130         AxisChar* pachValue) = 0;
00131 
00161     virtual Attribute* createStdAttribute(HEADER_BLOCK_STD_ATTR_TYPE 
00162         eStdAttrType, SOAP_VERSION eSOAP_VERSION) =0;
00163 
00174     virtual Attribute* createAttribute(const AxisChar* localname, 
00175         const AxisChar* prefix, 
00176         const AxisChar* uri, const AxisChar* value) = 0;
00177 
00187     virtual Attribute* createAttribute(const AxisChar *localname, 
00188         const AxisChar *prefix, const AxisChar *value) = 0;
00189 
00202     virtual BasicNode* createImmediateChild(NODE_TYPE eNODE_TYPE) = 0;
00203 
00218     virtual BasicNode* createChild(NODE_TYPE eNODE_TYPE)=0;
00219 
00227     virtual const BasicNode* getLastChild() = 0;
00228 
00237     virtual const BasicNode* getChild(int iChildPosition) = 0;
00238 
00245     virtual int addChild(BasicNode* pBasicNode)=0;
00246 
00252     virtual void setLocalName(const AxisChar* localname)=0;
00253 
00259     virtual void setUri(const AxisChar* uri)=0;
00260 
00261     /*
00262       * Sets the prefix of this Header Block.
00263       *
00264       * @param prefix The prefix to set in.
00265       */
00266         /* Commented by Susantha - 21/06/2004
00267          * The prefix should be decided by the Serializer at runtime
00268          *
00269     virtual void setPrefix(const AxisChar* prefix)=0;
00270         */
00271 #ifdef UNIT_TESTING_ON
00272 
00275     virtual int initializeForTesting() = 0;
00276 #endif
00277     
00278     IHeaderBlock(){/*empty body as there are no member variable*/};
00279 
00280     IHeaderBlock(const IHeaderBlock& rCopy){/*empty body as there are no member variable*/};
00281 
00287     virtual IHeaderBlock* clone() = 0;
00288 
00292     virtual ~IHeaderBlock() {};
00293 
00294         static HeaderBlockFunctions ms_VFtable;
00295         static bool bInitialized;
00296 };
00297 
00298 #endif
00299 
00300 typedef struct { 
00301         void* _object; /* this will be C++ Call Object */
00302         HeaderBlockFunctions* _functions; /* this is the static function table */
00303 } HeaderBlock_C;
00304 
00305 #ifndef __cplusplus
00306 typedef HeaderBlock_C HeaderBlock; 
00307 #endif
00308 
00309 #endif 
00310 

Generated on Tue Jun 29 09:27:56 2004 for AxisC++ by doxygen1.2.18