[opengtl-commits] [611] rename KernelsCollection to SourceCollections

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 611
Author:   cyrille
Date:     2009-03-13 21:37:42 +0100 (Fri, 13 Mar 2009)

Log Message:
-----------
rename KernelsCollection to SourceCollections

Modified Paths:
--------------
    trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt

Added Paths:
-----------
    trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.cpp
    trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.h

Removed Paths:
-------------
    trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.cpp
    trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.h


Modified: trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt	2009-03-13 20:37:12 UTC (rev 610)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt	2009-03-13 20:37:42 UTC (rev 611)
@@ -5,6 +5,7 @@
 set(OpenShiva_SRCS
   Kernel.cpp
   Source.cpp
+  SourcesCollection.cpp
 # Internal files
   Compiler_p.cpp
   CodeGenerator_p.cpp
@@ -17,7 +18,6 @@
   Kernel_p.cpp
   Library.cpp
   LibrariesManager.cpp
-  KernelsCollection.cpp
 # Metadata
   MetadataLexer_p.cpp
   MetadataParser_p.cpp
@@ -49,10 +49,11 @@
 install(TARGETS OpenShiva  DESTINATION ${LIB_INSTALL_DIR} )
 install( FILES
   Kernel.h
-  KernelsCollection.h
   Library.h
   LibrariesManager.h
   Metadata.h
+  Source.h
+  SourcesCollection.h
   Version.h
   DESTINATION ${INCLUDE_INSTALL_DIR}/OpenShiva )
 

Deleted: trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.cpp	2009-03-13 20:37:12 UTC (rev 610)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.cpp	2009-03-13 20:37:42 UTC (rev 611)
@@ -1,85 +0,0 @@
-/*
- *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * either version 2, or (at your option) any later version of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "KernelsCollection.h"
-
-// LLVM
-#include <llvm/System/Path.h>
-
-#include "GTLCore/String.h"
-#include "GTLCore/Macros_p.h"
-#include "GTLCore/Utils_p.h"
-
-#include "Debug.h"
-#include "Kernel.h"
-
-using namespace OpenShiva;
-
-struct KernelsCollection::Private {
-  std::list< Kernel* > kernels;
-  int channelsNb;
-  void addDirectory( const llvm::sys::Path& path );
-};
-
-
-void KernelsCollection::Private::addDirectory( const llvm::sys::Path& path )
-{
-  std::set< llvm::sys::Path > content;
-  path.getDirectoryContents( content, 0 );
-  foreach( const llvm::sys::Path& path, content )
-  {
-    if( GTLCore::String( path.getSuffix() ).toLower() == "shiva" )
-    {
-      Kernel* kernel = new Kernel( channelsNb );
-      kernel->loadFromFile( path.c_str() );
-      kernels.push_back( kernel );
-    }
-  }
-}
-
-KernelsCollection::KernelsCollection(int _channelsNb ) : d(new Private)
-{
-  GTL_ASSERT( _channelsNb > 0);
-  d->channelsNb = _channelsNb;
-  addDirectory( _OPENSHIVA_SHIVA_KERNELS_DIR_ );
-  d->addDirectory( llvm::sys::Path::GetUserHomeDirectory() );
-}
-
-KernelsCollection::~KernelsCollection()
-{
-  GTLCore::deleteAll( d->kernels );
-  delete d;
-}
-
-void KernelsCollection::addDirectory(const GTLCore::String& directory)
-{
-  d->addDirectory( llvm::sys::Path( directory ) );
-}
-
-void KernelsCollection::registerKernel( Kernel* kernel )
-{
-  d->kernels.push_back( kernel );
-}
-
-const std::list< Kernel* >& KernelsCollection::kernels() const
-{
-  return d->kernels;
-}
-
-

Deleted: trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.h
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.h	2009-03-13 20:37:12 UTC (rev 610)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.h	2009-03-13 20:37:42 UTC (rev 611)
@@ -1,62 +0,0 @@
-/*
- *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * either version 2, or (at your option) any later version of the License.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this library; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#ifndef _OPENSHIVA_KERNELS_COLLECTION_H_
-#define _OPENSHIVA_KERNELS_COLLECTION_H_
-
-#include <list>
-
-namespace GTLCore {
-  class String;
-}
-
-namespace OpenShiva {
-  class Kernel;
-  /**
-   * @ingroup OpenShiva
-   * 
-   * This class allows to access to the list of kernels installed in the system.
-   * 
-   * The collection will look for .shiva files in:
-   * ${PREFIX}/share/OpenGTL/shiva/kernels
-   * ${HOME}/.OpenGTL/shiva/kernels
-   */
-  class KernelsCollection {
-    public:
-      KernelsCollection( int _channelsNb );
-      ~KernelsCollection();
-      /**
-       * Add custom directories
-       */
-      void addDirectory(const GTLCore::String& directory);
-      /**
-       * Manually register a Kernel in the collection.
-       */
-      void registerKernel( Kernel* );
-      /**
-       * @return the list of kernels in the collection
-       */
-      const std::list< Kernel* >& kernels() const;
-    private:
-      struct Private;
-      Private* const d;
-  };
-}
-
-#endif

