00001 /// \file CATXMLFactory.h 00002 /// \brief XML Factory base 00003 /// \ingroup CAT 00004 /// 00005 /// Copyright (c) 2003-2008 by Michael Ellison. 00006 /// See COPYING.txt for the \ref gaslicense License (MIT License). 00007 /// 00008 // $Author: mikeellison $ 00009 // $Date: 2008-01-21 08:33:12 -0600 (Mon, 21 Jan 2008) $ 00010 // $Revision: $ 00011 // $NoKeywords: $ 00012 00013 00014 #ifndef _CATXMLFACTORY_H_ 00015 #define _CATXMLFACTORY_H_ 00016 00017 #include "CATInternal.h" 00018 #include "CATXMLObject.h" 00019 00020 /// \class CATXMLFactory 00021 /// \brief XML Factory base 00022 /// \ingroup CAT 00023 class CATXMLFactory 00024 { 00025 public: 00026 CATXMLFactory(); 00027 virtual ~CATXMLFactory(); 00028 00029 /// Overridable function to create an object. 00030 /// \param objectType Type of object (XML Tag) 00031 /// \return CATXMLObject* Object created (must be derived from CATXMLObject) 00032 virtual CATXMLObject* CreateObject( const CATWChar* objectType); 00033 00034 /// Called by parser to create an object. 00035 /// 00036 /// \param objectType Type of object (XML Tag) 00037 /// \param attributes Attributes vector 00038 /// \param parent Parent object 00039 /// \param newObject Set to new object on success. 00040 /// \return CATResult CAT_SUCCESS on success. 00041 CATResult Create( const CATWChar* objectType, 00042 CATXMLAttribs* attributes, 00043 CATXMLObject* parent, 00044 CATXMLObject*& newObject); 00045 }; 00046 00047 #endif //_CATXMLFACTORY_H_