1
0
Fork 0

reorder header

This commit is contained in:
Kevin Matz 2023-05-16 10:28:14 -04:00
parent 7029286883
commit bd15cbd5aa
2 changed files with 22 additions and 23 deletions

View File

@ -34,7 +34,6 @@ namespace OSC {
*/
Method::Method(Method *parent, std::string name)
: parent_(parent)
, name_("")
{
if (parent)
parent->addChild(this);
@ -49,6 +48,26 @@ Method::~Method()
}
/**
* @brief Method::isRoot
* @return
*/
bool Method::isRoot() const
{
return !parent_;
}
/**
* @brief Method::isContainer
* @return
*/
bool Method::isContainer() const
{
return !children_.empty();
}
/**
* @brief Method::addChild
* @param child
@ -198,24 +217,4 @@ std::shared_ptr<void> Method::onTrigger(const std::function<void(std::shared_ptr
return sp;
}
/**
* @brief Method::isRoot
* @return
*/
bool Method::isRoot() const
{
return !parent_;
}
/**
* @brief Method::isContainer
* @return
*/
bool Method::isContainer() const
{
return !children_.empty();
}
} // namespace OSC

View File

@ -42,6 +42,8 @@ public:
explicit Method(Method *parent = nullptr, std::string name = "");
virtual ~Method();
bool isRoot() const;
bool isContainer() const;
void addChild(Method *child);
std::string name() const;
@ -54,8 +56,6 @@ public:
void trigger(std::shared_ptr<Message> msg) const;
std::shared_ptr<void> onTrigger(const std::function<void(std::shared_ptr<Message>)>);
bool isRoot() const;
bool isContainer() const;
private:
Method *parent_;