Copied: trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.cpp (from rev 609, trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.cpp)
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.cpp	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.cpp	2009-03-13 20:37:42 UTC (rev 611)
@@ -0,0 +1,82 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "SourcesCollection.h"
+
+// LLVM
+#include <llvm/System/Path.h>
+
+#include "GTLCore/String.h"
+#include "GTLCore/Macros_p.h"
+#include "GTLCore/Utils_p.h"
+
+#include "Debug.h"
+#include "Source.h"
+
+using namespace OpenShiva;
+
+struct SourcesCollection::Private {
+  std::list< Source* > kernels;
+  void addDirectory( const llvm::sys::Path& path );
+};
+
+
+void SourcesCollection::Private::addDirectory( const llvm::sys::Path& path )
+{
+  std::set< llvm::sys::Path > content;
+  path.getDirectoryContents( content, 0 );
+  foreach( const llvm::sys::Path& path, content )
+  {
+    if( GTLCore::String( path.getSuffix() ).toLower() == "shiva" )
+    {
+      Source* kernel = new Source( );
+      kernel->loadFromFile( path.c_str() );
+      kernels.push_back( kernel );
+    }
+  }
+}
+
+SourcesCollection::SourcesCollection() : d(new Private)
+{
+  addDirectory( _OPENSHIVA_SHIVA_KERNELS_DIR_ );
+  d->addDirectory( llvm::sys::Path::GetUserHomeDirectory() );
+}
+
+SourcesCollection::~SourcesCollection()
+{
+  GTLCore::deleteAll( d->kernels );
+  delete d;
+}
+
+void SourcesCollection::addDirectory(const GTLCore::String& directory)
+{
+  d->addDirectory( llvm::sys::Path( directory ) );
+}
+
+void SourcesCollection::registerSource( Source* kernel )
+{
+  d->kernels.push_back( kernel );
+}
+
+const std::list< Source* >& SourcesCollection::sources() const
+{
+  return d->kernels;
+}
+
+


Property changes on: trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.cpp
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native

Copied: trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.h (from rev 609, trunk/OpenGTL/OpenShiva/OpenShiva/KernelsCollection.h)
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.h	                        (rev 0)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.h	2009-03-13 20:37:42 UTC (rev 611)
@@ -0,0 +1,62 @@
+/*
+ *  Copyright (c) 2008 Cyrille Berger <cberger@xxxxxxxxxxx>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * either version 2, or (at your option) any later version of the License.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; see the file COPYING.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef _OPENSHIVA_KERNELS_COLLECTION_H_
+#define _OPENSHIVA_KERNELS_COLLECTION_H_
+
+#include <list>
+
+namespace GTLCore {
+  class String;
+}
+
+namespace OpenShiva {
+  class Source;
+  /**
+   * @ingroup OpenShiva
+   * 
+   * This class allows to access to the list of kernels installed in the system.
+   * 
+   * The collection will look for .shiva files in:
+   * ${PREFIX}/share/OpenGTL/shiva/kernels
+   * ${HOME}/.OpenGTL/shiva/kernels
+   */
+  class SourcesCollection {
+    public:
+      SourcesCollection( );
+      ~SourcesCollection();
+      /**
+       * Add custom directories
+       */
+      void addDirectory(const GTLCore::String& directory);
+      /**
+       * Manually register a Kernel in the collection.
+       */
+      void registerSource( Source* );
+      /**
+       * @return the list of kernels in the collection
+       */
+      const std::list< Source* >& sources() const;
+    private:
+      struct Private;
+      Private* const d;
+  };
+}
+
+#endif


Property changes on: trunk/OpenGTL/OpenShiva/OpenShiva/SourcesCollection.h
___________________________________________________________________
Name: svn:keywords
   + Id
Name: svn:mergeinfo
   + 
Name: svn:eol-style
   + native


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/