|
From: Gerard F. <ger...@us...> - 2002-03-03 11:18:35
|
Update of /cvsroot/kuml/kuml_old/kuml/data/persistence/factories
In directory usw-pr-cvs1:/tmp/cvs-serv24874/factories
Added Files:
Makefile.am clDataSourceFactory.cpp clDataSourceFactory.h
Log Message:
Fixed problem with last commit. Had forgotten adds/removes (actually
moved files into a new directory/library to correct interdependency
problem).
VS: Modified Files:
VS: XML/clXmlDataSource.cpp
VS: Added Files:
VS: factories/Makefile.am factories/clDataSourceFactory.cpp
VS: factories/clDataSourceFactory.h
VS: Removed Files:
VS: clDataSourceFactory.cpp clDataSourceFactory.h
VS: ----------------------------------------------------------------------
--- NEW FILE ---
####### kdevelop will overwrite this part!!! (begin)##########
INCLUDES = $(all_includes)
libp_factories_a_METASOURCES = USE_AUTOMOC
noinst_LIBRARIES = libp_factories.a
libp_factories_a_SOURCES = clDataSourceFactory.cpp
EXTRA_DIST = clDataSourceFactory.h
####### kdevelop will overwrite this part!!! (end)############
--- NEW FILE ---
#include <exception>
#include "config.h"
#include "clDataSourceFactory.h"
#if defined (HAVE_XML_SUPPORT)
#include "../XML/clXmlDataSource.h"
#include "../XML/clXmlDataSourceFactory.h"
#endif // defined (HAVE_XML_SUPPORT)
clDataSourceFactory *clDataSourceFactory::mvSingleton = 0;
ifDataSource *clDataSourceFactory::meGetDataSource (
const QString &pFormat)
throw (clPersistentOperationException)
{
ifDataSourceFactory *lvDataSourceFactory = 0;
#if defined (HAVE_GNOME_XML)
if ("XML" == pFormat)
{
lvDataSourceFactory =
clXmlDataSourceFactory::meGetDataSourceFactory ();
}
#endif // defined (HAVE_GNOME_XML)
if (0 != lvDataSourceFactory)
{
return (lvDataSourceFactory->meGetDataSource (pFormat));
}
//
// No data sources.
//
throw clPersistentOperationException ();
}
ifDataSourceFactory *clDataSourceFactory::meGetDataSourceFactory ()
throw (clPersistentOperationException)
{
if (0 == mvSingleton)
{
// try
// {
mvSingleton = new clDataSourceFactory;
// }
// catch (...)
// {
// throw clPersistentOperationException ();
// }
}
return (mvSingleton);
}
--- NEW FILE ---
#if !defined (__clDataSourceFactory_h__)
#define __clDataSourceFactory_h__
#include "../ifDataSourceFactory.h"
#include "../../../diagrams/diagram.h"
class clDataSourceFactory : public ifDataSourceFactory
{
private:
static clDataSourceFactory *mvSingleton;
//
// Disabled methods.
//
clDataSourceFactory (const clDataSourceFactory &);
clDataSourceFactory &operator= (const clDataSourceFactory &);
//
// Hidden methods.
//
clDataSourceFactory () {};
virtual ~clDataSourceFactory () {};
public:
static ifDataSourceFactory *meGetDataSourceFactory ()
throw (clPersistentOperationException);
ifDataSource *meGetDataSource (const QString &pFormat)
throw (clPersistentOperationException);
};
#endif // !defined (__clDataSourceFactory_h__)
|