00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef DATA_VARIANT_FACTORY_H 00011 #define DATA_VARIANT_FACTORY_H 00012 00013 #include "Service.h" 00014 #include "XercesIncludes.h" 00015 00016 #include <string> 00017 00018 using XERCES_CPP_NAMESPACE_QUALIFIER DOMNode; 00019 class DataValueWrapper; 00020 00021 /** 00022 * \ingroup ServiceModule 00023 */ 00024 class DataVariantFactory 00025 { 00026 public: 00027 /** 00028 * Creates a DataValueWrapper object for use in a DataVariant. This method 00029 * is not intended for direct use in client code. 00030 * 00031 * @param pObject 00032 * A pointer to an object to wrap. This object will be passed to 00033 * copy constructor of the new object. If it is NULL, the default 00034 * constructor will be used. 00035 * @param className 00036 * A string containing the class name of the object to be 00037 * wrapped. The supported types are documented under DataVariant. 00038 * The format of the type string can be either that used by 00039 * type_id or that used by TypeConverter. 00040 * @param strict 00041 * If true, a verification error message will be generated if 00042 * a wrapper of the given className cannot be constructed. If 00043 * false, no verification error message will be generated. 00044 * 00045 * @return A pointer to the wrapper. 00046 * 00047 * @see DataVariant::DataVariant() 00048 */ 00049 virtual DataValueWrapper* createWrapper(const void *pObject, const std::string &className, bool strict = true) = 0; 00050 00051 /** 00052 * Creates a DataValueWrapper object for use in a DataVariant. This method 00053 * is not intended for direct use in client code. 00054 * 00055 * @param pDocument 00056 * A pointer to the XML document to read the object from. 00057 * @param version 00058 * The version number of the XML file being read. 00059 * 00060 * @return A pointer to the wrapper. 00061 * 00062 * @see DataVariant::DataVariant() 00063 */ 00064 virtual DataValueWrapper* createWrapper(DOMNode *pDocument, int version) = 0; 00065 00066 protected: 00067 /** 00068 * This will be cleaned up during application close. Plug-ins do not 00069 * need to destroy it. 00070 */ 00071 virtual ~DataVariantFactory() {} 00072 }; 00073 00074 #endif