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 /*
00018 * $Log: XSObject.hpp,v $
00019 * Revision 1.12 2004/09/08 13:56:09 peiyongz
00020 * Apache License Version 2.0
00021 *
00022 * Revision 1.11 2004/05/04 19:02:40 cargilld
00023 * Enable IDs to work on all kinds of schema components
00024 *
00025 * Revision 1.10 2003/12/01 23:23:26 neilg
00026 * fix for bug 25118; thanks to Jeroen Witmond
00027 *
00028 * Revision 1.9 2003/11/25 15:10:44 jberry
00029 * Eliminate some compiler warnings concerning comments inside of comments
00030 *
00031 * Revision 1.8 2003/11/21 17:34:04 knoaman
00032 * PSVI update
00033 *
00034 * Revision 1.7 2003/11/15 21:18:39 neilg
00035 * fixes for compilation under gcc
00036 *
00037 * Revision 1.6 2003/11/14 22:47:53 neilg
00038 * fix bogus log message from previous commit...
00039 *
00040 * Revision 1.5 2003/11/14 22:33:30 neilg
00041 * Second phase of schema component model implementation.
00042 * Implement XSModel, XSNamespaceItem, and the plumbing necessary
00043 * to connect them to the other components.
00044 * Thanks to David Cargill.
00045 *
00046 * Revision 1.4 2003/11/06 15:30:04 neilg
00047 * first part of PSVI/schema component model implementation, thanks to David Cargill. This covers setting the PSVIHandler on parser objects, as well as implementing XSNotation, XSSimpleTypeDefinition, XSIDCDefinition, and most of XSWildcard, XSComplexTypeDefinition, XSElementDeclaration, XSAttributeDeclaration and XSAttributeUse.
00048 *
00049 * Revision 1.3 2003/10/24 10:59:26 gareth
00050 * changed C comments to C++ comments to prevent compiler warnings.
00051 * (rephrased that message to eliminate compiler warnings on the message--this is recursive!)
00052 *
00053 * Revision 1.2 2003/10/10 18:37:51 neilg
00054 * update XSModel and XSObject interface so that IDs can be used to query components in XSModels, and so that those IDs can be recovered from components
00055 *
00056 * Revision 1.1 2003/09/16 14:33:36 neilg
00057 * PSVI/schema component model classes, with Makefile/configuration changes necessary to build them
00058 *
00059 */
00060
00061 #if !defined(XSOBJECT_HPP)
00062 #define XSOBJECT_HPP
00063
00064 #include <xercesc/util/PlatformUtils.hpp>
00065 #include <xercesc/framework/psvi/XSConstants.hpp>
00066
00067 XERCES_CPP_NAMESPACE_BEGIN
00068
00077 // forward declarations
00078 class XSNamespaceItem;
00079 class XSModel;
00080
00081 class XSObject : public XMemory
00082 {
00083 public:
00084
00085 // Constructors and Destructor
00086 // -----------------------------------------------------------------------
00089
00097 XSObject
00098 (
00099 XSConstants::COMPONENT_TYPE compType
00100 , XSModel* const xsModel
00101 , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
00102 );
00103
00105
00108 virtual ~XSObject();
00110
00111 //---------------------
00115
00120 XSConstants::COMPONENT_TYPE getType() const;
00121
00126 virtual const XMLCh* getName();
00127
00132 virtual const XMLCh* getNamespace();
00133
00139 virtual XSNamespaceItem *getNamespaceItem();
00140
00147 virtual unsigned int getId() const;
00148
00150
00151 //----------------------------------
00158 void setId(unsigned int id);
00160
00161 private:
00162
00163 // -----------------------------------------------------------------------
00164 // Unimplemented constructors and operators
00165 // -----------------------------------------------------------------------
00166 XSObject(const XSObject&);
00167 XSObject & operator=(const XSObject &);
00168
00169 protected:
00170
00171 // -----------------------------------------------------------------------
00172 // data members
00173 // -----------------------------------------------------------------------
00174 // fMemoryManager:
00175 // used for any memory allocations
00176 // fComponentType
00177 // the type of the actual component
00178XSConstants::COMPONENT_TYPE fComponentType;
00179XSModel* fXSModel;
00180MemoryManager* fMemoryManager;
00181 unsigned int fId;
00182 };
00183
00184 inline XSConstants::COMPONENT_TYPEXSObject::getType() const
00185 {
00186 return fComponentType;
00187 }
00188
00189 XERCES_CPP_NAMESPACE_END
00190
00191 #endif