|
From: <ba...@us...> - 2008-03-09 13:32:34
|
Revision: 6
http://scstudio.svn.sourceforge.net/scstudio/?rev=6&view=rev
Author: babicaj
Date: 2008-03-09 06:32:22 -0700 (Sun, 09 Mar 2008)
Log Message:
-----------
Msc modifications container added.
Modified Paths:
--------------
trunk/src/data/msc.h
trunk/src/data/msc_path.h
Added Paths:
-----------
trunk/src/data/msc_modifications.h
Modified: trunk/src/data/msc.h
===================================================================
--- trunk/src/data/msc.h 2008-03-07 19:06:21 UTC (rev 5)
+++ trunk/src/data/msc.h 2008-03-09 13:32:22 UTC (rev 6)
@@ -16,8 +16,8 @@
* $Id: $
*/
-#ifndef _HMSC_STRUCTURE_H
-#define _HMSC_STRUCTURE_H
+#ifndef _MSC_H
+#define _MSC_H
#include <list>
#include <string>
@@ -127,7 +127,7 @@
class EventArea
{
-}
+};
/**
* EventArea whose events are ordered lineary as they follow each other.
@@ -139,7 +139,7 @@
* List of Events which occure in this area.
*/
EventPtrList m_events;
-}
+};
/**
* EventArea whose events are ordered like directed acyclic graph.
@@ -151,7 +151,7 @@
* Directed acyclic graph representing events' ordering.
*/
Dag<EventPtr> m_events;
-}
+};
/**
* Area of Instance that represents area where Events at this Instance are located.
@@ -164,7 +164,7 @@
*/
EventAreaPtrList m_areas
-}
+};
/**
* Message sent by Instances.
@@ -175,7 +175,7 @@
* Label of message.
*/
string m_label;
-}
+};
/**
* Event which occures at process.
@@ -220,7 +220,7 @@
* Events which aren't successors of any other events.
*/
Dag<T>::DagNodePtrList m_minimal_events;
-}
+};
/**
* Node of directed acyclic graph.
@@ -242,15 +242,7 @@
* Successors of this node.
*/
std::list<T> m_successors;
+};
- /**
- * Used when traversing Dag in a way of depth-first search.
- *
- * Depth-first search is efficient way how to detect eventual
- * cycles which are forbidden in Dag.
- */
- enum{FREE,VISITED,FINISHED} m_color;
-}
+#endif /* _MSC_H */
-#endif /* _HMSC_STRUCTURE_H */
-
Added: trunk/src/data/msc_modifications.h
===================================================================
--- trunk/src/data/msc_modifications.h (rev 0)
+++ trunk/src/data/msc_modifications.h 2008-03-09 13:32:22 UTC (rev 6)
@@ -0,0 +1,143 @@
+/*
+ * scstudio - Sequence Chart Studio
+ * http://scstudio.sourceforge.net
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ * Copyright (c) 2008 Jindra Babica <ba...@ma...>
+ *
+ * $Id: $
+ */
+
+#ifndef _MSC_MODIFICATIONS_H
+#define _MSC_MODIFICATIONS_H
+
+#include "msc.h"
+
+/**
+ * General base class for modification of MSC.
+ */
+class MscModification{
+
+};
+
+/**
+ * Modification of BMsc.
+ *
+ * Used to express modification of BMsc, i.e. new process added,
+ * removed events, added events etc.
+ */
+class BMscModification:public MscModification{
+
+ /**
+ * Old version of BMsc.
+ *
+ * Pointer to previous version of BMsc. If NULL then m_new didn't
+ * have previous version (i.e. m_new is original).
+ */
+ BMscPtr m_old;
+
+ /**
+ * New version of BMsc.
+ *
+ * Pointer to modified version of BMsc. If NULL then original (m_old)
+ * BMsc was removed.
+ */
+ BMscPtr m_new;
+
+};
+
+/**
+ * Modification of HMsc.
+ *
+ * Usefull when either whole HMsc is new or was completly removed
+ * and checking algorithms do not already need to keep results from
+ * previous version for this HMsc.
+ */
+class HMscNodeModification:public MscModification{
+
+ /**
+ * Old version of HMscNode.
+ *
+ * Pointer to previous version of HMscNode. If NULL then m_new didn't
+ * have previous version (i.e. m_new is original).
+ */
+ HMscNodePtr m_old;
+
+ /**
+ * New version of HMscNode.
+ *
+ * Pointer to modified version of HMscNode. If NULL then original (m_old)
+ * HMscNode was removed.
+ */
+ HMscNodePtr m_new;
+
+};
+
+/**
+ * Modification of HMscNode in HMsc.
+ *
+ * Usage of this modification is essential when edges are added
+ * or removed between nodes of HMsc. Such modifications shpouldn't
+ * be described using HMscModification because it would be neccessary
+ * to find out which ones nodes are different from the previous ones.
+ * Such approach would increase computing complexity of checking
+ * algorithms.
+ */
+class HMscModification:public MscModification{
+
+ /**
+ * Old version of HMsc.
+ *
+ * Pointer to previous version of HMsc. If NULL then m_new didn't
+ * have previous version (i.e. m_new is original).
+ */
+ HMscPtr m_old;
+
+ /**
+ * New version of HMsc.
+ *
+ * Pointer to modified version of HMsc. If NULL then original (m_old)
+ * HMsc was removed.
+ */
+ HMscPtr m_new;
+
+};
+
+typedef counted_ptr<MscModification> MscModificationPtr;
+typedef std::set<MscModificationPtr> MscModificationPtrSet;
+
+/**
+ * Container of modifications.
+ *
+ * Encapsulates container of modifications performed in previous
+ * version of Msc. These modifications are ordered in descending
+ * order by level of hierarchical structure which they reside in.
+ * However, modifications can be accessed in both directions.
+ *
+ * Purpose of this container will be seen when we use iterative
+ * type of checking algorithms of particular property of Msc.
+ * This type of algorithms is capable to use results from previous
+ * version of Msc to decrease computing complexity. Withou this
+ * approach (container of modifications) it would be neccessary to
+ * involve searching of modifications into complexity.
+ */
+class MscModificationContainer{
+
+ /**
+ * Container of sorted modifications.
+ */
+ MscModificationPtrSet m_modifications;
+
+};
+
+
+#endif /* _MSC_MODIFICATIONS_H */
+
Modified: trunk/src/data/msc_path.h
===================================================================
--- trunk/src/data/msc_path.h 2008-03-07 19:06:21 UTC (rev 5)
+++ trunk/src/data/msc_path.h 2008-03-09 13:32:22 UTC (rev 6)
@@ -16,8 +16,8 @@
* $Id: $
*/
-#ifndef _PATH_H
-#define _PATH_H
+#ifndef _MSC_PATH_H
+#define _MSC_PATH_H
#include "msc.h"
#include <list>
@@ -76,5 +76,5 @@
PathNodePtr m_path;
};
-#endif /* _PATH_H */
+#endif /* _MSC_PATH_H */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|