#include <senf/Utils/Console/ScopedDirectory.hh>
ScopedDirectory is used whenever a class wants to manage it's own directory. The class allows to declare the directory as a public member object. This allows the user of the class to register the directory in the command tree. By using the proxy, the node is automatically detached from the tree (and thereby destroyed) when the object (and thereby the proxy) is destroyed.
class MyClass { public: ScopedDirectory<MyClass> configDir; MyClass() : configDir(this) { configDir.add(...); } };
The ScopedDirectory proxy implements 'add()' to add new children to the proxied DirectoryNode. All add() variants supported by DirectoryNode are supported by ScopedDirectory.
Definition at line 118 of file ScopedDirectory.hh.
Public Types |
|
typedef Owner | owner |
Public Member Functions |
|
template<class NodeType > | |
NodeType & | add (std::string const &name, boost::shared_ptr< NodeType > node) |
template<class NodeType > | |
NodeType & | add (std::string const &name, NodeType &node, typename boost::enable_if< boost::is_convertible< NodeType &, GenericNode & > >::type *=0) |
template<class Factory > | |
Factory::result_type | add (std::string const &name, Factory const &factory, typename boost::enable_if< boost::is_convertible< Factory *, detail::OwnedNodeFactory * > >::type *=0) |
template<class Factory > | |
Factory::result_type | add (std::string const &name, Factory const &factory, typename boost::enable_if< boost::is_convertible< Factory *, detail::NodeFactory * > >::type *=0, typename boost::disable_if< boost::is_convertible< Factory *, detail::OwnedNodeFactory * > >::type *=0) |
template<class Factory > | |
Factory::result_type | add (std::string const &name, Factory const &factory, typename boost::enable_if< boost::is_convertible< Factory *, detail::NodeFactory * > >::type *) |
Structors and default members |
|
ScopedDirectory (Owner *owner) |
typedef Owner senf::console::ScopedDirectory< Owner >:: | ||||
owner | ||||
Definition at line 124 of file ScopedDirectory.hh.
senf::console::ScopedDirectory< Owner >:: | ||||
ScopedDirectory | ( | Owner * | owner | ) |
Definition at line 37 of file ScopedDirectory.cti.
Factory::result_type senf::console::ScopedDirectory< Owner >:: | ||||
add | ( | std::string const & | name, | |
Factory const & | factory, | |||
typename boost::enable_if< boost::is_convertible< Factory *, detail::NodeFactory * > >::type * | ) | |||
Definition at line 100 of file ScopedDirectory.cti.
Factory::result_type senf::console::ScopedDirectory< Owner >:: | ||||
add | ( | std::string const & | name, | |
Factory const & | factory, | |||
typename boost::enable_if< boost::is_convertible< Factory *, detail::NodeFactory * > >::type * | = 0 , |
|||
typename boost::disable_if< boost::is_convertible< Factory *, detail::OwnedNodeFactory * > >::type * | = 0
|
) | ||
Definition at line 72 of file ScopedDirectory.cti.
Factory::result_type senf::console::ScopedDirectory< Owner >:: | ||||
add | ( | std::string const & | name, | |
Factory const & | factory, | |||
typename boost::enable_if< boost::is_convertible< Factory *, detail::OwnedNodeFactory * > >::type * | = 0
|
) | ||
Definition at line 63 of file ScopedDirectory.cti.
NodeType & senf::console::ScopedDirectory< NodeType >:: | ||||
add | ( | std::string const & | name, | |
NodeType & | node, | |||
typename boost::enable_if< boost::is_convertible< NodeType &, GenericNode & > >::type * | = 0
|
) | ||
Definition at line 54 of file ScopedDirectory.cti.
NodeType & senf::console::ScopedDirectory< NodeType >:: | ||||
add | ( | std::string const & | name, | |
boost::shared_ptr< NodeType > | node | ) | ||
Definition at line 45 of file ScopedDirectory.cti.