File tree Expand file tree Collapse file tree 7 files changed +9
-9
lines changed
fUML-CPP/fuml/src/fuml/semantics/activities Expand file tree Collapse file tree 7 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -32,9 +32,9 @@ bool ControlToken::isControl()
32
32
return true ;
33
33
}
34
34
35
- ValuePtr ControlToken::getValue ()
35
+ const ValuePtr& ControlToken::getValue ()
36
36
{
37
37
// Control tokens do not have values.
38
-
39
- return nullptr ;
38
+ static const ValuePtr null = nullptr ;
39
+ return null ;
40
40
}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ namespace fuml::semantics::activities
20
20
virtual bool equals (const TokenPtr&) override ;
21
21
virtual TokenPtr copy () override ;
22
22
virtual bool isControl () override ;
23
- virtual ValuePtr getValue () override ;
23
+ virtual const ValuePtr& getValue () override ;
24
24
25
25
};
26
26
// ControlToken
Original file line number Diff line number Diff line change @@ -61,7 +61,7 @@ bool ForkedToken::equals(const TokenPtr& otherToken)
61
61
return (this ->thisForkedTokenPtr .lock () == otherToken);
62
62
}
63
63
64
- ValuePtr ForkedToken::getValue ()
64
+ const ValuePtr& ForkedToken::getValue ()
65
65
{
66
66
// Return the value of the base token.
67
67
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ namespace fuml::semantics::activities
30
30
virtual void withdraw () override ;
31
31
virtual TokenPtr copy () override ;
32
32
virtual bool equals (const TokenPtr&) override ;
33
- virtual ValuePtr getValue () override ;
33
+ virtual const ValuePtr& getValue () override ;
34
34
35
35
};
36
36
// ForkedToken
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ bool ObjectToken::isControl()
39
39
return false ;
40
40
} // isControl
41
41
42
- ValuePtr ObjectToken::getValue ()
42
+ const ValuePtr& ObjectToken::getValue ()
43
43
{
44
44
// Return the value of this object token.
45
45
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace fuml::semantics::activities
27
27
virtual bool equals (const TokenPtr&) override ;
28
28
virtual TokenPtr copy () override ;
29
29
virtual bool isControl () override ;
30
- virtual ValuePtr getValue () override ;
30
+ virtual const ValuePtr& getValue () override ;
31
31
};
32
32
// ObjectToken
33
33
}
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ namespace fuml::semantics::activities
31
31
virtual TokenPtr copy () = 0;
32
32
bool isWithdrawn ();
33
33
virtual bool isControl () = 0;
34
- virtual ValuePtr getValue () = 0;
34
+ virtual const ValuePtr& getValue () = 0;
35
35
};
36
36
// Token
37
37
}
You can’t perform that action at this time.
0 commit comments