TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
Ontology.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003 Copyright (c) 2008 Deepak Chandran
00004 Contact: Deepak Chandran (dchandran1@gmail.com)
00005 See COPYRIGHT.TXT
00006 
00007 This class is used to load and store a set of NodeFamily instances and ConnectionFamily
00008 instances. The families are loaded from RDF files.
00009 
00010 ****************************************************************************/
00011 
00012 #ifndef TINKERCELL_FAMILYONTOLOGY_H
00013 #define TINKERCELL_FAMILYONTOLOGY_H
00014 
00015 #include <QList>
00016 #include <QStringList>
00017 #include <QHash>
00018 
00019 #ifndef TINKERCELLCOREEXPORT
00020 #ifdef Q_WS_WIN
00021 #   if defined(TC_EXPORTS) || defined(TinkerCellCore_EXPORTS)
00022 #       define TINKERCELLCOREEXPORT __declspec(dllexport)
00023 #   else
00024 #       define TINKERCELLCOREEXPORT __declspec(dllimport)
00025 #   endif
00026 #else
00027 #    define TINKERCELLCOREEXPORT
00028 #endif
00029 #endif
00030 
00031 namespace Tinkercell
00032 {
00033         class ItemFamily;
00034         class NodeFamily;
00035         class ConnectionFamily;
00036         
00040         class TINKERCELLCOREEXPORT Ontology
00041         {
00042         public:
00047                 static NodeFamily * nodeFamily(const QString&);
00052                 static ConnectionFamily * connectionFamily(const QString&);
00058                 static bool insertNodeFamily(const QString &, NodeFamily * );
00064                 static bool insertConnectionFamily(const QString &, ConnectionFamily *);
00068                 static QList<NodeFamily*> allNodeFamilies(); 
00072                 static QList<ConnectionFamily*> allConnectionFamilies();
00076                 static QStringList allNodeFamilyNames(); 
00080                 static QStringList allConnectionFamilyNames();
00081 
00087                 static QStringList readNodes(const QString& rdfFile, const QString& format=QString("rdfxml"));
00093                 static QStringList readConnections(const QString& rdfFile, const QString& format=QString("rdfxml"));
00094 
00096                 static void cleanup();
00097         private:
00099                 static QHash<QString, NodeFamily*> nodeFamilies;
00101                 static QHash<QString, ConnectionFamily*> connectionFamilies;
00102         };
00103 }
00104 
00105 #endif
00106 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines