~ubuntu-branches/ubuntu/lucid/structure-synth/lucid

« back to all changes in this revision

Viewing changes to StructureSynth/Model/RuleRef.h

  • Committer: Bazaar Package Importer
  • Author(s): Miriam Ruiz
  • Date: 2009-04-13 13:28:45 UTC
  • Revision ID: james.westby@ubuntu.com-20090413132845-d7d42t4llxjxq0ez
Tags: upstream-0.9
ImportĀ upstreamĀ versionĀ 0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#pragma once
 
2
 
 
3
#include "Rule.h"
 
4
 
 
5
namespace StructureSynth {
 
6
        namespace Model {       
 
7
 
 
8
                /// A RuleRef holds a pointer to a rule.
 
9
                /// Its is a placeholder, since rule are parsed as symbolic references,
 
10
                /// and need to be resolved into actual pointers after the complete parsing of the script.
 
11
                class RuleRef {
 
12
                public:
 
13
                        RuleRef(QString namedReference) : reference(namedReference) { rulePtr = 0; };
 
14
                        ~RuleRef() {};
 
15
 
 
16
                        Rule* rule() { return rulePtr; }
 
17
 
 
18
                        QString getReference() const { return reference; }
 
19
 
 
20
                        void setRef(Rule* rule) { rulePtr = rule; }
 
21
 
 
22
                private:
 
23
                        Rule* rulePtr;
 
24
                        QString reference;
 
25
                };
 
26
 
 
27
        }
 
28
}
 
29