|
From: <sar...@us...> - 2013-07-25 16:07:42
|
Revision: 18267
http://sourceforge.net/p/sbml/code/18267
Author: sarahkeating
Date: 2013-07-25 16:07:38 +0000 (Thu, 25 Jul 2013)
Log Message:
-----------
Gave the filters separate code and header files
Modified Paths:
--------------
trunk/libsbml/src/sbml/util/IdFilter.h
trunk/libsbml/src/sbml/util/MetaIdFilter.h
Added Paths:
-----------
trunk/libsbml/src/sbml/util/IdFilter.cpp
trunk/libsbml/src/sbml/util/MetaIdFilter.cpp
Added: trunk/libsbml/src/sbml/util/IdFilter.cpp
===================================================================
--- trunk/libsbml/src/sbml/util/IdFilter.cpp (rev 0)
+++ trunk/libsbml/src/sbml/util/IdFilter.cpp 2013-07-25 16:07:38 UTC (rev 18267)
@@ -0,0 +1,64 @@
+/**
+ * @cond doxygen-libsbml-internal
+ *
+ * @file IdFilterFilter.cpp
+ * @brief Filter to return only elements with an id set
+ * @author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * 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. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/util/IdFilter.h>
+#include <sbml/SBase.h>
+
+LIBSBML_CPP_NAMESPACE_BEGIN
+
+IdFilter::IdFilter() : ElementFilter()
+{
+}
+
+
+bool
+IdFilter::filter(const SBase* element)
+{
+ // return in case we don't have a valid element with an id
+ if (element == NULL || element->isSetId() == false)
+ {
+ return false;
+ }
+
+ // otherwise we have an id set and want to keep the element
+ // unless it is a rule or intialAssignment/eventAssignment
+ int tc = element->getTypeCode();
+ if (tc == SBML_ASSIGNMENT_RULE || tc == SBML_RATE_RULE
+ || tc == SBML_INITIAL_ASSIGNMENT || tc == SBML_EVENT_ASSIGNMENT)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+
+LIBSBML_CPP_NAMESPACE_END
+
+/** @endcond */
Modified: trunk/libsbml/src/sbml/util/IdFilter.h
===================================================================
--- trunk/libsbml/src/sbml/util/IdFilter.h 2013-07-25 15:06:31 UTC (rev 18266)
+++ trunk/libsbml/src/sbml/util/IdFilter.h 2013-07-25 16:07:38 UTC (rev 18267)
@@ -37,33 +37,13 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class IdFilter : public ElementFilter
+class LIBSBML_EXTERN IdFilter : public ElementFilter
{
public:
- IdFilter() : ElementFilter()
- {
- }
+ IdFilter();
- virtual bool filter(const SBase* element)
- {
- // return in case we don't have a valid element with an id
- if (element == NULL || element->isSetId() == false)
- {
- return false;
- }
+ virtual bool filter(const SBase* element);
- // otherwise we have an id set and want to keep the element
- // unless it is a rule or intialAssignment/eventAssignment
- int tc = element->getTypeCode();
- if (tc == SBML_ASSIGNMENT_RULE || tc == SBML_RATE_RULE
- || tc == SBML_INITIAL_ASSIGNMENT || tc == SBML_EVENT_ASSIGNMENT)
- {
- return false;
- }
-
- return true;
- }
-
};
LIBSBML_CPP_NAMESPACE_END
Added: trunk/libsbml/src/sbml/util/MetaIdFilter.cpp
===================================================================
--- trunk/libsbml/src/sbml/util/MetaIdFilter.cpp (rev 0)
+++ trunk/libsbml/src/sbml/util/MetaIdFilter.cpp 2013-07-25 16:07:38 UTC (rev 18267)
@@ -0,0 +1,56 @@
+/**
+ * @cond doxygen-libsbml-internal
+ *
+ * @file MetaIdFilterFilter.h
+ * @brief Filter to return only elements with a metaid set
+ * @author Sarah Keating
+ *
+ * <!--------------------------------------------------------------------------
+ * This file is part of libSBML. Please visit http://sbml.org for more
+ * information about SBML, and the latest version of libSBML.
+ *
+ * Copyright (C) 2009-2013 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. EMBL European Bioinformatics Institute (EBML-EBI), Hinxton, UK
+ *
+ * Copyright (C) 2006-2008 by the California Institute of Technology,
+ * Pasadena, CA, USA
+ *
+ * Copyright (C) 2002-2005 jointly by the following organizations:
+ * 1. California Institute of Technology, Pasadena, CA, USA
+ * 2. Japan Science and Technology Agency, Japan
+ *
+ * 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. A copy of the license agreement is provided
+ * in the file named "LICENSE.txt" included with this software distribution
+ * and also available online as http://sbml.org/software/libsbml/license.html
+ * ---------------------------------------------------------------------- -->*/
+
+#include <sbml/util/MetaIdFilter.h>
+#include <sbml/SBase.h>
+
+LIBSBML_CPP_NAMESPACE_BEGIN
+
+MetaIdFilter::MetaIdFilter() : ElementFilter()
+{
+}
+
+
+bool
+MetaIdFilter::filter(const SBase* element)
+{
+ // return in case we don't have a valid element with an id
+ if (element == NULL || element->isSetMetaId() == false)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+
+LIBSBML_CPP_NAMESPACE_END
+
+
+/** @endcond */
Modified: trunk/libsbml/src/sbml/util/MetaIdFilter.h
===================================================================
--- trunk/libsbml/src/sbml/util/MetaIdFilter.h 2013-07-25 15:06:31 UTC (rev 18266)
+++ trunk/libsbml/src/sbml/util/MetaIdFilter.h 2013-07-25 16:07:38 UTC (rev 18267)
@@ -1,7 +1,7 @@
/**
* @cond doxygen-libsbml-internal
*
- * @file MetaMetaIdFilterFilter.h
+ * @file MetaIdFilterFilter.h
* @brief Filter to return only elements with a metaid set
* @author Sarah Keating
*
@@ -37,24 +37,13 @@
LIBSBML_CPP_NAMESPACE_BEGIN
-class MetaIdFilter : public ElementFilter
+class LIBSBML_EXTERN MetaIdFilter : public ElementFilter
{
public:
- MetaIdFilter() : ElementFilter()
- {
- }
+ MetaIdFilter();
- virtual bool filter(const SBase* element)
- {
- // return in case we don't have a valid element with an id
- if (element == NULL || element->isSetMetaId() == false)
- {
- return false;
- }
+ virtual bool filter(const SBase* element);
- return true;
- }
-
};
LIBSBML_CPP_NAMESPACE_END
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|