|
From: <ba...@us...> - 2008-04-08 19:34:59
|
Revision: 17
http://scstudio.svn.sourceforge.net/scstudio/?rev=17&view=rev
Author: babicaj
Date: 2008-04-08 12:34:50 -0700 (Tue, 08 Apr 2008)
Log Message:
-----------
Previous version of structure supported traversing events only at same instance - there wasn't any information in Event.m_matching_event how to recognize successors of the matching events. Current version should support traversing events across instances and doesn't lose any information from previous version.
Modified Paths:
--------------
trunk/src/data/counted_ptr.h
trunk/src/data/msc.h
trunk/src/data/msc_modifications.h
Modified: trunk/src/data/counted_ptr.h
===================================================================
--- trunk/src/data/counted_ptr.h 2008-04-08 11:29:14 UTC (rev 16)
+++ trunk/src/data/counted_ptr.h 2008-04-08 19:34:50 UTC (rev 17)
@@ -39,6 +39,9 @@
class counted_ptr
{
public:
+
+ void doNothing();
+
counted_ptr()
{
m_pointer = NULL;
Modified: trunk/src/data/msc.h
===================================================================
--- trunk/src/data/msc.h 2008-04-08 11:29:14 UTC (rev 16)
+++ trunk/src/data/msc.h 2008-04-08 19:34:50 UTC (rev 17)
@@ -31,6 +31,8 @@
class StartNode;
class Instance;
class Event;
+class StrictEvent;
+class GeneralEvent;
class Msc;
class BMsc;
class HMsc;
@@ -39,8 +41,6 @@
class StrictOrderArea;
class GeneralOrderArea;
class InstanceArea;
-template <class T> class Dag;
-template <class T> class DagNode;
typedef counted_ptr<Msc> MscPtr;
@@ -61,6 +61,12 @@
typedef counted_ptr<Event> EventPtr;
typedef std::list<EventPtr> EventPtrList;
+typedef counted_ptr<StrictEvent> StrictEventPtr;
+typedef std::list<StrictEventPtr> StrictEventPtrList;
+
+typedef counted_ptr<GeneralEvent> GeneralEventPtr;
+typedef std::list<GeneralEventPtr> GeneralEventPtrList;
+
typedef counted_ptr<MscMessage> MscMessagePtr;
typedef counted_ptr<EventArea> EventAreaPtr;
@@ -72,55 +78,7 @@
typedef counted_ptr<GeneralOrderArea> GeneralOrderAreaPtr;
-
/**
- * Node of directed acyclic graph.
- */
-template <class T>
-class DagNode{
-
- /**
- * Object which is contained in this DagNode.
- */
- T m_content;
-
- /**
- * Successors of this node.
- */
- std::list<T> m_successors;
-};
-
-/**
- * Directed acyclic graph.
- */
-template <class T>
-class Dag
-{
-public:
- /**
- * Pointered alternative to DagNode.
- */
- typedef counted_ptr<DagNode<T> > DagNodePtr;
-
- /**
- * List of pointered DagNodes.
- */
- typedef std::list<DagNodePtr> DagNodePtrList;
-
- /**
- * Set of pointered DagNodes.
- */
- typedef std::set<DagNodePtr> DagNodePtrSet;
-
-private:
- /**
- * Events which aren't successors of any other events.
- */
- DagNodePtrList m_minimal_events;
-
-};
-
-/**
* Represents virtual base class for BMsc and HMsc.
*/
class Msc
@@ -256,7 +214,7 @@
/**
* List of Events which occure in this area.
*/
- EventPtrList m_events;
+ StrictEventPtr m_first;
};
/**
@@ -266,9 +224,9 @@
{
/**
- * Directed acyclic graph representing events' ordering.
+ * Events which aren't successors of any other events.
*/
- Dag<EventPtr> m_events;
+ GeneralEventPtrList m_minimal_events;
};
/**
@@ -312,7 +270,7 @@
};
/**
- * Event which occures at process.
+ * Event which occures in EventArea.
*/
class Event
{
@@ -333,5 +291,27 @@
EventPtr m_matching_event;
};
+/**
+ * Event occuring in StrictOrderArea
+ */
+class StrictEvent: public Event
+{
+ /**
+ * Successor of this event
+ */
+ StrictEventPtr m_successor;
+};
+
+/**
+ * Event occuring in GeneralOrderArea
+ */
+class GeneralEvent: public Event
+{
+ /**
+ * Successors of this event
+ */
+ GeneralEventPtrList m_successors;
+};
+
#endif /* _MSC_H */
Modified: trunk/src/data/msc_modifications.h
===================================================================
--- trunk/src/data/msc_modifications.h 2008-04-08 11:29:14 UTC (rev 16)
+++ trunk/src/data/msc_modifications.h 2008-04-08 19:34:50 UTC (rev 17)
@@ -32,6 +32,12 @@
typedef counted_ptr<MscModification> MscModificationPtr;
typedef std::set<MscModificationPtr> MscModificationPtrSet;
+typedef counted_ptr<GeneralEvent> GeneralEventPtr;
+typedef std::set<GeneralEventPtr> GeneralEventPtrSet;
+
+typedef counted_ptr<StrictEvent> StrictEventPtr;
+typedef std::set<StrictEventPtr> StrictEventPtrSet;
+
/**
* Container of modifications.
*
@@ -86,9 +92,14 @@
StrictOrderAreaPtr m_previous;
/**
- * New order of events.
+ * Events with modified successor.
*/
- EventPtrList m_events;
+ StrictEventPtrSet m_modified_events;
+
+ /**
+ * New first event.
+ */
+ StrictEventPtr m_first;
};
@@ -105,12 +116,12 @@
/**
* Events which are newly minimimal in modified version.
*/
- Dag<Event>::DagNodePtrSet m_minimal_events;
+ GeneralEventPtrSet m_minimal_events;
/**
* Events with modified successors.
*/
- Dag<Event>::DagNodePtrSet m_modified_events;
+ GeneralEventPtrSet m_modified_events;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|