tgba_digraph: Simplify declaration of forwarded methods.
* src/misc/common.hh (SPOT_RETURN): New macro. * src/tgba/tgbagraph.hh (out, states, transitions): Use it.
This commit is contained in:
parent
6ecd71c485
commit
df05162780
2 changed files with 18 additions and 10 deletions
|
|
@ -95,4 +95,9 @@
|
|||
|
||||
#define SPOT_UNIMPLEMENTED() throw std::runtime_error("unimplemented");
|
||||
|
||||
|
||||
// Useful when forwarding methods such as:
|
||||
// auto func(int param) SPOT_RETURN(implem_.func(param));
|
||||
#define SPOT_RETURN(code) -> decltype(code) { return code; }
|
||||
|
||||
#endif // SPOT_MISC_COMMON_HH
|
||||
|
|
|
|||
|
|
@ -332,17 +332,20 @@ namespace spot
|
|||
return g_.new_transition(src, dst, cond, acc);
|
||||
}
|
||||
|
||||
internal::state_out<const graph_t>
|
||||
out(unsigned src) const
|
||||
{
|
||||
return g_.out(src);
|
||||
}
|
||||
auto out(unsigned src) const
|
||||
SPOT_RETURN(g_.out(src));
|
||||
auto out(unsigned src)
|
||||
SPOT_RETURN(g_.out(src));
|
||||
|
||||
internal::state_out<graph_t>
|
||||
out(unsigned src)
|
||||
{
|
||||
return g_.out(src);
|
||||
}
|
||||
auto states() const
|
||||
SPOT_RETURN(g_.states());
|
||||
auto states()
|
||||
SPOT_RETURN(g_.states());
|
||||
|
||||
auto transitions() const
|
||||
SPOT_RETURN(g_.transitions());
|
||||
auto transitions()
|
||||
SPOT_RETURN(g_.transitions());
|
||||
|
||||
/// \brief Copy the acceptance conditions of another tgba.
|
||||
void copy_acceptance_conditions_of(const tgba *a)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue