reorder header
This commit is contained in:
parent
7029286883
commit
bd15cbd5aa
|
@ -34,7 +34,6 @@ namespace OSC {
|
||||||
*/
|
*/
|
||||||
Method::Method(Method *parent, std::string name)
|
Method::Method(Method *parent, std::string name)
|
||||||
: parent_(parent)
|
: parent_(parent)
|
||||||
, name_("")
|
|
||||||
{
|
{
|
||||||
if (parent)
|
if (parent)
|
||||||
parent->addChild(this);
|
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
|
* @brief Method::addChild
|
||||||
* @param child
|
* @param child
|
||||||
|
@ -198,24 +217,4 @@ std::shared_ptr<void> Method::onTrigger(const std::function<void(std::shared_ptr
|
||||||
return sp;
|
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
|
} // namespace OSC
|
||||||
|
|
|
@ -42,6 +42,8 @@ public:
|
||||||
explicit Method(Method *parent = nullptr, std::string name = "");
|
explicit Method(Method *parent = nullptr, std::string name = "");
|
||||||
virtual ~Method();
|
virtual ~Method();
|
||||||
|
|
||||||
|
bool isRoot() const;
|
||||||
|
bool isContainer() const;
|
||||||
void addChild(Method *child);
|
void addChild(Method *child);
|
||||||
|
|
||||||
std::string name() const;
|
std::string name() const;
|
||||||
|
@ -54,8 +56,6 @@ public:
|
||||||
void trigger(std::shared_ptr<Message> msg) const;
|
void trigger(std::shared_ptr<Message> msg) const;
|
||||||
std::shared_ptr<void> onTrigger(const std::function<void(std::shared_ptr<Message>)>);
|
std::shared_ptr<void> onTrigger(const std::function<void(std::shared_ptr<Message>)>);
|
||||||
|
|
||||||
bool isRoot() const;
|
|
||||||
bool isContainer() const;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Method *parent_;
|
Method *parent_;
|
||||||
|
|
Loading…
Reference in New Issue