|
From: <mar...@us...> - 2010-03-07 21:31:43
|
Revision: 669
http://scstudio.svn.sourceforge.net/scstudio/?rev=669&view=rev
Author: martinnrt
Date: 2010-03-07 21:31:37 +0000 (Sun, 07 Mar 2010)
Log Message:
-----------
Removed Paths:
-------------
trunk/src/check/time/find_block.cpp~
trunk/src/check/time/find_block.h~
trunk/tests/acyclic_checker_test
Deleted: trunk/src/check/time/find_block.cpp~
===================================================================
--- trunk/src/check/time/find_block.cpp~ 2010-03-07 21:26:40 UTC (rev 668)
+++ trunk/src/check/time/find_block.cpp~ 2010-03-07 21:31:37 UTC (rev 669)
@@ -1,184 +0,0 @@
-/*
- * 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"
-
-void MyTraverse::on_white_node_found(HMscNode* n)
- {
- //int last_block=trav.m_last_block;
- //TimeRelationEventPtrList open_constraints=trav.m_open_constraints;
- //counter_of_blocks=TraversAndBlocks::counter_of_blocks;
-
- //n.found_with_block_number=last_block;
-
- std::cout << "Tu sme este dosli-WNFL" << std::endl;
-
- n->set_attribute<int>("found_with_block_number",trav->m_last_block);
- //n.found_with_constraints=open_constraints;
- n->set_attribute<TimeRelationRefNodePtrSet>("found_with_open_constraints",trav->m_open_constraints);
- update_constraints(n);
- }
-
-/*void MyTraverse::grey_node_found(HMscNode* n)
-{
-}
-
-void MyTraverse::black_node_found(HMscNode* n)
-{
-}*/
-
-void MyTraverse::on_node_finished(HMscNode* n)
-{
- //int last_block=trav.m_last_block;
- //TimeRelationEventPtrList open_constraints=trav.m_open_constraints;
- //std::list<Block> list_of_blocks=trav.m_list_of_blocks;
- 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_number()==trav->m_last_block) && ((*it).get_if_end()==0)) //find the right one, and check if end node has been set
- {
- (*it).set_end(dynamic_cast<ReferenceNode*>(n)); //if it hasn't, then set it
- (*it).set_if_end(1);
- continue;
- }
- }
- trav->m_last_block=n->get_attribute<int>("found_with_block_number",0);
- trav->m_open_constraints=n->get_attribute<TimeRelationRefNodePtrSet>("found_with_open_constraints",trav->m_open_constraints);
- n->remove_attribute<int>("found_with_block_number");
- n->remove_attribute<TimeRelationRefNodePtrSet>("found_with_open_constraints");
-}
-
-void MyTraverse::update_constraints(HMscNode* v)
-{
- ReferenceNode* n= dynamic_cast<ReferenceNode*>(v);
- TimeRelationRefNodePtrSet node_constraints;
- TimeRelationRefNodePtrSet bottom;
- TimeRelationRefNodePtrSet top;
- //node_constraints=new TimeRelationRefNodePtrSet();
- node_constraints.erase(node_constraints.begin(), node_constraints.end());
-
- if (n!=NULL)
- {
-
-/* std::cout << "Tu sme este dosli2" << std::endl;
-
- n->get_time_relations_bottom();
-
- std::cout << "Tu sme este dosli3" << std::endl;
-
- bottom= n->get_time_relations_bottom();
- top= n->get_time_relations_top();
-
- for (std::set<TimeRelationRefNodePtr>::iterator it = top.begin(); it != top.end(); it++)
- {
- node_constraints.insert(*it);
- }
-
- for (std::set<TimeRelationRefNodePtr>::iterator it = bottom.begin(); it != bottom.end(); it++)
- {
- node_constraints.insert(*it);
- }*/
-
- node_constraints.insert(n->get_time_relations_top().begin(), n->get_time_relations_top().end()); //TODO tunak to hadze seg fault
-
- //std::list<TimeRelationEvent> node_constraints;
- //std::list<TimeRelationEvent> list_of_relations;
- //int last_block=TraversAndMarkBlocks::last_block;
- //TimeRelationEventPtrList open_constraints=TraversAndMarkBlocks::open_constraints;
- //int counter_of_blocks=TraversAndMarkBlocks::counter_of_blocks;
- //std::list<Block> list_of_blocks=TraversAndMarkBlocks::list_of_blocks;
-
- std::cout << "Tu sme este dosli-4" << std::endl;
-
- node_constraints.insert(n->get_time_relations_bottom().begin(), n->get_time_relations_bottom().end());
-
- //node_constraints=v->get_time_relations_top();
- //node_constraints.splice( node_constraints.end() , v->get_time_relations_bottom() );
-
- /*list_of_relations=v.get_time_relations_top(); //nejak zmaknut aby to ziskal node constraints
- for (list<TimeRelationRefNodePtrSet>::iterator it = list_of_relations.begin(); it != list_of_relations.end(); it++)
- {
- if ( it&.get_begin() != it&.get_end() ) node_constraints.push_back(it&);
- }
- list_of_relations=v.get_time_relations_bottom();
- for (list<TimeRelationRefNodePtrSet>::iterator it = list_of_relations.begin(); it != list_of_relations.end(); it++)
- {list<TimeRelationRefNodePtrSet>::iterator it = list_of_relations.begin(); it != list_of_relations.end(); it++
- if ( it&.get_begin() != it&.get_end() ) node_constraints.push_back(it&);
- }
- //node_constraints=constraints_in_v; zjavne kravina :)*/
-
- std::cout << "Tu sme este dosli-5" << std::endl;
-
- if (trav->m_open_constraints.empty())
- {
- trav->m_counter_of_blocks++;
-
- //ukladat pociatocne uzly bloku
- if (trav->m_counter_of_blocks!=0)
- {
- for (std::list<Block>::iterator it = trav->m_list_of_blocks.begin(); it != trav->m_list_of_blocks.end(); it++)
- {
- if (((*it).get_number()==trav->m_last_block)&&((*it).get_if_end()==0))
- {
- (*it).set_if_end(1);
- }
- }
- }
- Block* block= new 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());
- }
- else
- {
- 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_end(n); //if it hasn't, then set it
- continue;
- }
- }
- for (std::set<TimeRelationRefNodePtr>::iterator it = trav->m_open_constraints.begin(); it != trav->m_open_constraints.end(); it++)
- {
- for (std::set<TimeRelationRefNodePtr>::iterator it_2 = node_constraints.begin(); it_2 != node_constraints.end(); it_2++)
- {
- if (*it==*it_2)
- {
- trav->m_open_constraints.erase(it);
- node_constraints.erase(it_2);
- }
- }
- }
- trav->m_open_constraints.insert(node_constraints.begin(), node_constraints.end());
- }
- std::cout << "Tu sme este dosli" << std::endl;
- }
- else if (!(dynamic_cast<ConnectionNode*>(v)
- || dynamic_cast<StartNode*>(v)
- || dynamic_cast<EndNode*>(v)
- || dynamic_cast<ConditionNode*>(v)))
- {
- throw std::runtime_error("Unknown type");
- }
-
-}
-
-
-
Deleted: trunk/src/check/time/find_block.h~
===================================================================
--- trunk/src/check/time/find_block.h~ 2010-03-07 21:26:40 UTC (rev 668)
+++ trunk/src/check/time/find_block.h~ 2010-03-07 21:31:37 UTC (rev 669)
@@ -1,148 +0,0 @@
-/*
- * 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
-
-#include "data/time.h"
-#include "data/msc.h"
-#include "data/dfs_bmsc_graph_traverser.h"
-#include "check/pseudocode/msc_duplicators.h"
-#include "find_block.moc"
-
-#include <list>
-
-class TraverseAndMarkBlocks;
-
-class MyTraverse:public WhiteNodeFoundListener, public NodeFinishedListener{
-
-public:
- TraverseAndMarkBlocks* trav;
-
- MyTraverse() {};
-
- MyTraverse(TraverseAndMarkBlocks* t) {
- trav=t;
- }
- ~MyTraverse() {};
-
- void on_white_node_found(HMscNode* n);
- //void grey_node_found(HMscNode* n);
- //void black_node_found(HMscNode* n);
- void on_node_finished(HMscNode* n);
- void update_constraints(HMscNode* n);
-};
-
-
-
-
-class Block
-{
-private:
-int number;
-ReferenceNode* begin;
-ReferenceNode* end;
-bool if_end;
-public:
- Block(int n, ReferenceNode* begin, ReferenceNode* end, bool if_end) {
- this->number=n;
- this->begin=begin;
- this->end=end;
- this->if_end=if_end;
- }
- int get_number() {
- return this->number;
- }
- void set_number(int n) {
- this->number=n;
- }
- ReferenceNode* get_begin() {
- return this->begin;
- }
- void set_begin(ReferenceNode* b) {
- this->begin=b;
- }
- ReferenceNode* get_end() {
- return this->end;
- }
- void set_end(ReferenceNode* e) {
- this->end=e;
- }
- bool get_if_end() {
- return this->if_end;
- }
- void set_if_end(bool i) {
- this->if_end=i;
- }
-};
-
-/* nakoniec nie je potrebna tato trieda :)
-class MscGraphBlocks
-{
-private:
-
-//list dvojic (cislo, zaciatok, koniec)
-list<Block> list_of_blocks;
-
-public:
-
- Block get_i-th_block(int i) { //vrati smernik na blok
- for (list<Block>::iterator it = list_of_blocks.begin(); it != list_of_blocks.end(); it++) {
- if (it.get_number()==i) return it;
- }
- }
- void add_block(Block block) { //prida blok do zoznamu
- list_of_blocks.push_back(block);
- }
- void remove_block(Block block) { //odstrani blok zo zoznamu
- list_of_blocks.remove(block);
- }
-}*/
-
-
-class TraverseAndMarkBlocks
-{
-private:
-
-public:
- std::list<Block> m_list_of_blocks;
- int m_last_block;
- int m_counter_of_blocks;
- TimeRelationRefNodePtrSet m_open_constraints;
- //std::list<TimeRelationEvent> open_constraints; //pozret si time relation event
-
- TraverseAndMarkBlocks() {
- this->m_last_block=0;
- this->m_counter_of_blocks=0;
- }
-
- void travers_and_mark_blocks(HMscPtr m_msc) //dfs prehladanie a cez listener rata k uzlu prislusny blok
- {
- //BMscGraphDuplicator* duplicator= new BMscGraphDuplicator();
- //m_msc=duplicator->duplicate_hmsc(m_msc);
- DFSBMscGraphTraverser* traverser_block= new DFSBMscGraphTraverser();
- MyTraverse* my_trav= new MyTraverse(this);
- traverser_block->add_white_node_found_listener(my_trav);
- traverser_block->add_node_finished_listener(my_trav);
- //list_of_blocks= new MscGraphBlock();
- traverser_block->traverse(m_msc);
- }
-};
-
-#endif /* _FIND_BLOCK_H */
-
Deleted: trunk/tests/acyclic_checker_test
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|