|
From: <mar...@us...> - 2010-03-09 22:38:25
|
Revision: 675
http://scstudio.svn.sourceforge.net/scstudio/?rev=675&view=rev
Author: martinnrt
Date: 2010-03-09 22:38:17 +0000 (Tue, 09 Mar 2010)
Log Message:
-----------
Modified Paths:
--------------
trunk/src/check/time/find_block.cpp
trunk/src/check/time/find_block.h
trunk/tests/find_block_test.cpp
Modified: trunk/src/check/time/find_block.cpp
===================================================================
--- trunk/src/check/time/find_block.cpp 2010-03-09 20:31:52 UTC (rev 674)
+++ trunk/src/check/time/find_block.cpp 2010-03-09 22:38:17 UTC (rev 675)
@@ -1,3 +1,20 @@
+/*
+ * 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) 2010 Martin Vodila <fp...@ma...>
+ *
+ * $Id:
+ */
#include "check/time/find_block.h"
@@ -48,8 +65,8 @@
}
}
}
- Block* block= new Block(trav->m_counter_of_blocks, n, n, 0);
- trav->m_list_of_blocks.push_back(*block);
+ Block block= Block(trav->m_counter_of_blocks, n, n, 0);
+ trav->m_list_of_blocks.push_back(block);
trav->m_last_block=trav->m_counter_of_blocks;
trav->m_open_constraints.insert(node_constraints.begin(), node_constraints.end());
}
@@ -72,19 +89,31 @@
//erase constraint from open constraints, if same one is in node constraints
trav->m_open_constraints.erase(it);
node_constraints.erase(it_2);
+ std::set<TimeRelationRefNodePtr>::iterator it=trav->m_open_constraints.begin();
+ std::set<TimeRelationRefNodePtr>::iterator it_2=node_constraints.begin();
}
}
}
trav->m_open_constraints.insert(node_constraints.begin(), node_constraints.end());
}
}
- else if (!(dynamic_cast<ConnectionNode*>(v)
- || dynamic_cast<StartNode*>(v)
- || dynamic_cast<EndNode*>(v)
- || dynamic_cast<ConditionNode*>(v)))
+ else if (dynamic_cast<EndNode*>(v)!=NULL)
{
- throw std::runtime_error("Unknown type");
+ for (std::list<Block>::iterator it = trav->m_list_of_blocks.begin(); it != trav->m_list_of_blocks.end(); it++) //iterate blocks
+ {
+ if (((*it).get_if_end()==0)&&((*it).get_number()==trav->m_last_block)) //find the right one, and check if end node has been set
+ {
+ (*it).set_if_end(1); //close changing end_node of last_block
+ continue;
+ }
+ }
}
+ else if (!(dynamic_cast<ConnectionNode*>(v)
+ || dynamic_cast<StartNode*>(v)
+ || dynamic_cast<ConditionNode*>(v)))
+ {
+ throw std::runtime_error("Unknown type");
+ }
}
Modified: trunk/src/check/time/find_block.h
===================================================================
--- trunk/src/check/time/find_block.h 2010-03-09 20:31:52 UTC (rev 674)
+++ trunk/src/check/time/find_block.h 2010-03-09 22:38:17 UTC (rev 675)
@@ -1,3 +1,20 @@
+/*
+ * 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) 2010 Martin Vodila <fp...@ma...>
+ *
+ * $Id:
+ */
#ifndef _FIND_BLOCK_H
#define _FIND_BLOCK_H
Modified: trunk/tests/find_block_test.cpp
===================================================================
--- trunk/tests/find_block_test.cpp 2010-03-09 20:31:52 UTC (rev 674)
+++ trunk/tests/find_block_test.cpp 2010-03-09 22:38:17 UTC (rev 675)
@@ -8,7 +8,8 @@
#include <iostream>
-int main(int argc, char** argv) {
+int main(int argc, char** argv)
+{
std::cout << "Test of find_block: " << std::endl;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|