~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/sd/bv/adsclock.c

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//////////////////////////////////////////////////////////////////////////////////
 
2
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
3
// (c) copyright 2001, Universiteit Twente.
 
4
// Author: Rik Eshuis (eshuis@cs.utwente.nl).
 
5
//
 
6
// TCM is free software; you can redistribute it and/or modify
 
7
// it under the terms of the GNU General Public License as published by
 
8
// the Free Software Foundation; either version 2 of the License, or
 
9
// (at your option) any later version.
 
10
//
 
11
// TCM is distributed in the hope that it will be useful,
 
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
// GNU General Public License for more details.
 
15
//
 
16
// You should have received a copy of the GNU General Public License
 
17
// along with TCM; if not, write to the Free Software
 
18
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
19
// 02111-1307, USA.
 
20
////////////////////////////////////////////////////////////////////////////////
 
21
#include "adsclock.h"
 
22
#include "stdio.h"
 
23
#include "outputfile.h"
 
24
#include "adshyperedge.h"
 
25
#include "error.h"
 
26
 
 
27
Clock::Clock(ADSHyperEdge *he): ADSVar("lc",AFTER){
 
28
  hedge=he;
 
29
}
 
30
 
 
31
Clock::Clock(Edge *he): ADSVar("lc",AFTER){
 
32
  edge=he;
 
33
}
 
34
 
 
35
Clock::Clock(): ADSVar("gc",WHEN){
 
36
  hedge=0;
 
37
}
 
38
 
 
39
Clock::~Clock(){}
 
40
 
 
41
bool Clock::operator==(const Clock &comp) const {
 
42
  if ((GetName()==comp.GetName()) &&(comp.hedge==hedge) ) 
 
43
    return True; 
 
44
  else return False;
 
45
}
 
46
 
 
47
 
 
48
Clock::Clock(const Clock &copy): ADSVar(copy){
 
49
  hedge=copy.hedge;
 
50
}  
 
51
 
 
52
string Clock::GetName() const{
 
53
  if (hedge==0){
 
54
    error("hedge is null\n");
 
55
    return "";
 
56
  }
 
57
  string s="t_";
 
58
  string t= int(hedge->GetId());
 
59
  return s+t;
 
60
}
 
61
 
 
62
 
 
63
 
 
64
ADSHyperEdge  *Clock::GetHyperEdge(void){
 
65
  return hedge;
 
66
}
 
67
 
 
68
 
 
69
Edge  *Clock::GetEdge(void){
 
70
  return edge;
 
71
}