67 lines
836 B
C++
67 lines
836 B
C++
#include <bitshift/validate/teardown.hxx>
|
|
|
|
namespace bitshift::validate
|
|
{
|
|
|
|
teardown::
|
|
teardown(string file, int line, function<void()> func)
|
|
: _file{std::move(file)}
|
|
, _line{line}
|
|
, _func{func}
|
|
{}
|
|
|
|
teardown::
|
|
~teardown() noexcept
|
|
{}
|
|
|
|
string const&
|
|
teardown::
|
|
file() const
|
|
{
|
|
return _file;
|
|
}
|
|
|
|
int
|
|
teardown::
|
|
line() const
|
|
{
|
|
return _line;
|
|
}
|
|
|
|
teardown*
|
|
teardown::
|
|
next()
|
|
{
|
|
return intrusive_list<teardown>::next();
|
|
}
|
|
|
|
teardown*
|
|
teardown::
|
|
previous()
|
|
{
|
|
return intrusive_list<teardown>::previous();
|
|
}
|
|
|
|
void
|
|
teardown::
|
|
run()
|
|
{
|
|
_func();
|
|
}
|
|
|
|
teardown*
|
|
teardown::
|
|
first()
|
|
{
|
|
return intrusive_list<teardown>::first();
|
|
}
|
|
|
|
teardown*
|
|
teardown::
|
|
last()
|
|
{
|
|
return intrusive_list<teardown>::last();
|
|
}
|
|
|
|
} // namespace bitshift::validate
|